[fix] resolved merge conflicts
This commit is contained in:
commit
63590496c1
@ -5,7 +5,7 @@ import frappe
|
||||
from erpnext.hooks import regional_overrides
|
||||
from frappe.utils import getdate
|
||||
|
||||
__version__ = '10.1.25'
|
||||
__version__ = '10.1.26'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
|
@ -319,6 +319,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
},
|
||||
|
||||
pos_profile: function() {
|
||||
this.frm.doc.taxes = []
|
||||
this.set_pos_data();
|
||||
},
|
||||
|
||||
|
@ -346,8 +346,8 @@ class SalesInvoice(SellingController):
|
||||
self.terms = frappe.db.get_value("Terms and Conditions", self.tc_name, "terms")
|
||||
|
||||
# fetch charges
|
||||
if self.taxes_and_charges:
|
||||
self.set_other_charges()
|
||||
if self.taxes_and_charges and not len(self.get("taxes")):
|
||||
self.set_taxes()
|
||||
|
||||
return pos
|
||||
|
||||
|
@ -233,7 +233,7 @@ class AccountsController(TransactionBase):
|
||||
|
||||
tax_master_doctype = self.meta.get_field("taxes_and_charges").options
|
||||
|
||||
if self.is_new() and not self.get("taxes"):
|
||||
if (self.is_new() or self.is_pos_profile_changed()) and not self.get("taxes"):
|
||||
if self.company and not self.get("taxes_and_charges"):
|
||||
# get the default tax master
|
||||
self.taxes_and_charges = frappe.db.get_value(tax_master_doctype,
|
||||
@ -241,6 +241,11 @@ class AccountsController(TransactionBase):
|
||||
|
||||
self.append_taxes_from_master(tax_master_doctype)
|
||||
|
||||
def is_pos_profile_changed(self):
|
||||
if (self.doctype == 'Sales Invoice' and self.is_pos and
|
||||
self.pos_profile != frappe.db.get_value('Sales Invoice', self.name, 'pos_profile')):
|
||||
return True
|
||||
|
||||
def append_taxes_from_master(self, tax_master_doctype=None):
|
||||
if self.get("taxes_and_charges"):
|
||||
if not tax_master_doctype:
|
||||
|
@ -522,3 +522,4 @@ erpnext.patches.v11_0.move_leave_approvers_from_employee
|
||||
erpnext.patches.v11_0.update_department_lft_rgt
|
||||
erpnext.patches.v11_0.add_default_email_template_for_leave
|
||||
erpnext.patches.v11_0.set_default_email_template_in_hr
|
||||
erpnext.patches.v10_0.taxes_issue_with_pos
|
||||
|
26
erpnext/patches/v10_0/taxes_issue_with_pos.py
Normal file
26
erpnext/patches/v10_0/taxes_issue_with_pos.py
Normal file
@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2017, Frappe and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
for d in frappe.get_all('Sales Invoice', fields=["name"],
|
||||
filters = {'is_pos':1, 'docstatus': 1, 'creation': ('>', '2018-04-23')}):
|
||||
doc = frappe.get_doc('Sales Invoice', d.name)
|
||||
if (not doc.taxes and doc.taxes_and_charges and doc.pos_profile and
|
||||
frappe.db.get_value('POS Profile', doc.pos_profile, 'taxes_and_charges', cache=True) == doc.taxes_and_charges):
|
||||
|
||||
doc.append_taxes_from_master()
|
||||
doc.calculate_taxes_and_totals()
|
||||
for d in doc.taxes:
|
||||
d.db_update()
|
||||
|
||||
doc.db_update()
|
||||
|
||||
delete_gle_for_voucher(doc.name)
|
||||
doc.make_gl_entries()
|
||||
|
||||
def delete_gle_for_voucher(voucher_no):
|
||||
frappe.db.sql("""delete from `tabGL Entry` where voucher_no = %(voucher_no)s""",
|
||||
{'voucher_no': voucher_no})
|
Loading…
x
Reference in New Issue
Block a user