diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 2dde68504cf..9a2da9620cc 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -85,9 +85,9 @@ class SellingController(StockController): existing_shipping_charge = self.get("taxes", filters=shipping_charge) if existing_shipping_charge: # take the last record found - existing_shipping_charge[-1].rate = shipping_amount + existing_shipping_charge[-1].tax_amount = shipping_amount else: - shipping_charge["rate"] = shipping_amount + shipping_charge["tax_amount"] = shipping_amount shipping_charge["description"] = shipping_rule.label self.append("taxes", shipping_charge) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 54e2d0332fd..c471007e7b6 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -34,13 +34,13 @@ website_context = { website_route_rules = [ {"from_route": "/orders", "to_route": "Sales Order"}, - {"from_route": "/orders/", "to_route": "print", "defaults": {"doctype": "Sales Order"}}, + {"from_route": "/orders/", "to_route": "print", "defaults": {"doctype": "Sales Order"}}, {"from_route": "/invoices", "to_route": "Sales Invoice"}, - {"from_route": "/invoices/", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}}, + {"from_route": "/invoices/", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}}, {"from_route": "/shipments", "to_route": "Delivery Note"}, - {"from_route": "/shipments/", "to_route": "print", "defaults": {"doctype": "Delivery Note"}}, + {"from_route": "/shipments/", "to_route": "print", "defaults": {"doctype": "Delivery Note"}}, {"from_route": "/issues", "to_route": "Issue"}, - {"from_route": "/issues/", "to_route": "print", "defaults": {"doctype": "Issue"}}, + {"from_route": "/issues/", "to_route": "print", "defaults": {"doctype": "Issue"}}, {"from_route": "/addresses", "to_route": "Address"}, ] diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py index 5bac1c593a0..f7aa70fa312 100644 --- a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py +++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py @@ -72,7 +72,7 @@ def get_target_distribution_details(filters): target_details = {} for d in frappe.db.sql("""select md.name, mdp.month, mdp.percentage_allocation - from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` mdp + from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md where mdp.parent=md.name and md.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1): target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation)) diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py index 1ad344a2a9d..5fba1ff22fc 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -130,6 +130,9 @@ class ShoppingCartSettings(Document): def get_price_list(self, billing_territory): price_list = self.get_name_from_territory(billing_territory, "price_lists", "selling_price_list") + if not (price_list and price_list[0]): + price_list = self.get_name_from_territory(self.default_territory, "price_lists", "selling_price_list") + return price_list and price_list[0] or None def get_tax_master(self, billing_territory):