Revision 9619d8be
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
js/kivi.Order.js | ||
---|---|---|
782 | 782 |
kivi.SalesPurchase.edit_custom_shipto(); |
783 | 783 |
}; |
784 | 784 |
|
785 |
ns.purchase_order_check_for_direct_delivery = function() { |
|
785 |
ns.purchase_order_check_for_direct_delivery = function(params) { |
|
786 |
const to_type = params.to_type; |
|
787 |
|
|
786 | 788 |
if ($('#type').val() != 'sales_order') { |
787 |
kivi.submit_ajax_form("controller.pl", '#order_form', {action: 'Order/save_and_purchase_order'});
|
|
789 |
kivi.submit_ajax_form("controller.pl", '#order_form', {action: 'Order/save_and_order_workflow', to_type: to_type});
|
|
788 | 790 |
return; |
789 | 791 |
} |
790 | 792 |
|
... | ... | |
813 | 815 |
|
814 | 816 |
var use_it = false; |
815 | 817 |
if (!empty) { |
816 |
ns.direct_delivery_dialog(shipto); |
|
818 |
ns.direct_delivery_dialog(shipto, to_type);
|
|
817 | 819 |
} else { |
818 |
kivi.submit_ajax_form("controller.pl", '#order_form', {action: 'Order/save_and_purchase_order'});
|
|
820 |
kivi.submit_ajax_form("controller.pl", '#order_form', {action: 'Order/save_and_order_workflow', to_type: to_type});
|
|
819 | 821 |
} |
820 | 822 |
}; |
821 | 823 |
|
822 |
ns.direct_delivery_callback = function(accepted) { |
|
824 |
ns.direct_delivery_callback = function(accepted, to_type) {
|
|
823 | 825 |
$('#direct-delivery-dialog').dialog('close'); |
824 | 826 |
|
825 | 827 |
if (accepted) { |
826 | 828 |
$('<input type="hidden" name="use_shipto">').appendTo('#order_form').val('1'); |
827 | 829 |
} |
828 | 830 |
|
829 |
kivi.submit_ajax_form("controller.pl", '#order_form', {action: 'Order/save_and_purchase_order'});
|
|
831 |
kivi.submit_ajax_form("controller.pl", '#order_form', {action: 'Order/save_and_order_workflow', to_type: to_type});
|
|
830 | 832 |
}; |
831 | 833 |
|
832 |
ns.direct_delivery_dialog = function(shipto) { |
|
834 |
ns.direct_delivery_dialog = function(shipto, to_type) {
|
|
833 | 835 |
$('#direct-delivery-dialog').remove(); |
834 | 836 |
|
835 | 837 |
var text1 = kivi.t8('You have entered or selected the following shipping address for this customer:'); |
836 | 838 |
var text2 = kivi.t8('Do you want to carry this shipping address over to the new purchase order so that the vendor can deliver the goods directly to your customer?'); |
837 | 839 |
var html = '<div id="direct-delivery-dialog"><p>' + text1 + '</p><p>' + shipto + '</p><p>' + text2 + '</p>'; |
838 | 840 |
html = html + '<hr><p>'; |
839 |
html = html + '<input type="button" value="' + kivi.t8('Yes') + '" size="30" onclick="kivi.Order.direct_delivery_callback(true)">'; |
|
841 |
html = html + '<input type="button" value="' + kivi.t8('Yes') + '" size="30" onclick="kivi.Order.direct_delivery_callback(true, \'' + to_type + '\')">';
|
|
840 | 842 |
html = html + ' '; |
841 |
html = html + '<input type="button" value="' + kivi.t8('No') + '" size="30" onclick="kivi.Order.direct_delivery_callback(false)">'; |
|
843 |
html = html + '<input type="button" value="' + kivi.t8('No') + '" size="30" onclick="kivi.Order.direct_delivery_callback(false, \'' + to_type + '\')">';
|
|
842 | 844 |
html = html + '</p></div>'; |
843 | 845 |
$(html).hide().appendTo('#order_form'); |
844 | 846 |
|
Auch abrufbar als: Unified diff
Auftrags-Controller: Workflows zum Controller selber vereinheitlicht
Es gibt nun eine Methode für die Worklows und das Workflow-Ziel
wird übergeben.