Set due date in purchase invoice based on suppler invoice date (#12395)

This commit is contained in:
rohitwaghchaure 2018-01-17 16:23:04 +05:30 committed by Nabin Hait
parent 91fd29a963
commit da941af687
2 changed files with 5 additions and 2 deletions

View File

@ -666,7 +666,7 @@ class AccountsController(TransactionBase):
self.remove(item)
def set_payment_schedule(self):
posting_date = self.get("posting_date") or self.get("transaction_date")
posting_date = self.get("bill_date") or self.get("posting_date") or self.get("transaction_date")
date = self.get("due_date")
due_date = date or posting_date
grand_total = self.get("rounded_total") or self.grand_total

View File

@ -1261,11 +1261,14 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
payment_terms_template: function() {
var me = this;
if(this.frm.doc.payment_terms_template) {
var posting_date = this.frm.doc.bill_date ||
this.frm.doc.posting_date || this.frm.doc.transaction_date;
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,
posting_date: posting_date,
grand_total: this.frm.doc.rounded_total || this.frm.doc.grand_total
},
callback: function(r) {