discount loss adjustment in base currency
This commit is contained in:
parent
31724da2d6
commit
95ff2d4fed
@ -48,16 +48,6 @@
|
||||
"options": "Cost Center",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "rate",
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
"label": "Rate",
|
||||
"oldfieldname": "rate",
|
||||
"oldfieldtype": "Currency",
|
||||
"permlevel": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "col_break_1",
|
||||
"fieldtype": "Column Break",
|
||||
@ -89,6 +79,22 @@
|
||||
"report_hide": 1,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_8",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
},
|
||||
{
|
||||
"fieldname": "rate",
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
"label": "Rate",
|
||||
"oldfieldname": "rate",
|
||||
"oldfieldtype": "Currency",
|
||||
"permlevel": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_9",
|
||||
"fieldtype": "Section Break",
|
||||
@ -186,7 +192,7 @@
|
||||
"hide_heading": 1,
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-02-25 02:50:44.152307",
|
||||
"modified": "2015-03-04 15:16:30.732876",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Taxes and Charges",
|
||||
|
@ -232,6 +232,8 @@ class calculate_taxes_and_totals(object):
|
||||
and self.doc.discount_amount:
|
||||
self.adjust_discount_amount_loss(tax)
|
||||
|
||||
|
||||
|
||||
def get_current_tax_amount(self, item, tax, item_tax_map):
|
||||
tax_rate = self._get_tax_rate(tax, item_tax_map)
|
||||
current_tax_amount = 0.0
|
||||
@ -275,8 +277,10 @@ class calculate_taxes_and_totals(object):
|
||||
def adjust_discount_amount_loss(self, tax):
|
||||
discount_amount_loss = self.doc.grand_total - flt(self.doc.discount_amount) - tax.total
|
||||
tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount +
|
||||
discount_amount_loss, self.doc.precision("tax_amount", tax))
|
||||
tax.total = flt(tax.total + discount_amount_loss, self.doc.precision("total", tax))
|
||||
discount_amount_loss, tax.precision("tax_amount"))
|
||||
tax.total = flt(tax.total + discount_amount_loss, tax.precision("total"))
|
||||
|
||||
self._set_in_company_currency(tax, ["total", "tax_amount_after_discount_amount"])
|
||||
|
||||
def calculate_totals(self):
|
||||
self.doc.grand_total = flt(self.doc.get("taxes")[-1].total
|
||||
|
Loading…
x
Reference in New Issue
Block a user