-
-
-<script type='text/javascript'>
-
-function delete_order() {
- var data = $('#order_form').serializeArray();
- data.push({ name: 'action', value: 'Order/delete' });
-
- $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function save() {
- if (!check_cv()) return;
- var data = $('#order_form').serialize();
- data += '&action=Order/save';
-
- $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function create_pdf() {
- if (!check_cv()) return;
- var data = $('#order_form').serialize();
- data += '&action=Order/create_pdf';
-
- $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function download_pdf(pdf_filename, key) {
- var data = 'action=Order/download_pdf';
- data += '&type=' + $('#type').val();
- data += '&pdf_filename=' + pdf_filename;
- data += '&key=' + key;
- $.download("controller.pl", data);
-}
-
-function email() {
- if (!check_cv()) return;
- var data = $('#order_form').serialize();
- data += '&action=Order/show_email_dialog';
-
- $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function save_and_delivery_order() {
- if (!check_cv()) return;
- var data = $('#order_form').serialize();
- data += '&action=Order/save_and_delivery_order';
-
- $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function check_cv() {
- if ($('#order_[%- cv_id %]').val() == '') {
- [%- IF SELF.cv == 'customer' %]
- alert(kivi.t8('Please select a customer.'));
- [%- ELSE %]
- alert(kivi.t8('Please select a vendor.'));
- [%- END %]
- return false;
- }
- return true;
-}
-</script>