Merge pull request #17347 from nabinhait/invoice-advances
fix: don't allocate advances if POS
This commit is contained in:
@@ -356,6 +356,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
|
|
||||||
set_pos_data: function() {
|
set_pos_data: function() {
|
||||||
if(this.frm.doc.is_pos) {
|
if(this.frm.doc.is_pos) {
|
||||||
|
this.frm.set_value("allocate_advances_automatically", this.frm.doc.is_pos ? 0 : 1);
|
||||||
if(!this.frm.doc.company) {
|
if(!this.frm.doc.company) {
|
||||||
this.frm.set_value("is_pos", 0);
|
this.frm.set_value("is_pos", 0);
|
||||||
frappe.msgprint(__("Please specify Company to proceed"));
|
frappe.msgprint(__("Please specify Company to proceed"));
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class AccountsController(TransactionBase):
|
|||||||
self.validate_paid_amount()
|
self.validate_paid_amount()
|
||||||
|
|
||||||
if self.doctype in ['Purchase Invoice', 'Sales Invoice']:
|
if self.doctype in ['Purchase Invoice', 'Sales Invoice']:
|
||||||
if cint(self.allocate_advances_automatically):
|
if cint(self.allocate_advances_automatically) and not cint(self.is_pos):
|
||||||
self.set_advances()
|
self.set_advances()
|
||||||
|
|
||||||
if self.is_return:
|
if self.is_return:
|
||||||
|
|||||||
Reference in New Issue
Block a user