mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
Fix tests
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"item_code": "_Test Item Home Desktop 100",
|
"item_code": "_Test Item Home Desktop 100",
|
||||||
"item_name": "_Test Item Home Desktop 100",
|
"item_name": "_Test Item Home Desktop 100",
|
||||||
"item_tax_rate": "{\"_Test Account Excise Duty - _TC\": 10}",
|
"item_tax_template": "_Test Account Excise Duty @ 10",
|
||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"qty": 10,
|
"qty": 10,
|
||||||
"rate": 50,
|
"rate": 50,
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"item_code": "_Test Item Home Desktop 100",
|
"item_code": "_Test Item Home Desktop 100",
|
||||||
"item_name": "_Test Item Home Desktop 100",
|
"item_name": "_Test Item Home Desktop 100",
|
||||||
"item_tax_rate": "{\"_Test Account Excise Duty - _TC\": 10}",
|
"item_tax_template": "_Test Account Excise Duty @ 10",
|
||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"price_list_rate": 50,
|
"price_list_rate": 50,
|
||||||
"qty": 10,
|
"qty": 10,
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"item_code": "_Test Item Home Desktop 100",
|
"item_code": "_Test Item Home Desktop 100",
|
||||||
"item_name": "_Test Item Home Desktop 100",
|
"item_name": "_Test Item Home Desktop 100",
|
||||||
"item_tax_rate": "{\"_Test Account Excise Duty - _TC\": 10}",
|
"item_tax_template": "_Test Account Excise Duty @ 10",
|
||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"price_list_rate": 62.5,
|
"price_list_rate": 62.5,
|
||||||
"qty": 10,
|
"qty": 10,
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
|
|||||||
|
|
||||||
out["tax_category"] = get_address_tax_category(party.get("tax_category"),
|
out["tax_category"] = get_address_tax_category(party.get("tax_category"),
|
||||||
party_address, shipping_address if party_type != "Supplier" else party_address)
|
party_address, shipping_address if party_type != "Supplier" else party_address)
|
||||||
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group,
|
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company,
|
||||||
out.supplier_group, out.tax_category, party_address, shipping_address)
|
customer_group=out.customer_group, supplier_group=out.supplier_group, tax_category=out.tax_category,
|
||||||
|
billing_address=party_address, shipping_address=shipping_address)
|
||||||
|
|
||||||
if fetch_payment_terms_template:
|
if fetch_payment_terms_template:
|
||||||
out["payment_terms_template"] = get_pyt_term_template(party.name, party_type, company)
|
out["payment_terms_template"] = get_pyt_term_template(party.name, party_type, company)
|
||||||
|
|||||||
@@ -169,6 +169,8 @@ erpnext.utils.set_taxes = function(frm, triggered_from_field) {
|
|||||||
"party_type": party_type,
|
"party_type": party_type,
|
||||||
"posting_date": frm.doc.posting_date || frm.doc.transaction_date,
|
"posting_date": frm.doc.posting_date || frm.doc.transaction_date,
|
||||||
"company": frm.doc.company,
|
"company": frm.doc.company,
|
||||||
|
"customer_group": frm.doc.customer_group,
|
||||||
|
"supplier_group": frm.doc.supplier_group,
|
||||||
"tax_category": frm.doc.tax_category,
|
"tax_category": frm.doc.tax_category,
|
||||||
"billing_address": ((frm.doc.customer || frm.doc.lead) ? (frm.doc.customer_address) : (frm.doc.supplier_address)),
|
"billing_address": ((frm.doc.customer || frm.doc.lead) ? (frm.doc.customer_address) : (frm.doc.supplier_address)),
|
||||||
"shipping_address": frm.doc.shipping_address_name
|
"shipping_address": frm.doc.shipping_address_name
|
||||||
|
|||||||
@@ -303,9 +303,10 @@ def set_taxes(quotation, cart_settings):
|
|||||||
|
|
||||||
customer_group = frappe.db.get_value("Customer", quotation.customer, "customer_group")
|
customer_group = frappe.db.get_value("Customer", quotation.customer, "customer_group")
|
||||||
|
|
||||||
quotation.taxes_and_charges = set_taxes(quotation.customer, "Customer", \
|
quotation.taxes_and_charges = set_taxes(quotation.customer, "Customer",
|
||||||
quotation.transaction_date, quotation.company, customer_group, None, \
|
quotation.transaction_date, quotation.company, customer_group=customer_group, supplier_group=None,
|
||||||
quotation.customer_address, quotation.shipping_address_name, 1)
|
tax_category=quotation.tax_category, billing_address=quotation.customer_address,
|
||||||
|
shipping_address=quotation.shipping_address_name, use_for_shopping_cart=1)
|
||||||
#
|
#
|
||||||
# # clear table
|
# # clear table
|
||||||
quotation.set("taxes", [])
|
quotation.set("taxes", [])
|
||||||
|
|||||||
@@ -107,9 +107,10 @@ class TestShoppingCart(unittest.TestCase):
|
|||||||
|
|
||||||
from erpnext.accounts.party import set_taxes
|
from erpnext.accounts.party import set_taxes
|
||||||
|
|
||||||
tax_rule_master = set_taxes(quotation.customer, "Customer", \
|
tax_rule_master = set_taxes(quotation.customer, "Customer",
|
||||||
quotation.transaction_date, quotation.company, None, None, \
|
quotation.transaction_date, quotation.company, customer_group=None, supplier_group=None,
|
||||||
quotation.customer_address, quotation.shipping_address_name, 1)
|
tax_category=quotation.tax_category, billing_address=quotation.customer_address,
|
||||||
|
shipping_address=quotation.shipping_address_name, use_for_shopping_cart=1)
|
||||||
self.assertEqual(quotation.taxes_and_charges, tax_rule_master)
|
self.assertEqual(quotation.taxes_and_charges, tax_rule_master)
|
||||||
self.assertEqual(quotation.total_taxes_and_charges, 1000.0)
|
self.assertEqual(quotation.total_taxes_and_charges, 1000.0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user