From 2ced3b07d477b04e5d3b936718308b24055efe48 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Tue, 28 Jan 2014 19:16:05 +0530 Subject: [PATCH] changed fieldname from charge to taxes --- .../purchase_invoice/purchase_invoice.txt | 8 ++++---- .../doctype/sales_invoice/sales_invoice.py | 2 +- .../doctype/sales_invoice/sales_invoice.txt | 7 ++++--- .../doctype/purchase_common/purchase_common.js | 4 ++-- .../doctype/purchase_order/purchase_order.txt | 9 +++++---- erpnext/buying/doctype/supplier/supplier.txt | 17 ++++++++++++----- .../supplier_quotation/supplier_quotation.txt | 8 ++++---- erpnext/controllers/buying_controller.py | 4 ++-- erpnext/controllers/selling_controller.py | 4 ++-- erpnext/selling/doctype/customer/customer.txt | 13 ++++++++++--- erpnext/selling/doctype/quotation/quotation.txt | 8 ++++---- .../selling/doctype/sales_order/sales_order.txt | 10 ++++++---- erpnext/selling/sales_common.js | 2 +- .../doctype/delivery_note/delivery_note.txt | 9 +++++---- .../purchase_receipt/purchase_receipt.txt | 9 +++++---- erpnext/utilities/transaction_base.py | 7 ++++++- 16 files changed, 73 insertions(+), 48 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt index 5dbe9f649e3..45f7e9073dd 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-21 16:16:39", "docstatus": 0, - "modified": "2014-01-20 17:49:04", + "modified": "2014-01-28 18:46:48", "modified_by": "Administrator", "owner": "Administrator" }, @@ -324,16 +324,16 @@ "doctype": "DocField", "fieldname": "taxes", "fieldtype": "Section Break", - "label": "Taxes", + "label": "Taxes and Charges", "oldfieldtype": "Section Break", "options": "icon-money", "read_only": 0 }, { "doctype": "DocField", - "fieldname": "purchase_other_charges", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Tax Master", + "label": "Taxes and Charges", "oldfieldname": "purchase_other_charges", "oldfieldtype": "Link", "options": "Purchase Taxes and Charges Master", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 1292507a65b..5c092cfa01f 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -215,7 +215,7 @@ class DocType(SellingController): # fetch charges if self.doc.charge and not len(self.doclist.get({"parentfield": "other_charges"})): - self.set_taxes("other_charges", "charge") + self.set_taxes("other_charges", "taxes_and_charges") def get_customer_account(self): """Get Account Head to which amount needs to be Debited based on Customer""" diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt index a3be27dcf8e..49cc2133493 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-24 19:29:05", "docstatus": 0, - "modified": "2014-01-20 17:49:20", + "modified": "2014-01-28 18:43:10", "modified_by": "Administrator", "owner": "Administrator" }, @@ -376,9 +376,9 @@ }, { "doctype": "DocField", - "fieldname": "charge", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Tax Master", + "label": "Taxes and Charges", "oldfieldname": "charge", "oldfieldtype": "Link", "options": "Sales Taxes and Charges Master", @@ -1231,6 +1231,7 @@ "write": 1 }, { + "cancel": 0, "delete": 0, "doctype": "DocPerm", "role": "Customer" diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index d01627a2083..1556634d761 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -241,9 +241,9 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ } }, - purchase_other_charges: function() { + taxes_and_charges: function() { var me = this; - if(this.frm.doc.purchase_other_charges) { + if(this.frm.doc.taxes_and_charges) { return this.frm.call({ doc: this.frm.doc, method: "get_purchase_tax_details", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.txt index 2790e410882..bce007c992c 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.txt +++ b/erpnext/buying/doctype/purchase_order/purchase_order.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-21 16:16:39", "docstatus": 0, - "modified": "2014-01-20 17:49:08", + "modified": "2014-01-28 18:49:03", "modified_by": "Administrator", "owner": "Administrator" }, @@ -299,7 +299,7 @@ "doctype": "DocField", "fieldname": "taxes", "fieldtype": "Section Break", - "label": "Taxes", + "label": "Taxes and Charges", "oldfieldtype": "Section Break", "options": "icon-money", "print_hide": 0 @@ -307,9 +307,9 @@ { "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", "doctype": "DocField", - "fieldname": "purchase_other_charges", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Tax Master", + "label": "Taxes and Charges", "no_copy": 0, "oldfieldname": "purchase_other_charges", "oldfieldtype": "Link", @@ -699,6 +699,7 @@ "write": 1 }, { + "cancel": 0, "delete": 0, "doctype": "DocPerm", "role": "Supplier" diff --git a/erpnext/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.txt index 5c305f5cd0b..a5d100fdd52 100644 --- a/erpnext/buying/doctype/supplier/supplier.txt +++ b/erpnext/buying/doctype/supplier/supplier.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:11", "docstatus": 0, - "modified": "2014-01-20 17:49:29", + "modified": "2014-01-28 19:05:55", "modified_by": "Administrator", "owner": "Administrator" }, @@ -157,6 +157,14 @@ "reqd": 1, "search_index": 0 }, + { + "doctype": "DocField", + "fieldname": "default_currency", + "fieldtype": "Link", + "label": "Default Currency", + "no_copy": 1, + "options": "Currency" + }, { "doctype": "DocField", "fieldname": "default_price_list", @@ -166,11 +174,10 @@ }, { "doctype": "DocField", - "fieldname": "default_currency", + "fieldname": "default_taxes_and_charges", "fieldtype": "Link", - "label": "Default Currency", - "no_copy": 1, - "options": "Currency" + "label": "Taxes and Charges", + "options": "Purchase Taxes and Charges Master" }, { "doctype": "DocField", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt index e1441e52896..324bd410236 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-21 16:16:45", "docstatus": 0, - "modified": "2014-01-20 17:49:29", + "modified": "2014-01-28 18:50:58", "modified_by": "Administrator", "owner": "Administrator" }, @@ -290,16 +290,16 @@ "doctype": "DocField", "fieldname": "taxes", "fieldtype": "Section Break", - "label": "Taxes", + "label": "Taxes and Charges", "oldfieldtype": "Section Break", "options": "icon-money" }, { "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", "doctype": "DocField", - "fieldname": "purchase_other_charges", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Purchase Taxes and Charges", + "label": "Taxes and Charges", "no_copy": 1, "oldfieldname": "purchase_other_charges", "oldfieldtype": "Link", diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 83b590994d8..f7b1e27a44a 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -38,7 +38,7 @@ class BuyingController(StockController): self.set_missing_item_details(get_item_details) if self.doc.fields.get("__islocal"): - self.set_taxes("purchase_tax_details", "purchase_other_charges") + self.set_taxes("purchase_tax_details", "taxes_and_charges") def set_supplier_from_item_default(self): if self.meta.get_field("supplier") and not self.doc.supplier: @@ -59,7 +59,7 @@ class BuyingController(StockController): def get_purchase_tax_details(self): self.doclist = self.doc.clear_table(self.doclist, "purchase_tax_details") - self.set_taxes("purchase_tax_details", "purchase_other_charges") + self.set_taxes("purchase_tax_details", "taxes_and_charges") def validate_stock_or_nonstock_items(self): if not self.get_stock_items(): diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 52dcaaaf92b..2c1f0784cb7 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -30,7 +30,7 @@ class SellingController(StockController): self.set_missing_lead_customer_details() self.set_price_list_and_item_details() if self.doc.fields.get("__islocal"): - self.set_taxes("other_charges", "charge") + self.set_taxes("other_charges", "taxes_and_charges") def set_missing_lead_customer_details(self): if self.doc.customer: @@ -52,7 +52,7 @@ class SellingController(StockController): def get_other_charges(self): self.doclist = self.doc.clear_table(self.doclist, "other_charges") - self.set_taxes("other_charges", "charge") + self.set_taxes("other_charges", "taxes_and_charges") def apply_shipping_rule(self): if self.doc.shipping_rule: diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt index 6eabaf0a370..c6c0e9ff34b 100644 --- a/erpnext/selling/doctype/customer/customer.txt +++ b/erpnext/selling/doctype/customer/customer.txt @@ -2,7 +2,7 @@ { "creation": "2013-06-11 14:26:44", "docstatus": 0, - "modified": "2014-01-20 17:48:32", + "modified": "2014-01-28 19:06:18", "modified_by": "Administrator", "owner": "Administrator" }, @@ -26,6 +26,7 @@ "parenttype": "DocType" }, { + "cancel": 0, "doctype": "DocPerm", "name": "__common__", "parent": "Customer", @@ -252,6 +253,14 @@ "options": "Price List", "permlevel": 0 }, + { + "doctype": "DocField", + "fieldname": "default_taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "options": "Sales Taxes and Charges Master", + "permlevel": 0 + }, { "doctype": "DocField", "fieldname": "credit_days", @@ -343,7 +352,6 @@ }, { "amend": 0, - "cancel": 0, "create": 1, "delete": 0, "doctype": "DocPerm", @@ -363,7 +371,6 @@ }, { "amend": 0, - "cancel": 0, "create": 1, "delete": 1, "doctype": "DocPerm", diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt index f12a2a738ef..6cf538d806c 100644 --- a/erpnext/selling/doctype/quotation/quotation.txt +++ b/erpnext/selling/doctype/quotation/quotation.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-24 19:29:08", "docstatus": 0, - "modified": "2014-01-20 17:49:16", + "modified": "2014-01-28 18:50:17", "modified_by": "Administrator", "owner": "Administrator" }, @@ -373,17 +373,17 @@ "doctype": "DocField", "fieldname": "taxes", "fieldtype": "Section Break", - "label": "Taxes", + "label": "Taxes and Charges", "oldfieldtype": "Section Break", "options": "icon-money", "read_only": 0 }, { "doctype": "DocField", - "fieldname": "charge", + "fieldname": "taxes_and_charges", "fieldtype": "Link", "hidden": 0, - "label": "Tax Master", + "label": "Taxes and Charges", "oldfieldname": "charge", "oldfieldtype": "Link", "options": "Sales Taxes and Charges Master", diff --git a/erpnext/selling/doctype/sales_order/sales_order.txt b/erpnext/selling/doctype/sales_order/sales_order.txt index d187f67b897..01c2817306e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.txt +++ b/erpnext/selling/doctype/sales_order/sales_order.txt @@ -2,7 +2,7 @@ { "creation": "2013-06-18 12:39:59", "docstatus": 0, - "modified": "2014-01-20 17:49:23", + "modified": "2014-01-28 18:47:42", "modified_by": "Administrator", "owner": "Administrator" }, @@ -398,16 +398,16 @@ "doctype": "DocField", "fieldname": "taxes", "fieldtype": "Section Break", - "label": "Taxes", + "label": "Taxes and Charges", "oldfieldtype": "Section Break", "options": "icon-money", "print_hide": 0 }, { "doctype": "DocField", - "fieldname": "charge", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Tax Master", + "label": "Taxes and Charges", "oldfieldname": "charge", "oldfieldtype": "Link", "options": "Sales Taxes and Charges Master", @@ -928,11 +928,13 @@ "write": 1 }, { + "cancel": 0, "delete": 0, "doctype": "DocPerm", "role": "Accounts User" }, { + "cancel": 0, "delete": 0, "doctype": "DocPerm", "role": "Customer" diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 1baaf7b4d57..a9ed2b77dc7 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -518,7 +518,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ } }, - charge: function() { + taxes_and_charges: function() { var me = this; if(this.frm.doc.charge) { return this.frm.call({ diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.txt b/erpnext/stock/doctype/delivery_note/delivery_note.txt index 63b62d604c0..a20723de337 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.txt +++ b/erpnext/stock/doctype/delivery_note/delivery_note.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-24 19:29:09", "docstatus": 0, - "modified": "2014-01-20 17:48:35", + "modified": "2014-01-28 18:51:42", "modified_by": "Administrator", "owner": "Administrator" }, @@ -402,7 +402,7 @@ "doctype": "DocField", "fieldname": "taxes", "fieldtype": "Section Break", - "label": "Taxes", + "label": "Taxes and Charges", "oldfieldtype": "Section Break", "options": "icon-money", "read_only": 0 @@ -410,9 +410,9 @@ { "description": "If you have created a standard template in Sales Taxes and Charges Master, select one and click on the button below.", "doctype": "DocField", - "fieldname": "charge", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Tax Master", + "label": "Taxes and Charges", "oldfieldname": "charge", "oldfieldtype": "Link", "options": "Sales Taxes and Charges Master", @@ -1071,6 +1071,7 @@ "write": 0 }, { + "cancel": 0, "delete": 0, "doctype": "DocPerm", "role": "Customer" diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt index 960bb210fae..e1ba3622e76 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-21 16:16:39", "docstatus": 0, - "modified": "2014-01-20 17:49:12", + "modified": "2014-01-28 18:52:19", "modified_by": "Administrator", "owner": "Administrator" }, @@ -329,16 +329,16 @@ "doctype": "DocField", "fieldname": "taxes", "fieldtype": "Section Break", - "label": "Taxes", + "label": "Taxes and Charges", "oldfieldtype": "Section Break", "options": "icon-money" }, { "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", "doctype": "DocField", - "fieldname": "purchase_other_charges", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Purchase Taxes and Charges", + "label": "Taxes and Charges", "oldfieldname": "purchase_other_charges", "oldfieldtype": "Link", "options": "Purchase Taxes and Charges Master", @@ -836,6 +836,7 @@ "write": 1 }, { + "cancel": 0, "delete": 0, "doctype": "DocPerm", "role": "Supplier" diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 2c6357acff8..a1ff0f84740 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -64,7 +64,7 @@ class TransactionBase(StatusUpdater): out[f] = customer.fields.get(f) # fields prepended with default in Customer doctype - for f in ['sales_partner', 'commission_rate', 'currency', 'price_list']: + for f in ['sales_partner', 'commission_rate', 'currency', 'price_list', 'taxes_and_charges']: if customer.fields.get("default_" + f): out[f] = customer.fields.get("default_" + f) @@ -128,6 +128,11 @@ class TransactionBase(StatusUpdater): out["supplier_name"] = supplier.supplier_name if supplier.default_currency: out["currency"] = supplier.default_currency + + # fields prepended with default in Customer doctype + for f in ['currency', 'taxes_and_charges']: + if supplier.fields.get("default_" + f): + out[f] = supplier.fields.get("default_" + f) out["buying_price_list"] = self.get_user_default_price_list("buying_price_list") or \ supplier.default_price_list or self.doc.buying_price_list