Merge pull request #8417 from rohitwaghchaure/due_date_issue

[fix] POS, Due Date cannot be before Posting Date
This commit is contained in:
rohitwaghchaure 2017-04-12 14:43:21 +05:30 committed by GitHub
commit 5adce495aa

View File

@ -296,9 +296,9 @@ def make_invoice(doc_list={}, email_queue_list={}, customers_list={}):
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
validate_records(doc)
si_doc = frappe.new_doc('Sales Invoice')
si_doc.due_date = doc.get('posting_date')
si_doc.offline_pos_name = name
si_doc.update(doc)
si_doc.due_date = doc.get('posting_date')
submit_invoice(si_doc, name, doc)
name_list.append(name)
else:
@ -404,4 +404,5 @@ def save_invoice(e, si_doc, name):
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
si_doc.docstatus = 0
si_doc.flags.ignore_mandatory = True
si_doc.due_date = si_doc.posting_date
si_doc.insert()