diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 99d4f24f639..d8d3881daf0 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import flt, fmt_money, cstr, cint -from webnotes import msgprint, _ +from webnotes import msgprint, throw, _ get_value = webnotes.conn.get_value @@ -43,7 +43,7 @@ class DocType: msgprint(_("Please enter Master Name once the account is created.")) elif not webnotes.conn.exists(self.doc.master_type or self.doc.account_type, self.doc.master_name): - webnotes.throw(_("Invalid Master Name")) + throw(_("Invalid Master Name")) def validate_parent(self): """Fetch Parent Details and validation for account not to be created under ledger""" @@ -51,14 +51,19 @@ class DocType: par = webnotes.conn.sql("""select name, group_or_ledger, is_pl_account, debit_or_credit from tabAccount where name =%s""", self.doc.parent_account) if not par: - msgprint("Parent account does not exists", raise_exception=1) + throw(_("Parent account does not exists")) elif par[0][0] == self.doc.name: - msgprint("You can not assign itself as parent account", raise_exception=1) + throw(_("You can not assign itself as parent account")) elif par[0][1] != 'Group': - msgprint("Parent account can not be a ledger", raise_exception=1) + throw(_("Parent account can not be a ledger")) elif self.doc.debit_or_credit and par[0][3] != self.doc.debit_or_credit: - msgprint("You can not move a %s account under %s account" % - (self.doc.debit_or_credit, par[0][3]), raise_exception=1) + throw("{msg} {debit_or_credit} {under} {account} {acc}".format(**{ + "msg": _("You cannot move a"), + "debit_or_credit": self.doc.debit_or_credit, + "under": _("account under"), + "account": par[0][3], + "acc": _("account") + })) if not self.doc.is_pl_account: self.doc.is_pl_account = par[0][2] @@ -70,22 +75,25 @@ class DocType: if webnotes.conn.sql("""select count(*) from tabAccount where company=%s and ifnull(parent_account,'')='' and docstatus != 2""", self.doc.company)[0][0] > 4: - webnotes.msgprint("One company cannot have more than 4 root Accounts", - raise_exception=1) + throw(_("One company cannot have more than 4 root Accounts")) def validate_duplicate_account(self): if self.doc.fields.get('__islocal') or not self.doc.name: company_abbr = webnotes.conn.get_value("Company", self.doc.company, "abbr") if webnotes.conn.sql("""select name from tabAccount where name=%s""", (self.doc.account_name + " - " + company_abbr)): - msgprint("Account Name: %s already exists, please rename" - % self.doc.account_name, raise_exception=1) + throw("{name}: {acc_name} {exist}, {rename}".format(**{ + "name": _("Account Name"), + "acc_name": self.doc.account_name, + "exist": _("already exists"), + "rename": _("please rename") + })) def validate_root_details(self): #does not exists parent if webnotes.conn.exists("Account", self.doc.name): if not webnotes.conn.get_value("Account", self.doc.name, "parent_account"): - webnotes.msgprint("Root cannot be edited.", raise_exception=1) + throw(_("Root cannot be edited.")) def validate_frozen_accounts_modifier(self): old_value = webnotes.conn.get_value("Account", self.doc.name, "freeze_account") @@ -94,15 +102,18 @@ class DocType: 'frozen_accounts_modifier') if not frozen_accounts_modifier or \ frozen_accounts_modifier not in webnotes.user.get_roles(): - webnotes.throw(_("You are not authorized to set Frozen value")) + throw(_("You are not authorized to set Frozen value")) def convert_group_to_ledger(self): if self.check_if_child_exists(): - msgprint("Account: %s has existing child. You can not convert this account to ledger" % - (self.doc.name), raise_exception=1) + throw("{acc}: {account_name} {child}. {msg}".format(**{ + "acc": _("Account"), + "account_name": self.doc.name, + "child": _("has existing child"), + "msg": _("You can not convert this account to ledger") + })) elif self.check_gle_exists(): - msgprint("Account with existing transaction can not be converted to ledger.", - raise_exception=1) + throw(_("Account with existing transaction can not be converted to ledger.")) else: self.doc.group_or_ledger = 'Ledger' self.doc.save() @@ -110,11 +121,9 @@ class DocType: def convert_ledger_to_group(self): if self.check_gle_exists(): - msgprint("Account with existing transaction can not be converted to group.", - raise_exception=1) + throw(_("Account with existing transaction can not be converted to group.")) elif self.doc.master_type or self.doc.account_type: - msgprint("Cannot covert to Group because Master Type or Account Type is selected.", - raise_exception=1) + throw(_("Cannot covert to Group because Master Type or Account Type is selected.")) else: self.doc.group_or_ledger = 'Group' self.doc.save() @@ -130,9 +139,9 @@ class DocType: def validate_mandatory(self): if not self.doc.debit_or_credit: - msgprint("Debit or Credit field is mandatory", raise_exception=1) + throw(_("Debit or Credit field is mandatory")) if not self.doc.is_pl_account: - msgprint("Is PL Account field is mandatory", raise_exception=1) + throw(_("Is PL Account field is mandatory")) def validate_warehouse_account(self): if not cint(webnotes.defaults.get_global_default("auto_accounting_for_stock")): @@ -146,11 +155,11 @@ class DocType: if self.doc.master_name: self.validate_warehouse(self.doc.master_name) else: - webnotes.throw(_("Master Name is mandatory if account type is Warehouse")) + throw(_("Master Name is mandatory if account type is Warehouse")) def validate_warehouse(self, warehouse): if webnotes.conn.get_value("Stock Ledger Entry", {"warehouse": warehouse}): - webnotes.throw(_("Stock transactions exist against warehouse ") + warehouse + + throw(_("Stock transactions exist against warehouse ") + warehouse + _(" .You can not assign / modify / remove Master Name")) def update_nsm_model(self): @@ -183,22 +192,21 @@ class DocType: # If outstanding greater than credit limit and not authorized person raise exception if credit_limit > 0 and flt(total_outstanding) > credit_limit \ and not self.get_authorized_user(): - msgprint("""Total Outstanding amount (%s) for %s can not be \ + throw("""Total Outstanding amount (%s) for %s can not be \ greater than credit limit (%s). To change your credit limit settings, \ please update in the %s master""" % (fmt_money(total_outstanding), - self.doc.name, fmt_money(credit_limit), credit_limit_from), raise_exception=1) + self.doc.name, fmt_money(credit_limit), credit_limit_from)) def validate_trash(self): """checks gl entries and if child exists""" if not self.doc.parent_account: - msgprint("Root account can not be deleted", raise_exception=1) + throw(_("Root account can not be deleted")) if self.check_gle_exists(): - msgprint("""Account with existing transaction (Sales Invoice / Purchase Invoice / \ - Journal Voucher) can not be deleted""", raise_exception=1) + throw("""Account with existing transaction (Sales Invoice / Purchase Invoice / \ + Journal Voucher) can not be deleted""") if self.check_if_child_exists(): - msgprint("Child account exists for this account. You can not delete this account.", - raise_exception=1) + throw(_("Child account exists for this account. You can not delete this account.")) def on_trash(self): self.validate_trash() @@ -212,13 +220,13 @@ class DocType: # Validate properties before merging if merge: if not webnotes.conn.exists("Account", new): - webnotes.throw(_("Account ") + new +_(" does not exists")) + throw(_("Account ") + new +_(" does not exists")) val = list(webnotes.conn.get_value("Account", new_account, ["group_or_ledger", "debit_or_credit", "is_pl_account"])) if val != [self.doc.group_or_ledger, self.doc.debit_or_credit, self.doc.is_pl_account]: - webnotes.throw(_("""Merging is only possible if following \ + throw(_("""Merging is only possible if following \ properties are same in both records. Group or Ledger, Debit or Credit, Is PL Account""")) diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js index fbab41803bd..a18efaaa327 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.js +++ b/erpnext/accounts/doctype/cost_center/cost_center.js @@ -54,9 +54,9 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { function() { wn.set_route("Accounts Browser", "Cost Center"); }, 'icon-sitemap') } -cur_frm.cscript.parent_cost_center = function(doc,cdt,cdn){ +cur_frm.cscript.parent_cost_center = function(doc, cdt, cdn) { if(!doc.company){ - alert(wn._('Please enter company name first')); + msgprint(wn._('Please enter company name first')); } } diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.txt b/erpnext/accounts/doctype/pos_setting/pos_setting.txt index 1c9e0bf844f..c00e75e7e99 100755 --- a/erpnext/accounts/doctype/pos_setting/pos_setting.txt +++ b/erpnext/accounts/doctype/pos_setting/pos_setting.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-24 12:15:51", "docstatus": 0, - "modified": "2014-01-15 16:23:58", + "modified": "2014-01-29 13:08:24", "modified_by": "Administrator", "owner": "Administrator" }, @@ -22,6 +22,8 @@ "permlevel": 0 }, { + "cancel": 0, + "delete": 0, "doctype": "DocPerm", "email": 1, "name": "__common__", @@ -191,9 +193,9 @@ }, { "doctype": "DocField", - "fieldname": "charge", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Charge", + "label": "Taxes and Charges", "oldfieldname": "charge", "oldfieldtype": "Link", "options": "Sales Taxes and Charges Master", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index dda621950c6..bc992282cae 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -3,7 +3,7 @@ cur_frm.cscript.tname = "Purchase Invoice Item"; cur_frm.cscript.fname = "entries"; -cur_frm.cscript.other_fname = "purchase_tax_details"; +cur_frm.cscript.other_fname = "other_charges"; wn.provide("erpnext.accounts"); {% include 'buying/doctype/purchase_common/purchase_common.js' %}; diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index ab710f72b4b..6a6254a7fb4 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -322,7 +322,7 @@ class DocType(BuyingController): # tax table gl entries valuation_tax = {} - for tax in self.doclist.get({"parentfield": "purchase_tax_details"}): + for tax in self.doclist.get({"parentfield": "other_charges"}): if tax.category in ("Total", "Valuation and Total") and flt(tax.tax_amount): gl_entries.append( self.get_gl_dict({ diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt index 5dbe9f649e3..d0eb1b3b9d9 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-29 15:26:54", "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", @@ -342,7 +342,7 @@ }, { "doctype": "DocField", - "fieldname": "purchase_tax_details", + "fieldname": "other_charges", "fieldtype": "Table", "label": "Purchase Taxes and Charges", "oldfieldname": "purchase_tax_details", @@ -352,9 +352,9 @@ }, { "doctype": "DocField", - "fieldname": "tax_calculation", + "fieldname": "other_charges_calculation", "fieldtype": "HTML", - "label": "Tax Calculation", + "label": "Taxes and Charges Calculation", "oldfieldtype": "HTML", "print_hide": 1, "read_only": 0 diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 8a8b4a7b6e3..e2762191483 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -130,7 +130,7 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Account Discount - _TC", 168.03, 1512.30], ] - for i, tax in enumerate(wrapper.doclist.get({"parentfield": "purchase_tax_details"})): + for i, tax in enumerate(wrapper.doclist.get({"parentfield": "other_charges"})): self.assertEqual(tax.account_head, expected_values[i][0]) self.assertEqual(tax.tax_amount, expected_values[i][1]) self.assertEqual(tax.total, expected_values[i][2]) @@ -165,7 +165,7 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Account Discount - _TC", 168.03, 1512.30], ] - for i, tax in enumerate(wrapper.doclist.get({"parentfield": "purchase_tax_details"})): + for i, tax in enumerate(wrapper.doclist.get({"parentfield": "other_charges"})): self.assertEqual(tax.account_head, expected_values[i][0]) self.assertEqual(tax.tax_amount, expected_values[i][1]) self.assertEqual(tax.total, expected_values[i][2]) @@ -258,7 +258,7 @@ test_records = [ # taxes { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "Actual", "account_head": "_Test Account Shipping Charges - _TC", "cost_center": "_Test Cost Center - _TC", @@ -269,7 +269,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "On Net Total", "account_head": "_Test Account Customs Duty - _TC", "cost_center": "_Test Cost Center - _TC", @@ -280,7 +280,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "On Net Total", "account_head": "_Test Account Excise Duty - _TC", "cost_center": "_Test Cost Center - _TC", @@ -291,7 +291,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "On Previous Row Amount", "account_head": "_Test Account Education Cess - _TC", "cost_center": "_Test Cost Center - _TC", @@ -303,7 +303,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "On Previous Row Amount", "account_head": "_Test Account S&H Education Cess - _TC", "cost_center": "_Test Cost Center - _TC", @@ -315,7 +315,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "On Previous Row Total", "account_head": "_Test Account CST - _TC", "cost_center": "_Test Cost Center - _TC", @@ -327,7 +327,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "On Net Total", "account_head": "_Test Account VAT - _TC", "cost_center": "_Test Cost Center - _TC", @@ -338,7 +338,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "On Previous Row Total", "account_head": "_Test Account Discount - _TC", "cost_center": "_Test Cost Center - _TC", @@ -380,7 +380,7 @@ test_records = [ # taxes { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "Actual", "account_head": "_Test Account Shipping Charges - _TC", "cost_center": "_Test Cost Center - _TC", @@ -391,7 +391,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "Actual", "account_head": "_Test Account VAT - _TC", "cost_center": "_Test Cost Center - _TC", @@ -402,7 +402,7 @@ test_records = [ }, { "doctype": "Purchase Taxes and Charges", - "parentfield": "purchase_tax_details", + "parentfield": "other_charges", "charge_type": "Actual", "account_head": "_Test Account Customs Duty - _TC", "cost_center": "_Test Cost Center - _TC", diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js index b589651f18f..933382e5cd9 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js @@ -1,17 +1,10 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -// - -//--------- ONLOAD ------------- {% include "public/js/controllers/accounts.js" %} -cur_frm.cscript.onload = function(doc, cdt, cdn) { - -} - cur_frm.cscript.refresh = function(doc, cdt, cdn) { - cur_frm.set_footnote(wn.markdown(cur_frm.meta.description)); + cur_frm.set_footnote(wn.markdown(cur_frm.meta.description)); } // For customizing print @@ -27,120 +20,123 @@ cur_frm.pformat.in_words_import = function(doc) { return ''; } -cur_frm.pformat.purchase_tax_details= function(doc){ - - //function to make row of table - var make_row = function(title,val,bold){ - var bstart = ''; var bend = ''; - return '
';
-
- // main table
- out +='
| ||||
';
- out += '
| ||||
';
+
+ // main table
+ out +='
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' + (bold?bstart:'') + title + (bold?bend:'') + ' | ' - +'' + format_currency(val, doc.currency) + ' | ' - +'' + format_currency(val, doc.currency) + ' | ' + + ''; } - function convert_rate(val){ + function convert_rate(val) { var new_val = flt(val)/flt(doc.conversion_rate); return new_val; } @@ -71,31 +69,28 @@ cur_frm.pformat.other_charges= function(doc){ // add rows if(cl.length){ - for(var i=0;i||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
';
- out += '
\n\t\n\t \n
\n\t\n\t\n \n\n",
+ "html": "\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t \n
\n\t\n\t\n \n\n",
"module": "Buying",
"name": "__common__",
"print_format_type": "Client",
diff --git a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
index 3be7eb0f564..9e0693a61f8 100644
--- a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
+++ b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
@@ -9,7 +9,7 @@
{
"doc_type": "Purchase Order",
"doctype": "Print Format",
- "html": "\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t \n
\n\t\n\t\n \n\n",
+ "html": "\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t \n
\n\t\n\t\n \n\n",
"module": "Buying",
"name": "__common__",
"print_format_type": "Client",
diff --git a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
index 908ee785929..79016a7cecf 100644
--- a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
+++ b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
@@ -9,7 +9,7 @@
{
"doc_type": "Purchase Order",
"doctype": "Print Format",
- "html": "\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t \n
\n\t\n\t\n \n\n",
+ "html": "\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t \n
\n\t\n\t\n \n\n",
"module": "Buying",
"name": "__common__",
"print_format_type": "Client",
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index d01627a2083..039165f8914 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -62,14 +62,13 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
},
supplier: function() {
+ var me = this;
if(this.frm.doc.supplier || this.frm.doc.credit_to) {
if(!this.frm.doc.company) {
this.frm.set_value("supplier", null);
msgprint(wn._("Please specify Company"));
} else {
- var me = this;
var buying_price_list = this.frm.doc.buying_price_list;
-
return this.frm.call({
doc: this.frm.doc,
method: "set_supplier_defaults",
@@ -77,6 +76,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
callback: function(r) {
if(!r.exc) {
if(me.frm.doc.buying_price_list !== buying_price_list) me.buying_price_list();
+ if (me.frm.doc.taxes_and_charges)
+ me.frm.script_manager.trigger("taxes_and_charges")
}
}
});
@@ -241,21 +242,6 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
}
},
- purchase_other_charges: function() {
- var me = this;
- if(this.frm.doc.purchase_other_charges) {
- return this.frm.call({
- doc: this.frm.doc,
- method: "get_purchase_tax_details",
- callback: function(r) {
- if(!r.exc) {
- me.calculate_taxes_and_totals();
- }
- }
- });
- }
- },
-
calculate_taxes_and_totals: function() {
this._super();
this.calculate_total_advance("Purchase Invoice", "advance_allocation_details");
@@ -398,13 +384,6 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
}
},
- show_item_wise_taxes: function() {
- if(this.frm.fields_dict.tax_calculation) {
- $(this.get_item_wise_taxes_html())
- .appendTo($(this.frm.fields_dict.tax_calculation.wrapper).empty());
- }
- },
-
change_form_labels: function(company_currency) {
var me = this;
var field_label_map = {};
@@ -499,4 +478,4 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
});
var tname = cur_frm.cscript.tname;
-var fname = cur_frm.cscript.fname;
+var fname = cur_frm.cscript.fname;
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index edf7c82555d..5213885002b 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -5,7 +5,7 @@ wn.provide("erpnext.buying");
cur_frm.cscript.tname = "Purchase Order Item";
cur_frm.cscript.fname = "po_details";
-cur_frm.cscript.other_fname = "purchase_tax_details";
+cur_frm.cscript.other_fname = "other_charges";
{% include 'buying/doctype/purchase_common/purchase_common.js' %};
{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %}
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.txt
index 2790e410882..2dbafd228a5 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-29 15:26:21",
"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",
@@ -318,7 +318,7 @@
},
{
"doctype": "DocField",
- "fieldname": "purchase_tax_details",
+ "fieldname": "other_charges",
"fieldtype": "Table",
"label": "Purchase Taxes and Charges",
"no_copy": 0,
@@ -328,9 +328,9 @@
},
{
"doctype": "DocField",
- "fieldname": "tax_calculation",
+ "fieldname": "other_charges_calculation",
"fieldtype": "HTML",
- "label": "Tax Calculation",
+ "label": "Taxes and Charges Calculation",
"no_copy": 1,
"oldfieldtype": "HTML",
"print_hide": 1
@@ -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.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
index bc56abd9170..562e69d1f11 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
@@ -4,7 +4,7 @@
// define defaults for purchase common
cur_frm.cscript.tname = "Supplier Quotation Item";
cur_frm.cscript.fname = "quotation_items";
-cur_frm.cscript.other_fname = "purchase_tax_details";
+cur_frm.cscript.other_fname = "other_charges";
// attach required files
{% include 'buying/doctype/purchase_common/purchase_common.js' %};
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt
index e1441e52896..0a4a3ec6632 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-29 15:25:52",
"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",
@@ -308,7 +308,7 @@
},
{
"doctype": "DocField",
- "fieldname": "purchase_tax_details",
+ "fieldname": "other_charges",
"fieldtype": "Table",
"label": "Purchase Taxes and Charges",
"no_copy": 0,
@@ -318,9 +318,9 @@
},
{
"doctype": "DocField",
- "fieldname": "tax_calculation",
+ "fieldname": "other_charges_calculation",
"fieldtype": "HTML",
- "label": "Tax Calculation",
+ "label": "Taxes and Charges Calculation",
"no_copy": 1,
"oldfieldtype": "HTML",
"print_hide": 1
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 937449c6a2e..2e05903040b 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -130,6 +130,10 @@ class AccountsController(TransactionBase):
})
self.doclist.append(tax)
+
+ def get_other_charges(self):
+ self.doclist = self.doc.clear_table(self.doclist, "other_charges")
+ self.set_taxes("other_charges", "taxes_and_charges")
def calculate_taxes_and_totals(self):
self.discount_amount_applied = False
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index 83b590994d8..7ef771af835 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("other_charges", "taxes_and_charges")
def set_supplier_from_item_default(self):
if self.meta.get_field("supplier") and not self.doc.supplier:
@@ -57,14 +57,10 @@ class BuyingController(StockController):
for w in warehouses:
validate_warehouse_company(w, self.doc.company)
- 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")
-
def validate_stock_or_nonstock_items(self):
if not self.get_stock_items():
tax_for_valuation = [d.account_head for d in
- self.doclist.get({"parentfield": "purchase_tax_details"})
+ self.doclist.get({"parentfield": "other_charges"})
if d.category in ["Valuation", "Valuation and Total"]]
if tax_for_valuation:
webnotes.msgprint(_("""Tax Category can not be 'Valuation' or 'Valuation and Total' as all items are non-stock items"""), raise_exception=1)
@@ -79,7 +75,7 @@ class BuyingController(StockController):
self.doc.currency)
def calculate_taxes_and_totals(self):
- self.other_fname = "purchase_tax_details"
+ self.other_fname = "other_charges"
super(BuyingController, self).calculate_taxes_and_totals()
self.calculate_total_advance("Purchase Invoice", "advance_allocation_details")
@@ -203,7 +199,7 @@ class BuyingController(StockController):
last_stock_item_idx = d.idx
total_valuation_amount = sum([flt(d.tax_amount) for d in
- self.doclist.get({"parentfield": "purchase_tax_details"})
+ self.doclist.get({"parentfield": "other_charges"})
if d.category in ["Valuation", "Valuation and Total"]])
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index 52dcaaaf92b..bcfe0bcfad7 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:
@@ -50,10 +50,6 @@ class SellingController(StockController):
self.set_price_list_currency("Selling")
self.set_missing_item_details(get_item_details)
- def get_other_charges(self):
- self.doclist = self.doc.clear_table(self.doclist, "other_charges")
- self.set_taxes("other_charges", "charge")
-
def apply_shipping_rule(self):
if self.doc.shipping_rule:
shipping_rule = webnotes.bean("Shipping Rule", self.doc.shipping_rule)
diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
index 649c35d31d4..59bf829f51e 100644
--- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
+++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
@@ -1,31 +1,27 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-cur_frm.cscript.onload = function(doc,dt,dn){
- if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});
- if(!doc.leave_transaction_type) set_multiple(dt,dn,{leave_transaction_type:'Allocation'});
-
+cur_frm.cscript.onload = function(doc, dt, dn){
+ if(!doc.posting_date)
+ set_multiple(dt, dn, {posting_date: get_today()});
+ if(!doc.leave_transaction_type)
+ set_multiple(dt, dn, {leave_transaction_type: 'Allocation'});
}
-
-// Validation For To Date
-// ================================================================================================
cur_frm.cscript.to_date = function(doc, cdt, cdn) {
- return $c('runserverobj', args={'method':'to_date_validation','docs':wn.model.compress(make_doclist(doc.doctype, doc.name))},
- function(r, rt) {
- var doc = locals[cdt][cdn];
- if (r.message) {
- alert(wn._("To date cannot be before from date"));
- doc.to_date = '';
- refresh_field('to_date');
- }
- }
- );
+ return $c('runserverobj', args={'method':'to_date_validation','docs':wn.model.compress(make_doclist(doc.doctype, doc.name))},
+ function(r, rt) {
+ var doc = locals[cdt][cdn];
+ if (r.message) {
+ msgprint(wn._("To date cannot be before from date"));
+ doc.to_date = '';
+ refresh_field('to_date');
+ }
+ }
+ );
}
-// Allocation Type
-// ================================================================================================
cur_frm.cscript.allocation_type = function (doc, cdt, cdn){
- doc.no_of_days = '';
- refresh_field('no_of_days');
-}
+ doc.no_of_days = '';
+ refresh_field('no_of_days');
+}
\ No newline at end of file
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 79644a854e3..3eb69fd0133 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -3,20 +3,17 @@ erpnext.patches.4_0.update_user_properties
erpnext.patches.4_0.move_warehouse_user_to_restrictions
erpnext.patches.4_0.new_permissions
erpnext.patches.4_0.update_incharge_name_to_sales_person_in_maintenance_schedule
-execute:webnotes.reload_doc('accounts', 'doctype', 'sales_invoice') # 2014-01-03
-execute:webnotes.reload_doc('selling', 'doctype', 'sales_order') # 2014-01-03
-execute:webnotes.reload_doc('selling', 'doctype', 'quotation') # 2014-01-03
-execute:webnotes.reload_doc('stock', 'doctype', 'delivery_note') # 2014-01-03
-execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2014-01-03
-execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Classic') # 2014-01-03
-execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Modern') # 2014-01-03
-execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan') # 2014-01-03
-execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Classic') # 2014-01-03
-execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Modern') # 2014-01-03
-execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Spartan') # 2014-01-03
-execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Classic') # 2014-01-03
-execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Modern') # 2014-01-03
-execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Spartan') # 2014-01-03
-execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Classic') # 2014-01-03
-execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Modern') # 2014-01-03
-execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Spartan') # 2014-01-03
\ No newline at end of file
+execute:webnotes.reload_doc('accounts', 'doctype', 'sales_invoice') # 2014-01-29
+execute:webnotes.reload_doc('selling', 'doctype', 'sales_order') # 2014-01-29
+execute:webnotes.reload_doc('selling', 'doctype', 'quotation') # 2014-01-29
+execute:webnotes.reload_doc('stock', 'doctype', 'delivery_note') # 2014-01-29
+erpnext.patches.4_0.reload_sales_print_format
+execute:webnotes.reload_doc('accounts', 'doctype', 'purchase_invoice') # 2014-01-29
+execute:webnotes.reload_doc('buying', 'doctype', 'purchase_order') # 2014-01-29
+execute:webnotes.reload_doc('buying', 'doctype', 'supplier_quotation') # 2014-01-29
+execute:webnotes.reload_doc('stock', 'doctype', 'purchase_receipt') # 2014-01-29
+erpnext.patches.4_0.reload_purchase_print_format
+execute:webnotes.reload_doc('accounts', 'doctype', 'pos_setting') # 2014-01-29
+execute:webnotes.reload_doc('selling', 'doctype', 'customer') # 2014-01-29
+execute:webnotes.reload_doc('buying', 'doctype', 'supplier') # 2014-01-29
+erpnext.patches.4_0.map_charge_to_taxes_and_charges
\ No newline at end of file
diff --git a/erpnext/patches/4_0/map_charge_to_taxes_and_charges.py b/erpnext/patches/4_0/map_charge_to_taxes_and_charges.py
new file mode 100644
index 00000000000..fc51c2a7945
--- /dev/null
+++ b/erpnext/patches/4_0/map_charge_to_taxes_and_charges.py
@@ -0,0 +1,20 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def execute():
+ # udpate sales cycle
+ webnotes.conn.sql("""update `tabSales Invoice` set taxes_and_charges=charge""")
+ webnotes.conn.sql("""update `tabSales Order` set taxes_and_charges=charge""")
+ webnotes.conn.sql("""update `tabQuotation` set taxes_and_charges=charge""")
+ webnotes.conn.sql("""update `tabDelivery Note` set taxes_and_charges=charge""")
+
+ # udpate purchase cycle
+ webnotes.conn.sql("""update `tabPurchase Invoice` set taxes_and_charges=purchase_other_charges""")
+ webnotes.conn.sql("""update `tabPurchase Order` set taxes_and_charges=purchase_other_charges""")
+ webnotes.conn.sql("""update `tabSupplier Quotation` set taxes_and_charges=purchase_other_charges""")
+ webnotes.conn.sql("""update `tabPurchase Receipt` set taxes_and_charges=purchase_other_charges""")
+
+ webnotes.conn.sql("""update `tabPurchase Taxes and Charges` set parentfield='other_charges'""")
\ No newline at end of file
diff --git a/erpnext/patches/4_0/reload_purchase_print_format.py b/erpnext/patches/4_0/reload_purchase_print_format.py
new file mode 100644
index 00000000000..83f95c0e25e
--- /dev/null
+++ b/erpnext/patches/4_0/reload_purchase_print_format.py
@@ -0,0 +1,10 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def execute():
+ webnotes.reload_doc('buying', 'Print Format', 'Purchase Order Classic')
+ webnotes.reload_doc('buying', 'Print Format', 'Purchase Order Modern')
+ webnotes.reload_doc('buying', 'Print Format', 'Purchase Order Spartan')
\ No newline at end of file
diff --git a/erpnext/patches/4_0/reload_sales_print_format.py b/erpnext/patches/4_0/reload_sales_print_format.py
new file mode 100644
index 00000000000..f4cf446d3a1
--- /dev/null
+++ b/erpnext/patches/4_0/reload_sales_print_format.py
@@ -0,0 +1,20 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def execute():
+ webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice')
+ webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Classic')
+ webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Modern')
+ webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan')
+ webnotes.reload_doc('selling', 'Print Format', 'Quotation Classic')
+ webnotes.reload_doc('selling', 'Print Format', 'Quotation Modern')
+ webnotes.reload_doc('selling', 'Print Format', 'Quotation Spartan')
+ webnotes.reload_doc('selling', 'Print Format', 'Sales Order Classic')
+ webnotes.reload_doc('selling', 'Print Format', 'Sales Order Modern')
+ webnotes.reload_doc('selling', 'Print Format', 'Sales Order Spartan')
+ webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Classic')
+ webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Modern')
+ webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Spartan')
\ No newline at end of file
diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js
index 19207e7a1ee..dab58281eb3 100644
--- a/erpnext/public/js/queries.js
+++ b/erpnext/public/js/queries.js
@@ -33,7 +33,7 @@ $.extend(erpnext.queries, {
},
task: function() {
- return { query: "projects.utils.query_task" };
+ return { query: "erpnext.projects.utils.query_task" };
},
customer_filter: function(doc) {
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 0dfdd07376a..24fc3322027 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -708,4 +708,26 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
});
}
},
+
+ taxes_and_charges: function() {
+ var me = this;
+ if(this.frm.doc.taxes_and_charges) {
+ return this.frm.call({
+ doc: this.frm.doc,
+ method: "get_other_charges",
+ callback: function(r) {
+ if(!r.exc) {
+ me.calculate_taxes_and_totals();
+ }
+ }
+ });
+ }
+ },
+
+ show_item_wise_taxes: function() {
+ if(this.frm.fields_dict.other_charges_calculation) {
+ $(this.get_item_wise_taxes_html())
+ .appendTo($(this.frm.fields_dict.other_charges_calculation.wrapper).empty());
+ }
+ },
});
\ No newline at end of file
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 edcd929b9eb..a8a1c079fb2 100644
--- a/erpnext/selling/doctype/quotation/quotation.txt
+++ b/erpnext/selling/doctype/quotation/quotation.txt
@@ -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..fe78ee78ce5 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -35,8 +35,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
me.frm.set_query(opts[0], erpnext.queries[opts[1]]);
});
- if(this.frm.fields_dict.charge) {
- this.frm.set_query("charge", function() {
+ if(this.frm.fields_dict.taxes_and_charges) {
+ this.frm.set_query("taxes_and_charges", function() {
return {
filters: [
['Sales Taxes and Charges Master', 'company', '=', me.frm.doc.company],
@@ -80,7 +80,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
if(item.warehouse) filters["warehouse"] = item.warehouse
return {
- query : "controllers.queries.get_batch_no",
+ query : "erpnext.controllers.queries.get_batch_no",
filters: filters
}
}
@@ -119,6 +119,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
(me.frm.doc.selling_price_list !== selling_price_list) ?
me.selling_price_list() :
me.price_list_currency();
+ if (me.frm.doc.taxes_and_charges)
+ me.frm.script_manager.trigger("taxes_and_charges")
}
}
});
@@ -511,28 +513,6 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
this.frm.doc.in_words = this.frm.doc.in_words_export = "";
},
- show_item_wise_taxes: function() {
- if(this.frm.fields_dict.other_charges_calculation) {
- $(this.get_item_wise_taxes_html())
- .appendTo($(this.frm.fields_dict.other_charges_calculation.wrapper).empty());
- }
- },
-
- charge: function() {
- var me = this;
- if(this.frm.doc.charge) {
- return this.frm.call({
- doc: this.frm.doc,
- method: "get_other_charges",
- callback: function(r) {
- if(!r.exc) {
- me.calculate_taxes_and_totals();
- }
- }
- });
- }
- },
-
shipping_rule: function() {
var me = this;
if(this.frm.doc.shipping_rule) {
@@ -690,4 +670,4 @@ var set_sales_bom_help = function(doc) {
}
}
refresh_field('sales_bom_help');
-}
+}
\ No newline at end of file
diff --git a/erpnext/stock/Print Format/Purchase Receipt Format/Purchase Receipt Format.txt b/erpnext/stock/Print Format/Purchase Receipt Format/Purchase Receipt Format.txt
deleted file mode 100644
index d39583e90f4..00000000000
--- a/erpnext/stock/Print Format/Purchase Receipt Format/Purchase Receipt Format.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2010-08-08 17:09:34",
- "modified_by": "Administrator",
- "modified": "2011-10-19 14:18:26"
- },
- {
- "name": "__common__",
- "module": "Stock",
- "standard": "Yes",
- "html": "\n\n\n\n\n\n\n\n\n \n",
- "doctype": "Print Format"
- },
- {
- "name": "Purchase Receipt Format",
- "doctype": "Print Format"
- }
-]
\ No newline at end of file
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/item/item.js b/erpnext/stock/doctype/item/item.js
index e894d0db889..1e89dc1ca8c 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -23,7 +23,7 @@ cur_frm.cscript.refresh = function(doc) {
cur_frm.cscript.make_dashboard = function() {
cur_frm.dashboard.reset();
- if(cur_frm.doc.__islocal)
+ if(cur_frm.doc.__islocal)
return;
}
@@ -34,26 +34,27 @@ cur_frm.cscript.edit_prices_button = function() {
}
cur_frm.cscript.item_code = function(doc) {
- if(!doc.item_name) cur_frm.set_value("item_name", doc.item_code);
- if(!doc.description) cur_frm.set_value("description", doc.item_code);
+ if(!doc.item_name)
+ cur_frm.set_value("item_name", doc.item_code);
+ if(!doc.description)
+ cur_frm.set_value("description", doc.item_code);
}
cur_frm.fields_dict['default_bom'].get_query = function(doc) {
- //var d = locals[this.doctype][this.docname];
- return{
- filters:{
- 'item': doc.item_code,
- 'is_active': 0
- }
- }
+ return {
+ filters: {
+ 'item': doc.item_code,
+ 'is_active': 0
+ }
+ }
}
// Expense Account
// ---------------------------------
-cur_frm.fields_dict['purchase_account'].get_query = function(doc){
- return{
- filters:{
+cur_frm.fields_dict['purchase_account'].get_query = function(doc) {
+ return {
+ filters: {
'debit_or_credit': "Debit",
'group_or_ledger': "Ledger"
}
@@ -63,8 +64,8 @@ cur_frm.fields_dict['purchase_account'].get_query = function(doc){
// Income Account
// --------------------------------
cur_frm.fields_dict['default_income_account'].get_query = function(doc) {
- return{
- filters:{
+ return {
+ filters: {
'debit_or_credit': "Credit",
'group_or_ledger': "Ledger",
'account_type': "Income Account"
@@ -76,7 +77,7 @@ cur_frm.fields_dict['default_income_account'].get_query = function(doc) {
// Purchase Cost Center
// -----------------------------
cur_frm.fields_dict['cost_center'].get_query = function(doc) {
- return{
+ return {
filters:{ 'group_or_ledger': "Ledger" }
}
}
@@ -85,15 +86,15 @@ cur_frm.fields_dict['cost_center'].get_query = function(doc) {
// Sales Cost Center
// -----------------------------
cur_frm.fields_dict['default_sales_cost_center'].get_query = function(doc) {
- return{
+ return {
filters:{ 'group_or_ledger': "Ledger" }
}
}
cur_frm.fields_dict['item_tax'].grid.get_field("tax_type").get_query = function(doc, cdt, cdn) {
- return{
- filters:[
+ return {
+ filters: [
['Account', 'account_type', 'in',
'Tax, Chargeable, Income Account, Expense Account'],
['Account', 'docstatus', '!=', 2]
@@ -102,12 +103,10 @@ cur_frm.fields_dict['item_tax'].grid.get_field("tax_type").get_query = function(
}
cur_frm.cscript.tax_type = function(doc, cdt, cdn){
- var d = locals[cdt][cdn];
- return get_server_fields('get_tax_rate',d.tax_type,'item_tax',doc, cdt, cdn, 1);
+ var d = locals[cdt][cdn];
+ return get_server_fields('get_tax_rate', d.tax_type, 'item_tax', doc, cdt, cdn, 1);
}
-
-//get query select item group
cur_frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) {
return {
filters: [
@@ -116,44 +115,39 @@ cur_frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) {
}
}
-// for description from attachment
-// takes the first attachment and creates
-// a table with both image and attachment in HTML
-// in the "alternate_description" field
cur_frm.cscript.add_image = function(doc, dt, dn) {
if(!doc.image) {
msgprint(wn._('Please select an "Image" first'));
return;
}
- doc.description_html = repl('\n \n\nPurchase Receipt: Date: \n\n\n \n\n\n \n\n\n\n \n\n \n \n\n
Payment Terms For NCSCI (Authorised Signatory)
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||