Revision 12d1af89
Von Tamino Steinert vor etwa 1 Monat hinzugefügt
SL/Controller/POS.pm | ||
---|---|---|
use SL::Model::Record;
|
||
use SL::DB::ValidityToken;
|
||
use SL::DB::Order::TypeData qw(:types);
|
||
use SL::DB::DeliveryOrder::TypeData qw(:types);
|
||
|
||
use SL::Locale::String qw(t8);
|
||
|
||
... | ... | |
|
||
);
|
||
}
|
||
|
||
sub action_to_delivery_order {
|
||
my ($self) = @_;
|
||
my $order = $self->order;
|
||
|
||
my $delivery_order = SL::Model::Record->new_from_workflow(
|
||
$order,
|
||
SALES_DELIVERY_ORDER_TYPE(),
|
||
{
|
||
no_linked_records => 1, # order is not saved
|
||
}
|
||
);
|
||
|
||
# $main::lxdebug->dump(0, "TST: ", $delivery_order);
|
||
# $main::lxdebug->dump(0, "TST: ", $delivery_order->items());
|
||
|
||
}
|
||
|
||
#
|
||
# helpers
|
||
#
|
js/kivi.POS.js | ||
---|---|---|
namespace('kivi.POS', function(ns) {
|
||
ns.check_items = function() {
|
||
|
||
if ($('.row_entry').length == 0) {
|
||
alert(kivi.t8('Please add items first.'));
|
||
return false;
|
||
}
|
||
|
||
return true;
|
||
};
|
||
|
||
ns.delete_order_item_row_point_of_sales = function(item_id) {
|
||
var row = $('#item_' + item_id).parents("tbody").first();
|
||
$(row).remove();
|
||
... | ... | |
$("#add_discount_item_dialog").dialog("close");
|
||
}
|
||
|
||
ns.submit = function(params) {
|
||
if (!kivi.Order.check_cv()) return;
|
||
if (!ns.check_items()) return;
|
||
|
||
const action = params.action;
|
||
|
||
var data = $('#order_form').serializeArray();
|
||
data.push({ name: 'action', value: 'POS/' + action });
|
||
|
||
$.post("controller.pl", data, kivi.eval_json_result);
|
||
}
|
||
|
||
});
|
templates/design40_webpages/pos/form.html | ||
---|---|---|
<div class="pos_button control-panel">Nachdruck Quittung</div>
|
||
<div class="pos_button control-panel">Auf Rechnung</div>
|
||
<div class="pos_button control-panel">Entnahme erfassen</div>
|
||
<div class="pos_button control-panel">Auf Lieferschein</div>
|
||
<div
|
||
class="pos_button control-panel"
|
||
onclick="kivi.POS.submit({action: 'to_delivery_order'})"
|
||
>
|
||
[% "on Delivery Order" | $T8 %]
|
||
</div>
|
||
<div class="pos_button control-panel">Quittung parken</div>
|
||
<div class="pos_button control-panel">geparkte Quittung</div>
|
||
<div class="pos_button control-panel">Bezahlen</div>
|
Auch abrufbar als: Unified diff
POS: WIP: Auf Lieferschein