[fix] POS, Due Date cannot be before Posting Date

This commit is contained in:
Rohit Waghchaure 2017-04-12 13:19:05 +05:30
parent 4782e8b751
commit 2192c244c0

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()