fix: Add multiple fixes
This commit is contained in:
parent
9e648183db
commit
911818a9e2
@ -160,7 +160,7 @@
|
|||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "included_in_paid_amount",
|
"fieldname": "included_in_paid_amount",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Included In Paid Amount"
|
"label": "Considered In Paid Amount"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "allocated_amount",
|
"fieldname": "allocated_amount",
|
||||||
@ -186,7 +186,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-06-08 07:04:44.287002",
|
"modified": "2021-06-09 11:46:58.373170",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Advance Taxes and Charges",
|
"name": "Advance Taxes and Charges",
|
||||||
|
@ -1133,7 +1133,7 @@ frappe.ui.form.on('Payment Entry', {
|
|||||||
let tax_rate = tax.rate;
|
let tax_rate = tax.rate;
|
||||||
|
|
||||||
if (tax.charge_type == "Actual") {
|
if (tax.charge_type == "Actual") {
|
||||||
current_tax_fraction = tax.tax_amount/frm.doc.paid_amount_after_tax;
|
current_tax_fraction = tax.tax_amount/(frm.doc.paid_amount_after_tax + frm.doc.tax_amount);
|
||||||
} else if(tax.charge_type == "On Paid Amount") {
|
} else if(tax.charge_type == "On Paid Amount") {
|
||||||
current_tax_fraction = (tax_rate / 100.0);
|
current_tax_fraction = (tax_rate / 100.0);
|
||||||
} else if(tax.charge_type == "On Previous Row Amount") {
|
} else if(tax.charge_type == "On Previous Row Amount") {
|
||||||
|
@ -681,13 +681,16 @@
|
|||||||
"hide_border": 1
|
"hide_border": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval:doc.apply_tax_withholding_amount",
|
||||||
|
"description": "Provisional tax account for advance tax. Taxes are parked in this account until payments are allocated to invoices",
|
||||||
"fieldname": "advance_tax_account",
|
"fieldname": "advance_tax_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Advance Tax Account",
|
"label": "Advance Tax Account",
|
||||||
"mandatory_depends_on": "doc.base_total_taxes_and_charges",
|
"mandatory_depends_on": "eval:doc.apply_tax_withholding_amount",
|
||||||
"options": "Account"
|
"options": "Account"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval:doc.received_amount",
|
||||||
"fieldname": "received_amount_after_tax",
|
"fieldname": "received_amount_after_tax",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Received Amount After Tax",
|
"label": "Received Amount After Tax",
|
||||||
@ -704,7 +707,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-05-31 01:54:18.378910",
|
"modified": "2021-06-09 11:55:04.215050",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Entry",
|
"name": "Payment Entry",
|
||||||
|
@ -400,6 +400,9 @@ class PaymentEntry(AccountsController):
|
|||||||
if not self.apply_tax_withholding_amount:
|
if not self.apply_tax_withholding_amount:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not self.advance_tax_account:
|
||||||
|
frappe.throw(_("Advance TDS account is mandatory for advance TDS deduction"))
|
||||||
|
|
||||||
reference_doclist = []
|
reference_doclist = []
|
||||||
net_total = self.paid_amount
|
net_total = self.paid_amount
|
||||||
included_in_paid_amount = 0
|
included_in_paid_amount = 0
|
||||||
@ -916,7 +919,7 @@ class PaymentEntry(AccountsController):
|
|||||||
tax_rate = tax.rate
|
tax_rate = tax.rate
|
||||||
|
|
||||||
if tax.charge_type == 'Actual':
|
if tax.charge_type == 'Actual':
|
||||||
current_tax_fraction = tax.tax_amount/self.paid_amount_after_tax
|
current_tax_fraction = tax.tax_amount/ (self.paid_amount_after_tax + tax.tax_amount)
|
||||||
elif tax.charge_type == "On Paid Amount":
|
elif tax.charge_type == "On Paid Amount":
|
||||||
current_tax_fraction = tax_rate / 100.0
|
current_tax_fraction = tax_rate / 100.0
|
||||||
|
|
||||||
|
@ -68,9 +68,6 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
super(PurchaseInvoice, self).validate()
|
super(PurchaseInvoice, self).validate()
|
||||||
|
|
||||||
# apply tax withholding only if checked and applicable
|
|
||||||
self.set_tax_withholding()
|
|
||||||
|
|
||||||
if not self.is_return:
|
if not self.is_return:
|
||||||
self.po_required()
|
self.po_required()
|
||||||
self.pr_required()
|
self.pr_required()
|
||||||
|
@ -975,6 +975,7 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
|
|
||||||
# Create Payment Entry Against the order
|
# Create Payment Entry Against the order
|
||||||
payment_entry = get_payment_entry(dt='Purchase Order', dn=po.name)
|
payment_entry = get_payment_entry(dt='Purchase Order', dn=po.name)
|
||||||
|
payment_entry.paid_from = 'Cash - _TC'
|
||||||
payment_entry.save()
|
payment_entry.save()
|
||||||
payment_entry.submit()
|
payment_entry.submit()
|
||||||
|
|
||||||
|
@ -221,13 +221,13 @@
|
|||||||
"description": "If checked, the tax amount will be considered as already included in the Paid Amount in Payment Entry",
|
"description": "If checked, the tax amount will be considered as already included in the Paid Amount in Payment Entry",
|
||||||
"fieldname": "included_in_paid_amount",
|
"fieldname": "included_in_paid_amount",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Included In Paid Amount"
|
"label": "Considered In Paid Amount"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-05-31 03:41:38.298937",
|
"modified": "2021-06-09 11:48:25.335733",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Taxes and Charges",
|
"name": "Purchase Taxes and Charges",
|
||||||
|
@ -198,14 +198,14 @@
|
|||||||
"description": "If checked, the tax amount will be considered as already included in the Paid Amount in Payment Entry",
|
"description": "If checked, the tax amount will be considered as already included in the Paid Amount in Payment Entry",
|
||||||
"fieldname": "included_in_paid_amount",
|
"fieldname": "included_in_paid_amount",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Included In Paid Amount"
|
"label": "Considered In Paid Amount"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-05-31 05:40:32.856780",
|
"modified": "2021-06-09 11:48:04.691596",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Taxes and Charges",
|
"name": "Sales Taxes and Charges",
|
||||||
|
@ -116,6 +116,8 @@ class AccountsController(TransactionBase):
|
|||||||
|
|
||||||
if self.doctype == 'Purchase Invoice':
|
if self.doctype == 'Purchase Invoice':
|
||||||
self.calculate_paid_amount()
|
self.calculate_paid_amount()
|
||||||
|
# apply tax withholding only if checked and applicable
|
||||||
|
self.set_tax_withholding()
|
||||||
|
|
||||||
if self.doctype in ['Purchase Invoice', 'Sales Invoice']:
|
if self.doctype in ['Purchase Invoice', 'Sales Invoice']:
|
||||||
pos_check_field = "is_pos" if self.doctype=="Sales Invoice" else "is_paid"
|
pos_check_field = "is_pos" if self.doctype=="Sales Invoice" else "is_paid"
|
||||||
@ -742,7 +744,8 @@ class AccountsController(TransactionBase):
|
|||||||
def allocate_advance_taxes(self, gl_entries):
|
def allocate_advance_taxes(self, gl_entries):
|
||||||
tax_map = self.get_tax_map()
|
tax_map = self.get_tax_map()
|
||||||
for pe in self.get("advances"):
|
for pe in self.get("advances"):
|
||||||
if pe.reference_type == "Payment Entry":
|
if pe.reference_type == "Payment Entry" and \
|
||||||
|
frappe.db.get_value('Payment Entry', pe.reference_name, 'advance_tax_account'):
|
||||||
pe = frappe.get_doc("Payment Entry", pe.reference_name)
|
pe = frappe.get_doc("Payment Entry", pe.reference_name)
|
||||||
for tax in pe.get("taxes"):
|
for tax in pe.get("taxes"):
|
||||||
account_currency = get_account_currency(tax.account_head)
|
account_currency = get_account_currency(tax.account_head)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user