Payment Terms in Delivery Note #12167 (#12293)

* add Payment Terms Template field to delivery note:
- This helps for users who create invoice from Sales Invoice
- Field is hidden in print
- Field is not coupled to Payment Schedule table.

* do nothing in payment_terms_template trigger if doctype is Delivery Note
This commit is contained in:
tundebabzy
2018-01-05 08:16:50 +01:00
committed by Nabin Hait
parent 48351e0339
commit 8f44d1c63d
2 changed files with 95 additions and 5 deletions

View File

@@ -1231,13 +1231,14 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
payment_terms_template: function() {
var me = this;
if(this.frm.doc.payment_terms_template) {
const doc = this.frm.doc;
if(doc.payment_terms_template && doc.doctype !== 'Delivery Note') {
frappe.call({
method: "erpnext.controllers.accounts_controller.get_payment_terms",
args: {
terms_template: this.frm.doc.payment_terms_template,
posting_date: this.frm.doc.posting_date || this.frm.doc.transaction_date,
grand_total: this.frm.doc.rounded_total || this.frm.doc.grand_total
terms_template: doc.payment_terms_template,
posting_date: doc.posting_date || doc.transaction_date,
grand_total: doc.rounded_total || doc.grand_total
},
callback: function(r) {
if(r.message && !r.exc) {