Merge pull request #3350 from anandpdoshi/anand-may-26

Fixes in shopping cart and website route rules
This commit is contained in:
Rushabh Mehta 2015-05-27 15:09:09 +05:30
commit 0d79be5628
4 changed files with 10 additions and 7 deletions

View File

@ -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)

View File

@ -34,13 +34,13 @@ website_context = {
website_route_rules = [
{"from_route": "/orders", "to_route": "Sales Order"},
{"from_route": "/orders/<name>", "to_route": "print", "defaults": {"doctype": "Sales Order"}},
{"from_route": "/orders/<path:name>", "to_route": "print", "defaults": {"doctype": "Sales Order"}},
{"from_route": "/invoices", "to_route": "Sales Invoice"},
{"from_route": "/invoices/<name>", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}},
{"from_route": "/invoices/<path:name>", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}},
{"from_route": "/shipments", "to_route": "Delivery Note"},
{"from_route": "/shipments/<name>", "to_route": "print", "defaults": {"doctype": "Delivery Note"}},
{"from_route": "/shipments/<path:name>", "to_route": "print", "defaults": {"doctype": "Delivery Note"}},
{"from_route": "/issues", "to_route": "Issue"},
{"from_route": "/issues/<name>", "to_route": "print", "defaults": {"doctype": "Issue"}},
{"from_route": "/issues/<path:name>", "to_route": "print", "defaults": {"doctype": "Issue"}},
{"from_route": "/addresses", "to_route": "Address"},
]

View File

@ -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))

View File

@ -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):