[webshop] territories in price list, taxes, updates in shopping cart settings

This commit is contained in:
Anand Doshi
2013-06-21 17:55:31 +05:30
parent d52b03a8cc
commit 61a2f68bc6
33 changed files with 462 additions and 137 deletions

View File

@@ -269,7 +269,7 @@ class TestSalesInvoice(unittest.TestCase):
def test_sales_invoice_gl_entry_without_aii(self):
webnotes.defaults.set_global_default("auto_inventory_accounting", 0)
si = webnotes.bean(webnotes.copy_doclist(test_records[1]))
si = webnotes.bean(copy=test_records[1])
si.insert()
si.submit()
@@ -711,7 +711,7 @@ test_records = [
"qty": 1.0,
"basic_rate": 500.0,
"amount": 500.0,
"export_rate": 500.0,
"ref_rate": 500.0,
"export_amount": 500.0,
"income_account": "Sales - _TC",
"expense_account": "_Test Account Cost for Goods Sold - _TC",

View File

@@ -25,9 +25,9 @@ class DocType:
def get_rate(self, arg):
from webnotes.model.code import get_obj
return get_obj('Sales Common').get_rate(arg)
def update_other_default_charges(self):
webnotes.conn.sql("update `tabSales Taxes and Charges Master` set is_default = 0 where ifnull(is_default,0) = 1 and name != '%s' and company = '%s'" % (self.doc.name, self.doc.company))
def on_update(self):
self.update_other_default_charges()
def validate(self):
if self.doc.is_default == 1:
webnotes.conn.sql("""update `tabSales Taxes and Charges Master` set is_default = 0
where ifnull(is_default,0) = 1 and name != %s and company = %s""",
(self.doc.name, self.doc.company))

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:09",
"docstatus": 0,
"modified": "2013-01-22 14:57:23",
"modified": "2013-06-20 16:49:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -55,14 +55,9 @@
"label": "Default"
},
{
"description": "* Will be calculated in the transaction.",
"doctype": "DocField",
"fieldname": "other_charges",
"fieldtype": "Table",
"label": "Sales Taxes and Charges Master",
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges"
"fieldname": "column_break_3",
"fieldtype": "Column Break"
},
{
"doctype": "DocField",
@@ -76,6 +71,30 @@
"reqd": 1,
"search_index": 0
},
{
"doctype": "DocField",
"fieldname": "section_break_5",
"fieldtype": "Section Break"
},
{
"description": "* Will be calculated in the transaction.",
"doctype": "DocField",
"fieldname": "other_charges",
"fieldtype": "Table",
"label": "Sales Taxes and Charges Master",
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges"
},
{
"description": "Specify a list of Territories, for which, this Taxes Master is valid",
"doctype": "DocField",
"fieldname": "valid_for_territories",
"fieldtype": "Table",
"label": "Valid for Territories",
"options": "For Territory",
"reqd": 1
},
{
"amend": 0,
"cancel": 0,