// alert(url);
window.open(url, "_new_generic", parm);
}
-
-function warn_save_active_periodic_invoice() {
- return confirm(kivi.t8('This sales order has an active configuration for periodic invoices. If you save then all subsequently created invoices will contain those changes as well, but not those that have already been created. Do you want to continue?'));
-}
return confirm(kivi.t8('There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?'));
};
+ this.oe_warn_save_active_periodic_invoice = function() {
+ return confirm(kivi.t8('This sales order has an active configuration for periodic invoices. If you save then all subsequently created invoices will contain those changes as well, but not those that have already been created. Do you want to continue?'));
+ };
+
this.on_submit_checks = function() {
var $button = $(this);
if (($button.data('check-transfer-qty') == 1) && !kivi.SalesPurchase.delivery_order_check_transfer_qty())
return false;
+ if (($button.data('warn-save-active-periodic-invoice') == 1) && !kivi.SalesPurchase.oe_warn_save_active_periodic_invoice())
+ return false;
+
return true;
};
<input class="submit" type="submit" name="action_ship_to" value="[% 'Ship to' | $T8 %]">
<input class="submit" type="submit" name="action_print" value="[% 'Print' | $T8 %]">
<input class="submit" type="submit" name="action_e_mail" value="[% 'E-mail' | $T8 %]">
-<input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]"[% IF warn_save_active_periodic_invoice %] onclick="return warn_save_active_periodic_invoice();"[% END %]>
-<input class="submit" type="submit" name="action_save_and_close" value="[% 'Save and Close' | $T8 %]"[% IF warn_save_active_periodic_invoice %] onclick="return warn_save_active_periodic_invoice();"[% END %]>
+<input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]"[% IF warn_save_active_periodic_invoice %] data-warn-save-active-periodic-invoice="1"[% END %]>
+<input class="submit" type="submit" name="action_save_and_close" value="[% 'Save and Close' | $T8 %]"[% IF warn_save_active_periodic_invoice %] data-warn-save-active-periodic-invoice="1"[% END %]>
[%- IF id %]
<input type="button" class="submit" onclick="follow_up_window()" value="[% 'Follow-Up' | $T8 %]">
[% END %]
</form>
+<script type='text/javascript'>
+ $(kivi.SalesPurchase.init_on_submit_checks);
+</script>