Revision 12d1af89
Von Tamino Steinert vor 1 Tag hinzugefügt
SL/Controller/POS.pm | ||
---|---|---|
8 | 8 |
use SL::Model::Record; |
9 | 9 |
use SL::DB::ValidityToken; |
10 | 10 |
use SL::DB::Order::TypeData qw(:types); |
11 |
use SL::DB::DeliveryOrder::TypeData qw(:types); |
|
11 | 12 |
|
12 | 13 |
use SL::Locale::String qw(t8); |
13 | 14 |
|
... | ... | |
84 | 85 |
|
85 | 86 |
); |
86 | 87 |
} |
88 |
|
|
89 |
sub action_to_delivery_order { |
|
90 |
my ($self) = @_; |
|
91 |
my $order = $self->order; |
|
92 |
|
|
93 |
my $delivery_order = SL::Model::Record->new_from_workflow( |
|
94 |
$order, |
|
95 |
SALES_DELIVERY_ORDER_TYPE(), |
|
96 |
{ |
|
97 |
no_linked_records => 1, # order is not saved |
|
98 |
} |
|
99 |
); |
|
100 |
|
|
101 |
# $main::lxdebug->dump(0, "TST: ", $delivery_order); |
|
102 |
# $main::lxdebug->dump(0, "TST: ", $delivery_order->items()); |
|
103 |
|
|
104 |
} |
|
105 |
|
|
87 | 106 |
# |
88 | 107 |
# helpers |
89 | 108 |
# |
js/kivi.POS.js | ||
---|---|---|
1 | 1 |
namespace('kivi.POS', function(ns) { |
2 |
ns.check_items = function() { |
|
3 |
|
|
4 |
if ($('.row_entry').length == 0) { |
|
5 |
alert(kivi.t8('Please add items first.')); |
|
6 |
return false; |
|
7 |
} |
|
8 |
|
|
9 |
return true; |
|
10 |
}; |
|
11 |
|
|
2 | 12 |
ns.delete_order_item_row_point_of_sales = function(item_id) { |
3 | 13 |
var row = $('#item_' + item_id).parents("tbody").first(); |
4 | 14 |
$(row).remove(); |
... | ... | |
78 | 88 |
$("#add_discount_item_dialog").dialog("close"); |
79 | 89 |
} |
80 | 90 |
|
91 |
ns.submit = function(params) { |
|
92 |
if (!kivi.Order.check_cv()) return; |
|
93 |
if (!ns.check_items()) return; |
|
94 |
|
|
95 |
const action = params.action; |
|
96 |
|
|
97 |
var data = $('#order_form').serializeArray(); |
|
98 |
data.push({ name: 'action', value: 'POS/' + action }); |
|
99 |
|
|
100 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
101 |
} |
|
102 |
|
|
81 | 103 |
}); |
templates/design40_webpages/pos/form.html | ||
---|---|---|
362 | 362 |
<div class="pos_button control-panel">Nachdruck Quittung</div> |
363 | 363 |
<div class="pos_button control-panel">Auf Rechnung</div> |
364 | 364 |
<div class="pos_button control-panel">Entnahme erfassen</div> |
365 |
<div class="pos_button control-panel">Auf Lieferschein</div> |
|
365 |
<div |
|
366 |
class="pos_button control-panel" |
|
367 |
onclick="kivi.POS.submit({action: 'to_delivery_order'})" |
|
368 |
> |
|
369 |
[% "on Delivery Order" | $T8 %] |
|
370 |
</div> |
|
366 | 371 |
<div class="pos_button control-panel">Quittung parken</div> |
367 | 372 |
<div class="pos_button control-panel">geparkte Quittung</div> |
368 | 373 |
<div class="pos_button control-panel">Bezahlen</div> |
Auch abrufbar als: Unified diff
POS: WIP: Auf Lieferschein