merge
diff --git a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html
index bdb7a01..bb27897 100644
--- a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html
+++ b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html
@@ -3,7 +3,7 @@
{%- endif -%}
<!-- Page Layout Settings -->
<div class='common page-header'>
- <table class='header-table' cellspacing=0>
+ <table class='header-table' cellspacing=0 style="width: 100%">
<thead>
<tr><td colspan="2"><h1>{{ doc.select_print_heading or 'Invoice' }}</h1></td></tr>
<tr><td colspan="2"><h3>{{ doc.name }}</h3></td></tr>
@@ -28,18 +28,18 @@
<tr>
<td width=40%><b>Invoice Date</b></td>
<td>{{ utils.formatdate(doc.posting_date) }}</td>
- <tr>
+ </tr>
{%- if doc.convert_into_recurring_invoice and doc.recurring_id -%}
<tr>
<td width=40%><b>Invoice Period</b></td>
<td>{{ (utils.formatdate(doc.invoice_period_from_date)) +
' to ' + utils.formatdate(doc.invoice_period_to_date) }}</td>
- <tr>
+ </tr>
{%- endif -%}
<tr>
<td><b>Due Date</b></td>
<td>{{ utils.formatdate(doc.due_date) }}</td>
- <tr>
+ </tr>
</tbody></table></td>
</tr>
</tbody>
diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py
index 99d4f24..d8d3881 100644
--- a/erpnext/accounts/doctype/account/account.py
+++ b/erpnext/accounts/doctype/account/account.py
@@ -5,7 +5,7 @@
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 @@
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 @@
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 @@
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 @@
'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 @@
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 @@
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 @@
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 @@
# 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 <b>%s</b> can not be \
+ throw("""Total Outstanding amount (%s) for <b>%s</b> can not be \
greater than credit limit (%s). To change your credit limit settings, \
please update in the <b>%s</b> 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 @@
# 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/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
index 3e50ad7..1edacd6 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
@@ -1,9 +1,8 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-
cur_frm.add_fetch("bank_account", "company", "company");
cur_frm.cscript.onload = function(doc, cdt, cdn){
cur_frm.set_intro('<i class="icon-question" /> ' +
wn._("Update clearance date of Journal Entries marked as 'Bank Vouchers'"))
-}
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js
index fbab418..a18efaa 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.js
+++ b/erpnext/accounts/doctype/cost_center/cost_center.js
@@ -54,9 +54,9 @@
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/journal_voucher_detail/journal_voucher_detail.txt b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
index 53a56aa..c03e025 100644
--- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
+++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:39",
"docstatus": 0,
- "modified": "2013-12-20 19:23:18",
+ "modified": "2014-02-03 12:44:31",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -58,23 +58,8 @@
},
{
"doctype": "DocField",
- "fieldname": "debit",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Debit",
- "oldfieldname": "debit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "credit",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Credit",
- "oldfieldname": "credit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
},
{
"doctype": "DocField",
@@ -90,12 +75,55 @@
},
{
"doctype": "DocField",
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "debit",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Debit",
+ "oldfieldname": "debit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "credit",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Credit",
+ "oldfieldname": "credit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "reference",
"fieldtype": "Section Break",
"label": "Reference"
},
{
"doctype": "DocField",
+ "fieldname": "against_invoice",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Against Sales Invoice",
+ "no_copy": 1,
+ "oldfieldname": "against_invoice",
+ "oldfieldtype": "Link",
+ "options": "Sales Invoice",
+ "print_hide": 0,
+ "search_index": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "against_voucher",
"fieldtype": "Link",
"in_filter": 1,
@@ -110,16 +138,8 @@
},
{
"doctype": "DocField",
- "fieldname": "against_invoice",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Against Sales Invoice",
- "no_copy": 1,
- "oldfieldname": "against_invoice",
- "oldfieldtype": "Link",
- "options": "Sales Invoice",
- "print_hide": 0,
- "search_index": 1
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
},
{
"doctype": "DocField",
diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.txt b/erpnext/accounts/doctype/pos_setting/pos_setting.txt
index 1c9e0bf..c00e75e 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 df9ef94..f7aeecd 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 1cc64cb..9fc04e6 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -308,7 +308,7 @@
# 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 5dbe9f6..d0eb1b3 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 8a8b4a7..e276219 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 @@
["_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 @@
["_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 @@
# 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 @@
},
{
"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 @@
},
{
"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 @@
},
{
"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 @@
},
{
"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 @@
},
{
"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 @@
},
{
"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 @@
},
{
"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 @@
# 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 @@
},
{
"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 @@
},
{
"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_invoice_advance/purchase_invoice_advance.txt b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
index f10d30e..98c8587 100644
--- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
+++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-08 15:36:46",
"docstatus": 0,
- "modified": "2013-12-20 19:23:29",
+ "modified": "2014-02-03 12:38:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -15,7 +15,6 @@
{
"doctype": "DocField",
"name": "__common__",
- "no_copy": 1,
"parent": "Purchase Invoice Advance",
"parentfield": "fields",
"parenttype": "DocType",
@@ -31,6 +30,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Journal Voucher",
+ "no_copy": 1,
"oldfieldname": "journal_voucher",
"oldfieldtype": "Link",
"options": "Journal Voucher",
@@ -45,6 +45,7 @@
"hidden": 1,
"in_list_view": 0,
"label": "Journal Voucher Detail No",
+ "no_copy": 1,
"oldfieldname": "jv_detail_no",
"oldfieldtype": "Date",
"print_hide": 1,
@@ -54,10 +55,29 @@
},
{
"doctype": "DocField",
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Small Text",
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "advance_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Advance Amount",
+ "no_copy": 1,
"oldfieldname": "advance_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -71,22 +91,11 @@
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Allocated Amount",
+ "no_copy": 1,
"oldfieldname": "allocated_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_width": "100px",
"width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Remarks",
- "oldfieldname": "remarks",
- "oldfieldtype": "Small Text",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
}
]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
index 3f1ae05..7c249d7 100755
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-22 12:43:10",
"docstatus": 0,
- "modified": "2013-12-20 19:23:29",
+ "modified": "2014-02-03 12:30:39",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -55,6 +55,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
@@ -86,6 +91,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "uom",
"fieldtype": "Link",
"in_list_view": 0,
@@ -96,6 +106,20 @@
},
{
"doctype": "DocField",
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Conversion Factor",
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "import_ref_rate",
"fieldtype": "Currency",
"in_list_view": 0,
@@ -115,6 +139,26 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "purchase_ref_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "options": "Company:company:default_currency",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "sec_break2",
+ "fieldtype": "Section Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "import_rate",
"fieldtype": "Currency",
"in_list_view": 1,
@@ -140,13 +184,8 @@
},
{
"doctype": "DocField",
- "fieldname": "purchase_ref_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break"
},
{
"doctype": "DocField",
@@ -158,7 +197,7 @@
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
- "read_only": 0,
+ "read_only": 1,
"reqd": 1
},
{
@@ -197,6 +236,11 @@
"width": "120px"
},
{
+ "doctype": "DocField",
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break"
+ },
+ {
"default": ":Company",
"doctype": "DocField",
"fieldname": "cost_center",
@@ -258,6 +302,52 @@
"search_index": 1
},
{
+ "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
+ "doctype": "DocField",
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "item_tax_amount",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Item Tax Amount",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "allow_on_submit": 1,
+ "doctype": "DocField",
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "in_list_view": 0,
+ "label": "Page Break",
+ "no_copy": 1,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break6",
+ "fieldtype": "Column Break"
+ },
+ {
"doctype": "DocField",
"fieldname": "purchase_order",
"fieldtype": "Link",
@@ -318,35 +408,6 @@
"search_index": 1
},
{
- "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax_amount",
- "fieldtype": "Currency",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Item Tax Amount",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
"doctype": "DocField",
"fieldname": "valuation_rate",
"fieldtype": "Currency",
@@ -360,15 +421,6 @@
},
{
"doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Conversion Factor",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
"fieldname": "rm_supp_cost",
"fieldtype": "Currency",
"hidden": 1,
@@ -378,17 +430,5 @@
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "in_list_view": 0,
- "label": "Page Break",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
}
]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
index 9a2a75d..c5768c6 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:04",
"docstatus": 0,
- "modified": "2013-12-20 19:23:38",
+ "modified": "2014-02-03 12:36:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -31,7 +31,7 @@
"doctype": "DocField",
"fieldname": "category",
"fieldtype": "Select",
- "in_list_view": 1,
+ "in_list_view": 0,
"label": "Consider Tax or Charge for",
"oldfieldname": "category",
"oldfieldtype": "Select",
@@ -40,6 +40,18 @@
"reqd": 1
},
{
+ "default": "Add",
+ "doctype": "DocField",
+ "fieldname": "add_deduct_tax",
+ "fieldtype": "Select",
+ "label": "Add or Deduct",
+ "oldfieldname": "add_deduct_tax",
+ "oldfieldtype": "Select",
+ "options": "Add\nDeduct",
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
"doctype": "DocField",
"fieldname": "charge_type",
"fieldtype": "Select",
@@ -53,26 +65,12 @@
},
{
"doctype": "DocField",
- "fieldname": "account_head",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Account Head",
- "oldfieldname": "account_head",
- "oldfieldtype": "Link",
- "options": "Account",
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": ":Company",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Cost Center",
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
+ "fieldname": "row_id",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Enter Row",
+ "oldfieldname": "row_id",
+ "oldfieldtype": "Data",
"read_only": 0
},
{
@@ -90,6 +88,35 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "account_head",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Account Head",
+ "oldfieldname": "account_head",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": ":Company",
+ "doctype": "DocField",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "read_only": 0
+ },
+ {
+ "doctype": "DocField",
"fieldname": "rate",
"fieldtype": "Float",
"in_list_view": 1,
@@ -103,6 +130,7 @@
"doctype": "DocField",
"fieldname": "tax_amount",
"fieldtype": "Currency",
+ "in_list_view": 1,
"label": "Amount",
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
@@ -122,28 +150,6 @@
},
{
"doctype": "DocField",
- "fieldname": "row_id",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Enter Row",
- "oldfieldname": "row_id",
- "oldfieldtype": "Data",
- "read_only": 0
- },
- {
- "default": "Add",
- "doctype": "DocField",
- "fieldname": "add_deduct_tax",
- "fieldtype": "Select",
- "label": "Add or Deduct",
- "oldfieldname": "add_deduct_tax",
- "oldfieldtype": "Select",
- "options": "Add\nDeduct",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
"fieldname": "item_wise_tax_detail",
"fieldtype": "Small Text",
"hidden": 1,
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 b589651..933382e 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 @@
return '';
}
-cur_frm.pformat.purchase_tax_details= function(doc){
-
- //function to make row of table
- var make_row = function(title,val,bold){
- var bstart = '<b>'; var bend = '</b>';
- return '<tr><td style="width:50%;">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'
- +'<td style="width:25%;text-align:right;"></td>'
- +'<td style="width:25%;text-align:right;">'+format_currency(val, doc.currency)+'</td>'
- +'</tr>'
- }
+cur_frm.pformat.other_charges= function(doc) {
- function convert_rate(val){
- var new_val = flt(val)/flt(doc.conversion_rate);
- return new_val;
- }
-
- function print_hide(fieldname) {
- var doc_field = wn.meta.get_docfield(doc.doctype, fieldname, doc.name);
- return doc_field.print_hide;
- }
-
- var cl = getchildren('Purchase Taxes and Charges',doc.name,'purchase_tax_details');
-
- // outer table
- var out='<div><table class="noborder" style="width:100%">\
- <tr><td style="width: 60%"></td><td>';
-
- // main table
- out +='<table class="noborder" style="width:100%">';
- if(!print_hide('net_total_import')) {
- out += make_row('Net Total', doc.net_total_import, 1);
- }
-
- // add rows
- if(cl.length){
- for(var i=0;i<cl.length;i++){
- out += make_row(cl[i].description,convert_rate(cl[i].tax_amount),0);
- }
- }
- // grand total
- if(!print_hide('grand_total_import')) {
- out += make_row('Grand Total', doc.grand_total_import, 1);
+ //function to make row of table
+ var make_row = function(title, val, bold) {
+ var bstart = '<b>'; var bend = '</b>';
+ return '<tr><td style="width:50%;">' + (bold?bstart:'') + title + (bold?bend:'') + '</td>'
+ + '<td style="width:25%;text-align:right;"></td>'
+ + '<td style="width:25%;text-align:right;">' + format_currency(val, doc.currency) + '</td>'
+ + '</tr>';
}
- if(doc.in_words_import && !print_hide('in_words_import')){
- out +='</table></td></tr>';
- out += '<tr><td colspan = "2">';
- out += '<table><tr><td style="width:25%;"><b>In Words</b></td>';
- out+= '<td style="width:50%;">'+doc.in_words_import+'</td></tr>';
- }
- out +='</table></td></tr></table></div>';
- return out;
+
+ function convert_rate(val) {
+ var new_val = flt(val)/flt(doc.conversion_rate);
+ return new_val;
+ }
+
+ function print_hide(fieldname) {
+ var doc_field = wn.meta.get_docfield(doc.doctype, fieldname, doc.name);
+ return doc_field.print_hide;
+ }
+
+ var cl = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');
+
+ // outer table
+ var out='<div><table class="noborder" style="width:100%">\
+ <tr><td style="width: 60%"></td><td>';
+
+ // main table
+ out +='<table class="noborder" style="width:100%">';
+ if(!print_hide('net_total_import'))
+ out += make_row('Net Total', doc.net_total_import, 1);
+
+ // add rows
+ if(cl.length){
+ for(var i=0; i<cl.length; i++) {
+ out += make_row(cl[i].description, convert_rate(cl[i].tax_amount), 0);
+ }
+ }
+
+ // grand total
+ if(!print_hide('grand_total_import'))
+ out += make_row('Grand Total', doc.grand_total_import, 1);
+
+ if(doc.in_words_import && !print_hide('in_words_import')) {
+ out += '</table></td></tr>';
+ out += '<tr><td colspan = "2">';
+ out += '<table><tr><td style="width:25%;"><b>In Words</b></td>';
+ out += '<td style="width:50%;">' + doc.in_words_import + '</td></tr>';
+ }
+
+ out +='</table></td></tr></table></div>';
+ return out;
}
cur_frm.cscript.add_deduct_tax = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- if(!d.category && d.add_deduct_tax){
- alert(wn._("Please select Category first"));
- d.add_deduct_tax = '';
- }
- else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
- console.log([d.category, d.add_deduct_tax]);
- msgprint(wn._("You cannot deduct when category is for 'Valuation' or 'Valuation and Total'"));
- d.add_deduct_tax = '';
- }
+ var d = locals[cdt][cdn];
+ if(!d.category && d.add_deduct_tax) {
+ msgprint(wn._("Please select Category first"));
+ d.add_deduct_tax = '';
+ }
+ else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
+ msgprint(wn._("You cannot deduct when category is for 'Valuation' or 'Valuation and Total'"));
+ d.add_deduct_tax = '';
+ }
}
cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- if(!d.category && d.charge_type){
- alert(wn._("Please select Category first"));
- d.charge_type = '';
- }
- else if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
- alert(wn._("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
- d.charge_type = '';
- }
- else if((d.category == 'Valuation' || d.category == 'Valuation and Total') && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
- alert(wn._("You cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for valuation. You can select only 'Total' option for previous row amount or previous row total"))
- d.charge_type = '';
- }
- validated = false;
- refresh_field('charge_type',d.name,'purchase_tax_details');
+ var d = locals[cdt][cdn];
- cur_frm.cscript.row_id(doc, cdt, cdn);
- cur_frm.cscript.rate(doc, cdt, cdn);
- cur_frm.cscript.tax_amount(doc, cdt, cdn);
+ if(!d.category && d.charge_type) {
+ msgprint(wn._("Please select Category first"));
+ d.charge_type = '';
+ }
+ else if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')) {
+ msgprint(wn._("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
+ d.charge_type = '';
+ }
+ else if((d.category == 'Valuation' || d.category == 'Valuation and Total') && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')) {
+ msgprint(wn._("You cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for valuation. You can select only 'Total' option for previous row amount or previous row total"));
+ d.charge_type = '';
+ }
+
+ validated = false;
+ refresh_field('charge_type', d.name, 'other_charges');
+
+ cur_frm.cscript.row_id(doc, cdt, cdn);
+ cur_frm.cscript.rate(doc, cdt, cdn);
+ cur_frm.cscript.tax_amount(doc, cdt, cdn);
}
cur_frm.cscript.row_id = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- if(!d.charge_type && d.row_id){
- alert(wn._("Please select Charge Type first"));
- d.row_id = '';
- }
- else if((d.charge_type == 'Actual' || d.charge_type == 'On Net Total') && d.row_id) {
- alert(wn._("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"));
- d.row_id = '';
- }
- else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id){
- if(d.row_id >= d.idx){
- alert(wn._("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"));
- d.row_id = '';
- }
- }
- validated = false;
- refresh_field('row_id',d.name,'purchase_tax_details');
+ var d = locals[cdt][cdn];
+
+ if(!d.charge_type && d.row_id) {
+ msgprint(wn._("Please select Charge Type first"));
+ d.row_id = '';
+ }
+ else if((d.charge_type == 'Actual' || d.charge_type == 'On Net Total') && d.row_id) {
+ msgprint(wn._("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"));
+ d.row_id = '';
+ }
+ else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id) {
+ if(d.row_id >= d.idx){
+ msgprint(wn._("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"));
+ d.row_id = '';
+ }
+ }
+ validated = false;
+ refresh_field('row_id', d.name, 'other_charges');
}
-cur_frm.set_query("account_head", "purchase_tax_details", function(doc) {
+cur_frm.set_query("account_head", "other_charges", function(doc) {
return {
query: "erpnext.controllers.queries.tax_account_query",
- filters: {
+ filters: {
"account_type": ["Tax", "Chargeable", "Expense Account"],
"debit_or_credit": "Debit",
"company": doc.company
@@ -148,35 +144,38 @@
}
});
-cur_frm.fields_dict['purchase_tax_details'].grid.get_field("cost_center").get_query = function(doc) {
- return {
- filters: {
- 'company': doc.company,
- 'group_or_ledger': "Ledger"
- }
- }
+cur_frm.fields_dict['other_charges'].grid.get_field("cost_center").get_query = function(doc) {
+ return {
+ filters: {
+ 'company': doc.company,
+ 'group_or_ledger': "Ledger"
+ }
+ }
}
cur_frm.cscript.rate = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- if(!d.charge_type && d.rate) {
- alert(wn._("Please select Charge Type first"));
- d.rate = '';
- }
- validated = false;
- refresh_field('rate',d.name,'purchase_tax_details');
+ var d = locals[cdt][cdn];
+
+ if(!d.charge_type && d.rate) {
+ msgprint(wn._("Please select Charge Type first"));
+ d.rate = '';
+ }
+ validated = false;
+ refresh_field('rate', d.name, 'other_charges');
}
cur_frm.cscript.tax_amount = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- if(!d.charge_type && d.tax_amount){
- alert(wn._("Please select Charge Type first"));
- d.tax_amount = '';
- }
- else if(d.charge_type && d.tax_amount) {
- alert(wn._("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"));
- d.tax_amount = '';
- }
- validated = false;
- refresh_field('tax_amount',d.name,'purchase_tax_details');
-}
+ var d = locals[cdt][cdn];
+
+ if(!d.charge_type && d.tax_amount) {
+ msgprint(wn._("Please select Charge Type first"));
+ d.tax_amount = '';
+ }
+ else if(d.charge_type && d.tax_amount) {
+ msgprint(wn._("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"));
+ d.tax_amount = '';
+ }
+
+ validated = false;
+ refresh_field('tax_amount', d.name, 'other_charges');
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
index 797b875..346dd0e 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:08",
"docstatus": 0,
- "modified": "2014-01-28 12:28:56",
+ "modified": "2014-01-29 12:26:38",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
@@ -71,7 +71,7 @@
},
{
"doctype": "DocField",
- "fieldname": "purchase_tax_details",
+ "fieldname": "other_charges",
"fieldtype": "Table",
"label": "Purchase Taxes and Charges",
"oldfieldname": "purchase_tax_details",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 99f17c8..bb7d1c1 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -185,7 +185,7 @@
self.doc.customer = pos.customer
# self.set_customer_defaults()
- for fieldname in ('territory', 'naming_series', 'currency', 'charge', 'letter_head', 'tc_name',
+ for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name',
'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account'):
if (not for_validate) or (for_validate and not self.doc.fields.get(fieldname)):
self.doc.fields[fieldname] = pos.get(fieldname)
@@ -206,7 +206,7 @@
# 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_advances(self):
super(DocType, self).get_advances(self.doc.debit_to,
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
index a3be27d..49cc213 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/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
index 9ae37cf..f0f361d 100644
--- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
+++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:41",
"docstatus": 0,
- "modified": "2013-12-31 18:29:19",
+ "modified": "2014-02-03 12:38:53",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -40,38 +40,6 @@
},
{
"doctype": "DocField",
- "fieldname": "advance_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Advance amount",
- "no_copy": 1,
- "oldfieldname": "advance_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "allocated_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Allocated amount",
- "no_copy": 1,
- "oldfieldname": "allocated_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "120px",
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
"fieldname": "remarks",
"fieldtype": "Small Text",
"in_list_view": 1,
@@ -97,5 +65,37 @@
"print_width": "120px",
"read_only": 1,
"width": "120px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "advance_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Advance amount",
+ "no_copy": 1,
+ "oldfieldname": "advance_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "allocated_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Allocated amount",
+ "no_copy": 1,
+ "oldfieldname": "allocated_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "print_width": "120px",
+ "width": "120px"
}
]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
index 0e9b3db..6234563 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
@@ -1,8 +1,6 @@
// 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) {
@@ -11,7 +9,7 @@
}
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
@@ -40,11 +38,11 @@
var make_row = function(title, val, bold){
var bstart = '<b>'; var bend = '</b>';
return '<tr><td style="width:50%;">' + (bold?bstart:'') + title + (bold?bend:'') + '</td>'
- +'<td style="width:50%;text-align:right;">' + format_currency(val, doc.currency) + '</td>'
- +'</tr>'
+ + '<td style="width:50%;text-align:right;">' + format_currency(val, doc.currency) + '</td>'
+ + '</tr>';
}
- function convert_rate(val){
+ function convert_rate(val) {
var new_val = flt(val)/flt(doc.conversion_rate);
return new_val;
}
@@ -71,31 +69,28 @@
// add rows
if(cl.length){
- for(var i=0;i<cl.length;i++){
+ for(var i=0;i<cl.length;i++) {
if(convert_rate(cl[i].tax_amount)!=0 && !cl[i].included_in_print_rate)
out += make_row(cl[i].description, convert_rate(cl[i].tax_amount), 0);
}
}
// Discount Amount
- if(!print_hide('discount_amount') && doc.discount_amount) {
+ if(!print_hide('discount_amount') && doc.discount_amount)
out += make_row('Discount Amount', convert_rate(doc.discount_amount), 0);
- }
// grand total
- if(!print_hide('grand_total_export')) {
+ if(!print_hide('grand_total_export'))
out += make_row('Grand Total', doc.grand_total_export, 1);
- }
- if(!print_hide('rounded_total_export')) {
+ if(!print_hide('rounded_total_export'))
out += make_row('Rounded Total', doc.rounded_total_export, 1);
- }
- if(doc.in_words_export && !print_hide('in_words_export')){
+ if(doc.in_words_export && !print_hide('in_words_export')) {
out +='</table></td></tr>';
out += '<tr><td colspan = "2">';
- out += '<table><tr><td style="width:25%;"><b>In Words</b></td>'
- out += '<td style="width:50%;">' + doc.in_words_export + '</td></tr>'
+ out += '<table><tr><td style="width:25%;"><b>In Words</b></td>';
+ out += '<td style="width:50%;">' + doc.in_words_export + '</td></tr>';
}
out += '</table></td></tr></table></div>';
}
@@ -104,8 +99,8 @@
cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
- if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
- alert(wn._("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
+ if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')) {
+ msgprint(wn._("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
d.charge_type = '';
}
validated = false;
@@ -117,17 +112,17 @@
cur_frm.cscript.row_id = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
- if(!d.charge_type && d.row_id){
- alert(wn._("Please select Charge Type first"));
+ if(!d.charge_type && d.row_id) {
+ msgprint(wn._("Please select Charge Type first"));
d.row_id = '';
}
else if((d.charge_type == 'Actual' || d.charge_type == 'On Net Total') && d.row_id) {
- alert(wn._("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"));
+ msgprint(wn._("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"));
d.row_id = '';
}
- else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id){
+ else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id) {
if(d.row_id >= d.idx){
- alert(wn._("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"));
+ msgprint(wn._("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"));
d.row_id = '';
}
}
@@ -158,7 +153,7 @@
cur_frm.cscript.rate = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.rate) {
- alert(wn._("Please select Charge Type first"));
+ msgprint(wn._("Please select Charge Type first"));
d.rate = '';
}
validated = false;
@@ -167,12 +162,12 @@
cur_frm.cscript.tax_amount = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
- if(!d.charge_type && d.tax_amount){
- alert(wn._("Please select Charge Type first"));
+ if(!d.charge_type && d.tax_amount) {
+ msgprint(wn._("Please select Charge Type first"));
d.tax_amount = '';
}
else if(d.charge_type && d.tax_amount) {
- alert(wn._("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"));
+ msgprint(wn._("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"));
d.tax_amount = '';
}
validated = false;
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index d9cb516..941c2ae 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -6,7 +6,7 @@
import webnotes
from webnotes.utils import nowdate, cstr, flt, now, getdate, add_months
from webnotes.model.doc import addchild
-from webnotes import msgprint, _
+from webnotes import msgprint, throw, _
from webnotes.utils import formatdate
from erpnext.utilities import build_filter_conditions
@@ -41,12 +41,12 @@
def validate_fiscal_year(date, fiscal_year, label="Date"):
years = [f[0] for f in get_fiscal_years(date, label=label)]
if fiscal_year not in years:
- webnotes.msgprint(("%(label)s '%(posting_date)s': " + _("not within Fiscal Year") + \
+ throw(("%(label)s '%(posting_date)s': " + _("not within Fiscal Year") + \
": '%(fiscal_year)s'") % {
"label": label,
"posting_date": formatdate(date),
"fiscal_year": fiscal_year
- }, raise_exception=1)
+ })
@webnotes.whitelist()
def get_balance_on(account=None, date=None):
@@ -169,8 +169,7 @@
and t1.docstatus=1 and t2.%(dr_or_cr)s = %(unadjusted_amt)s""" % args)
if not ret:
- msgprint(_("""Payment Entry has been modified after you pulled it.
- Please pull it again."""), raise_exception=1)
+ throw(_("""Payment Entry has been modified after you pulled it. Please pull it again."""))
def update_against_doc(d, jv_obj):
"""
@@ -247,9 +246,9 @@
value = webnotes.conn.get_value("Company", company, fieldname)
if not value:
- msgprint(_("Please mention default value for '") +
+ throw(_("Please mention default value for '") +
_(webnotes.get_doctype("company").get_label(fieldname) +
- _("' in Company: ") + company), raise_exception=True)
+ _("' in Company: ") + company))
return value
@@ -318,11 +317,11 @@
if action_for:
actual_expense = get_actual_expense(args)
if actual_expense > budget_amount:
- webnotes.msgprint(action_for + _(" budget ") + cstr(budget_amount) +
+ throw(action_for + _(" budget ") + cstr(budget_amount) +
_(" for account ") + args.account + _(" against cost center ") +
args.cost_center + _(" will exceed by ") +
cstr(actual_expense - budget_amount) + _(" after this transaction.")
- , raise_exception=BudgetError if action=="Stop" else False)
+ , exc=BudgetError if action=="Stop" else False)
def get_allocated_budget(distribution_id, posting_date, fiscal_year, yearly_budget):
if distribution_id:
diff --git a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
index ff8448f..f1514c9 100644
--- a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
+++ b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
@@ -9,7 +9,7 @@
{
"doc_type": "Purchase Order",
"doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/webnotes/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'import_rate', 'import_amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'purchase_tax_details');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/webnotes/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'import_rate', 'import_amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\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 3be7eb0..9e0693a 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 Sample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/webnotes/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'import_rate', 'import_amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'purchase_tax_details');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Purchase Order No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>\n",
+ "html": "<!--\n Sample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/webnotes/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'import_rate', 'import_amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Purchase Order No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>\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 908ee78..79016a7 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\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/webnotes/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'import_rate', 'import_amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'purchase_tax_details');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/webnotes/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'import_rate', 'import_amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\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 3d0f80b..95250ba 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -210,21 +210,6 @@
}
},
- 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");
@@ -367,13 +352,6 @@
}
},
- 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 = {};
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index edf7c82..5213885 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -5,7 +5,7 @@
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 2790e41..2dbafd2 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/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
index a78c485..8400973 100755
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:06",
"docstatus": 0,
- "modified": "2013-12-20 19:23:32",
+ "modified": "2014-02-03 12:08:21",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -41,22 +41,6 @@
"search_index": 1
},
{
- "doctype": "DocField",
- "fieldname": "schedule_date",
- "fieldtype": "Date",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Reqd By Date",
- "no_copy": 0,
- "oldfieldname": "schedule_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
"description": "If Supplier Part Number exists for given Item, it gets stored here",
"doctype": "DocField",
"fieldname": "supplier_part_no",
@@ -84,10 +68,24 @@
},
{
"doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "in_filter": 1,
"in_list_view": 0,
- "label": "Quantity and Rate"
+ "label": "Reqd By Date",
+ "no_copy": 0,
+ "oldfieldname": "schedule_date",
+ "oldfieldtype": "Date",
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
},
{
"doctype": "DocField",
@@ -104,6 +102,13 @@
},
{
"doctype": "DocField",
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "qty",
"fieldtype": "Float",
"in_list_view": 1,
@@ -132,6 +137,47 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "UOM Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Currency",
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "import_ref_rate",
"fieldtype": "Currency",
"in_list_view": 0,
@@ -151,6 +197,26 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "purchase_ref_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "options": "Company:company:default_currency",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "sec_break2",
+ "fieldtype": "Section Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "import_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -175,13 +241,8 @@
},
{
"doctype": "DocField",
- "fieldname": "purchase_ref_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break"
},
{
"doctype": "DocField",
@@ -194,7 +255,7 @@
"options": "Company:company:default_currency",
"print_hide": 1,
"print_width": "100px",
- "read_only": 0,
+ "read_only": 1,
"reqd": 1,
"width": "100px"
},
@@ -246,37 +307,6 @@
},
{
"doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "hidden": 0,
- "in_list_view": 0,
- "label": "UOM Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
"fieldname": "prevdoc_doctype",
"fieldtype": "Data",
"hidden": 1,
@@ -325,9 +355,9 @@
"doctype": "DocField",
"fieldname": "supplier_quotation",
"fieldtype": "Link",
- "hidden": 1,
+ "hidden": 0,
"in_filter": 0,
- "in_list_view": 1,
+ "in_list_view": 0,
"label": "Supplier Quotation",
"no_copy": 1,
"options": "Supplier Quotation",
@@ -347,16 +377,8 @@
},
{
"doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "read_only": 1
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break"
},
{
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
@@ -376,11 +398,24 @@
},
{
"doctype": "DocField",
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "stock_qty",
"fieldtype": "Float",
"hidden": 0,
"in_list_view": 1,
- "label": "Stock Qty",
+ "label": "Qty as per Stock UOM",
"no_copy": 1,
"oldfieldname": "stock_qty",
"oldfieldtype": "Currency",
diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py
index 0c2a601..94bc679 100644
--- a/erpnext/buying/doctype/supplier/supplier.py
+++ b/erpnext/buying/doctype/supplier/supplier.py
@@ -141,6 +141,10 @@
"contact_person": webnotes.conn.get_value("Contact",
{"supplier":supplier.name, "is_primary_contact":1}, "name")
})
+
+ for f in ['currency', 'taxes_and_charges']:
+ if supplier.fields.get("default_" + f):
+ out[f] = supplier.fields.get("default_" + f)
out.supplier_name = supplier.supplier_name
out.currency = supplier.default_currency or currency
diff --git a/erpnext/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.txt
index 5c305f5..a5d100f 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"
},
@@ -159,6 +159,14 @@
},
{
"doctype": "DocField",
+ "fieldname": "default_currency",
+ "fieldtype": "Link",
+ "label": "Default Currency",
+ "no_copy": 1,
+ "options": "Currency"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "default_price_list",
"fieldtype": "Link",
"label": "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 bc56abd..562e69d 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 e1441e5..0a4a3ec 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/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
index f0810ff..cffe811 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-22 12:43:10",
"docstatus": 0,
- "modified": "2013-12-20 19:21:50",
+ "modified": "2014-02-03 11:47:21",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -68,6 +68,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
@@ -101,21 +106,6 @@
},
{
"doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
"fieldname": "import_ref_rate",
"fieldtype": "Currency",
"in_list_view": 0,
@@ -135,6 +125,41 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "purchase_ref_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "options": "Company:company:default_currency",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "import_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -159,13 +184,8 @@
},
{
"doctype": "DocField",
- "fieldname": "purchase_ref_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
},
{
"doctype": "DocField",
@@ -178,7 +198,7 @@
"options": "Company:company:default_currency",
"print_hide": 1,
"print_width": "100px",
- "read_only": 0,
+ "read_only": 1,
"reqd": 1,
"width": "100px"
},
@@ -261,6 +281,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "prevdoc_detail_docname",
"fieldtype": "Data",
"hidden": 1,
@@ -278,7 +303,7 @@
"doctype": "DocField",
"fieldname": "brand",
"fieldtype": "Link",
- "hidden": 1,
+ "hidden": 0,
"in_list_view": 0,
"label": "Brand",
"oldfieldname": "brand",
@@ -292,7 +317,7 @@
"doctype": "DocField",
"fieldname": "item_group",
"fieldtype": "Link",
- "hidden": 1,
+ "hidden": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Item Group",
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 937449c..2e05903 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -130,6 +130,10 @@
})
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 a20eecc..5c45c11 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -37,7 +37,7 @@
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:
@@ -56,14 +56,10 @@
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)
@@ -78,7 +74,7 @@
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")
@@ -202,7 +198,7 @@
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 b0eafe0..75b27a5 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -30,7 +30,7 @@
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):
from erpnext.selling.doctype.customer.customer import get_customer_details
@@ -44,10 +44,6 @@
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/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index da72ec7..e7a9343 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -6,7 +6,7 @@
from webnotes.utils import getdate, validate_email_add, cstr, cint
from webnotes.model.doc import make_autoname
-from webnotes import msgprint, _
+from webnotes import msgprint, throw, _
import webnotes.permissions
from webnotes.defaults import get_restrictions
from webnotes.model.controller import DocListController
@@ -15,7 +15,7 @@
def autoname(self):
naming_method = webnotes.conn.get_value("HR Settings", None, "emp_created_by")
if not naming_method:
- webnotes.throw(_("Please setup Employee Naming System in Human Resource > HR Settings"))
+ throw(_("Please setup Employee Naming System in Human Resource > HR Settings"))
else:
if naming_method=='Naming Series':
self.doc.name = make_autoname(self.doc.naming_series + '.####')
@@ -33,7 +33,10 @@
self.validate_email()
self.validate_status()
self.validate_employee_leave_approver()
- self.update_dob_event()
+
+ if self.doc.user_id:
+ self.validate_for_enabled_user_id()
+ self.validate_duplicate_user_id()
def on_update(self):
if self.doc.user_id:
@@ -41,6 +44,7 @@
self.update_user_default()
self.update_profile()
+ self.update_dob_event()
self.restrict_leave_approver()
def restrict_user(self):
@@ -111,41 +115,53 @@
def validate_date(self):
if self.doc.date_of_birth and self.doc.date_of_joining and getdate(self.doc.date_of_birth) >= getdate(self.doc.date_of_joining):
- msgprint('Date of Joining must be greater than Date of Birth')
- raise Exception
+ throw(_("Date of Joining must be greater than Date of Birth"))
elif self.doc.scheduled_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.scheduled_confirmation_date) < getdate(self.doc.date_of_joining)):
- msgprint('Scheduled Confirmation Date must be greater than Date of Joining')
- raise Exception
+ throw(_("Scheduled Confirmation Date must be greater than Date of Joining"))
elif self.doc.final_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.final_confirmation_date) < getdate(self.doc.date_of_joining)):
- msgprint('Final Confirmation Date must be greater than Date of Joining')
- raise Exception
+ throw(_("Final Confirmation Date must be greater than Date of Joining"))
elif self.doc.date_of_retirement and self.doc.date_of_joining and (getdate(self.doc.date_of_retirement) <= getdate(self.doc.date_of_joining)):
- msgprint('Date Of Retirement must be greater than Date of Joining')
- raise Exception
+ throw(_("Date Of Retirement must be greater than Date of Joining"))
elif self.doc.relieving_date and self.doc.date_of_joining and (getdate(self.doc.relieving_date) <= getdate(self.doc.date_of_joining)):
- msgprint('Relieving Date must be greater than Date of Joining')
- raise Exception
+ throw(_("Relieving Date must be greater than Date of Joining"))
elif self.doc.contract_end_date and self.doc.date_of_joining and (getdate(self.doc.contract_end_date)<=getdate(self.doc.date_of_joining)):
- msgprint('Contract End Date must be greater than Date of Joining')
- raise Exception
+ throw(_("Contract End Date must be greater than Date of Joining"))
def validate_email(self):
if self.doc.company_email and not validate_email_add(self.doc.company_email):
- msgprint("Please enter valid Company Email")
- raise Exception
+ throw(_("Please enter valid Company Email"))
if self.doc.personal_email and not validate_email_add(self.doc.personal_email):
- msgprint("Please enter valid Personal Email")
- raise Exception
+ throw(_("Please enter valid Personal Email"))
def validate_status(self):
if self.doc.status == 'Left' and not self.doc.relieving_date:
- msgprint("Please enter relieving date.")
- raise Exception
+ throw(_("Please enter relieving date."))
+
+ def validate_for_enabled_user_id(self):
+ enabled = webnotes.conn.sql("""select name from `tabProfile` where
+ name=%s and enabled=1""", self.doc.user_id)
+ if not enabled:
+ throw("{id}: {user_id} {msg}".format(**{
+ "id": _("User ID"),
+ "user_id": self.doc.user_id,
+ "msg": _("is disabled.")
+ }))
+
+ def validate_duplicate_user_id(self):
+ employee = webnotes.conn.sql_list("""select name from `tabEmployee` where
+ user_id=%s and status='Active' and name!=%s""", (self.doc.user_id, self.doc.name))
+ if employee:
+ throw("{id}: {user_id} {msg}: {employee}".format(**{
+ "id": _("User ID"),
+ "user_id": self.doc.user_id,
+ "msg": _("is already assigned to Employee"),
+ "employee": employee[0]
+ }))
def validate_employee_leave_approver(self):
from webnotes.profile import Profile
@@ -153,8 +169,8 @@
for l in self.doclist.get({"parentfield": "employee_leave_approvers"}):
if "Leave Approver" not in Profile(l.leave_approver).get_roles():
- msgprint(_("Invalid Leave Approver") + ": \"" + l.leave_approver + "\"",
- raise_exception=InvalidLeaveApproverError)
+ throw(_("Invalid Leave Approver") + ": \"" + l.leave_approver + "\"",
+ exc=InvalidLeaveApproverError)
def update_dob_event(self):
if self.doc.status == "Active" and self.doc.date_of_birth \
@@ -196,4 +212,4 @@
if date_of_birth:
dt = getdate(date_of_birth) + datetime.timedelta(21915)
ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')}
- return ret
+ return ret
\ No newline at end of file
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 649c35d..59bf829 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/manufacturing/doctype/bom_item/bom_item.txt b/erpnext/manufacturing/doctype/bom_item/bom_item.txt
index b7017f4..6949b75 100644
--- a/erpnext/manufacturing/doctype/bom_item/bom_item.txt
+++ b/erpnext/manufacturing/doctype/bom_item/bom_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:49",
"docstatus": 0,
- "modified": "2013-12-20 19:22:58",
+ "modified": "2014-02-03 12:47:39",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -64,6 +64,28 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "label": "Item Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "print_width": "250px",
+ "reqd": 0,
+ "width": "250px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "label": "Quantity and Rate"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "qty",
"fieldtype": "Float",
"in_list_view": 1,
@@ -73,6 +95,19 @@
"reqd": 1
},
{
+ "description": "See \"Rate Of Materials Based On\" in Costing Section",
+ "doctype": "DocField",
+ "fieldname": "rate",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Rate"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
"doctype": "DocField",
"fieldname": "stock_uom",
"fieldtype": "Link",
@@ -85,14 +120,6 @@
"reqd": 1
},
{
- "description": "See \"Rate Of Materials Based On\" in Costing Section",
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Rate"
- },
- {
"doctype": "DocField",
"fieldname": "amount",
"fieldtype": "Float",
@@ -115,17 +142,6 @@
},
{
"doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "label": "Item Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "250px",
- "reqd": 0,
- "width": "250px"
- },
- {
- "doctype": "DocField",
"fieldname": "qty_consumed_per_unit",
"fieldtype": "Float",
"hidden": 1,
diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
index 6ace745..b2628c1 100644
--- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
+++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:49",
"docstatus": 0,
- "modified": "2013-12-20 19:22:58",
+ "modified": "2014-02-03 12:53:03",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -14,7 +14,6 @@
},
{
"doctype": "DocField",
- "in_list_view": 1,
"name": "__common__",
"parent": "BOM Operation",
"parentfield": "fields",
@@ -29,6 +28,7 @@
"doctype": "DocField",
"fieldname": "operation_no",
"fieldtype": "Data",
+ "in_list_view": 1,
"label": "Operation No",
"oldfieldname": "operation_no",
"oldfieldtype": "Data",
@@ -38,6 +38,7 @@
"doctype": "DocField",
"fieldname": "opn_description",
"fieldtype": "Text",
+ "in_list_view": 1,
"label": "Operation Description",
"oldfieldname": "opn_description",
"oldfieldtype": "Text",
@@ -45,8 +46,14 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "workstation",
"fieldtype": "Link",
+ "in_list_view": 1,
"label": "Workstation",
"oldfieldname": "workstation",
"oldfieldtype": "Link",
@@ -57,6 +64,7 @@
"doctype": "DocField",
"fieldname": "hour_rate",
"fieldtype": "Float",
+ "in_list_view": 0,
"label": "Hour Rate",
"oldfieldname": "hour_rate",
"oldfieldtype": "Currency",
@@ -66,6 +74,7 @@
"doctype": "DocField",
"fieldname": "time_in_mins",
"fieldtype": "Float",
+ "in_list_view": 0,
"label": "Operation Time (mins)",
"oldfieldname": "time_in_mins",
"oldfieldtype": "Currency",
@@ -76,6 +85,7 @@
"doctype": "DocField",
"fieldname": "operating_cost",
"fieldtype": "Float",
+ "in_list_view": 1,
"label": "Operating Cost",
"oldfieldname": "operating_cost",
"oldfieldtype": "Currency",
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 79644a8..3eb69fd 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -3,20 +3,17 @@
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 0000000..6656cee
--- /dev/null
+++ b/erpnext/patches/4_0/map_charge_to_taxes_and_charges.py
@@ -0,0 +1,16 @@
+# 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
+ for d in ['Sales Invoice', 'Sales Order', 'Quotation', 'Delivery Note']:
+ webnotes.conn.sql("""update `tab%s` set taxes_and_charges=charge""" % d)
+
+ # udpate purchase cycle
+ for d in ['Purchase Invoice', 'Purchase Order', 'Supplier Quotation', 'Purchase Receipt']:
+ webnotes.conn.sql("""update `tab%s` set taxes_and_charges=purchase_other_charges""" % d)
+
+ 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 0000000..83f95c0
--- /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 0000000..f4cf446
--- /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/conf.js b/erpnext/public/js/conf.js
index 73099d1..58e9f97 100644
--- a/erpnext/public/js/conf.js
+++ b/erpnext/public/js/conf.js
@@ -15,7 +15,6 @@
.addClass("navbar-icon-home")
.css({
"max-width": "200px",
- "overflow": "hidden",
"text-overflow": "ellipsis",
"white-space": "nowrap"
});
diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js
index 19207e7..dab5828 100644
--- a/erpnext/public/js/queries.js
+++ b/erpnext/public/js/queries.js
@@ -33,7 +33,7 @@
},
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 0dfdd07..24fc332 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -708,4 +708,26 @@
});
}
},
+
+ 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.py b/erpnext/selling/doctype/customer/customer.py
index c182c94..c8c619a 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -191,7 +191,7 @@
out[f] = customer.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.get("default_" + f):
out[f] = customer.get("default_" + f)
diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt
index 6eabaf0..c6c0e9f 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",
@@ -254,6 +255,14 @@
},
{
"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",
"fieldtype": "Int",
"label": "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/opportunity_item/opportunity_item.txt b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
index 94c6dd2..22023ed 100644
--- a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
+++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:51",
"docstatus": 0,
- "modified": "2013-12-20 19:23:22",
+ "modified": "2014-02-03 12:40:44",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -46,18 +46,6 @@
"reqd": 1
},
{
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "300px",
- "reqd": 1,
- "width": "300px"
- },
- {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
"doctype": "DocField",
"fieldname": "item_group",
@@ -86,6 +74,23 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "print_width": "300px",
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "quantity_and_rate",
"fieldtype": "Section Break",
"in_list_view": 0,
@@ -114,6 +119,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "uom",
"fieldtype": "Link",
"in_list_view": 0,
diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt
index edcd929..740bf69 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-29 19:42:32",
+ "modified": "2014-01-31 19:42:32",
"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 d187f67..01c2817 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/doctype/sms_center/sms_center.js b/erpnext/selling/doctype/sms_center/sms_center.js
new file mode 100644
index 0000000..1c5b92b
--- /dev/null
+++ b/erpnext/selling/doctype/sms_center/sms_center.js
@@ -0,0 +1,17 @@
+// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+$.extend(cur_frm.cscript, {
+ message: function () {
+ var total_words = this.frm.doc.message.length;
+ var total_msg = 1;
+
+ if (total_words > 160) {
+ total_msg = cint(total_words / 160);
+ total_msg = (total_words % 160 == 0 ? total_msg : total_msg + 1);
+ }
+
+ this.frm.set_value("total_words", total_words);
+ this.frm.set_value("total_messages", this.frm.doc.message ? total_msg : 0);
+ }
+});
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py
index 6eaab48..8681b9c 100644
--- a/erpnext/selling/doctype/sms_center/sms_center.py
+++ b/erpnext/selling/doctype/sms_center/sms_center.py
@@ -8,7 +8,7 @@
from webnotes.model import db_exists
from webnotes.model.bean import copy_doclist
from webnotes.model.code import get_obj
-from webnotes import msgprint
+from webnotes import msgprint, _
class DocType:
def __init__(self, doc, doclist=[]):
@@ -25,33 +25,47 @@
where_clause = self.doc.sales_partner and " and ifnull(is_sales_partner, 0) = 1 and sales_partner = '%s'" % self.doc.sales_partner or " and ifnull(sales_partner, '') != ''"
if self.doc.send_to in ['All Contact', 'All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']:
- rec = webnotes.conn.sql("select CONCAT(ifnull(first_name,''),'',ifnull(last_name,'')), mobile_no from `tabContact` where ifnull(mobile_no,'')!='' and docstatus != 2 %s" % where_clause)
+ rec = webnotes.conn.sql("""select CONCAT(ifnull(first_name,''), '', ifnull(last_name,'')),
+ mobile_no from `tabContact` where ifnull(mobile_no,'')!='' and
+ docstatus != 2 %s""", where_clause)
+
elif self.doc.send_to == 'All Lead (Open)':
- rec = webnotes.conn.sql("select lead_name, mobile_no from tabLead where ifnull(mobile_no,'')!='' and docstatus != 2 and status = 'Open'")
+ rec = webnotes.conn.sql("""select lead_name, mobile_no from `tabLead` where
+ ifnull(mobile_no,'')!='' and docstatus != 2 and status='Open'""")
+
elif self.doc.send_to == 'All Employee (Active)':
where_clause = self.doc.department and " and department = '%s'" % self.doc.department or ""
where_clause += self.doc.branch and " and branch = '%s'" % self.doc.branch or ""
- rec = webnotes.conn.sql("select employee_name, cell_number from `tabEmployee` where status = 'Active' and docstatus < 2 and ifnull(cell_number,'')!='' %s" % where_clause)
+ rec = webnotes.conn.sql("""select employee_name, cell_number from
+ `tabEmployee` where status = 'Active' and docstatus < 2 and
+ ifnull(cell_number,'')!='' %s""", where_clause)
+
elif self.doc.send_to == 'All Sales Person':
- rec = webnotes.conn.sql("select sales_person_name, mobile_no from `tabSales Person` where docstatus != 2 and ifnull(mobile_no,'')!=''")
+ rec = webnotes.conn.sql("""select sales_person_name, mobile_no from
+ `tabSales Person` where docstatus!=2 and ifnull(mobile_no,'')!=''""")
rec_list = ''
+
for d in rec:
rec_list += d[0] + ' - ' + d[1] + '\n'
self.doc.receiver_list = rec_list
def get_receiver_nos(self):
receiver_nos = []
- for d in self.doc.receiver_list.split('\n'):
- receiver_no = d
- if '-' in d:
- receiver_no = receiver_no.split('-')[1]
- if receiver_no.strip():
- receiver_nos.append(cstr(receiver_no).strip())
+ if self.doc.receiver_list:
+ for d in self.doc.receiver_list.split('\n'):
+ receiver_no = d
+ if '-' in d:
+ receiver_no = receiver_no.split('-')[1]
+ if receiver_no.strip():
+ receiver_nos.append(cstr(receiver_no).strip())
+ else:
+ msgprint(_("Receiver List is empty. Please create Receiver List"))
+
return receiver_nos
def send_sms(self):
if not self.doc.message:
- msgprint("Please enter message before sending")
+ msgprint(_("Please enter message before sending"))
else:
receiver_list = self.get_receiver_nos()
if receiver_list:
diff --git a/erpnext/selling/doctype/sms_center/sms_center.txt b/erpnext/selling/doctype/sms_center/sms_center.txt
index 364704c..efa7a45 100644
--- a/erpnext/selling/doctype/sms_center/sms_center.txt
+++ b/erpnext/selling/doctype/sms_center/sms_center.txt
@@ -2,15 +2,13 @@
{
"creation": "2013-01-10 16:34:22",
"docstatus": 0,
- "modified": "2013-07-05 14:55:36",
+ "modified": "2014-01-30 15:29:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 0,
"allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
"doctype": "DocType",
"hide_heading": 0,
"hide_toolbar": 0,
@@ -30,15 +28,19 @@
"permlevel": 0
},
{
+ "cancel": 0,
"create": 1,
+ "delete": 0,
"doctype": "DocPerm",
+ "export": 0,
+ "import": 0,
"name": "__common__",
"parent": "SMS Center",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
- "report": 1,
+ "report": 0,
"role": "System Manager",
"submit": 0,
"write": 1
@@ -121,6 +123,20 @@
},
{
"doctype": "DocField",
+ "fieldname": "total_words",
+ "fieldtype": "Int",
+ "label": "Total Words",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "total_messages",
+ "fieldtype": "Int",
+ "label": "Total Message(s)",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "send_sms",
"fieldtype": "Button",
"label": "Send SMS",
@@ -129,4 +145,4 @@
{
"doctype": "DocPerm"
}
-]
+]
\ No newline at end of file
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 2f25dec..718d8a6 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -36,8 +36,8 @@
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],
@@ -81,7 +81,7 @@
if(item.warehouse) filters["warehouse"] = item.warehouse
return {
- query : "controllers.queries.get_batch_no",
+ query : "erpnext.controllers.queries.get_batch_no",
filters: filters
}
}
@@ -480,28 +480,6 @@
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) {
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 d39583e..0000000
--- 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": "<html>\n<head>\n<!--Other charges function-->\n<script>\n var make_row = function(title,val,bold){\n var bstart = '<b>'; var bend = '</b>';\n return '<tr><td style=\"width:50%\">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'\n +'<td style=\"width:20%;text-align:right\">'+doc.currency+'</td>'\n +'<td style=\"width:30%;text-align:right\">'+(val?val:'0.00')+'</td>'\n +'</tr>'\n }\n\n function get_other_charges(){\n var out ='';\n out += '<div><table class=\"noborder\" style=\"width:100%\">';\n out += make_row('Total Amount',fmt_money(convert_rate(doc.total_amount)),1)\n +make_row('Grand Total',fmt_money(convert_rate(doc.grand_total)),1);\n out += '</table></div>';\n return out;\n }\n\n function get_buying_costs(){\n var out ='';\n if(doc.buying_cost_transport || doc.buying_cost_taxes || doc.buying_cost_other){\n out += '<div><table class=\"noborder\" style=\"width:100%\">'\n + '<tr><td style=\"width:100%\"><b>'+'Buying Cost Details'+'</b></td></tr>';\n if(doc.buying_cost_transport){ out += make_row('Transport Cost',fmt_money(convert_rate(doc.buying_cost_transport)),0)}\n if(doc.buying_cost_taxes){ out += make_row('Taxes',fmt_money(convert_rate(doc.buying_cost_taxes)),0)}\n if(doc.buying_cost_other){ out += make_row('Other Cost',fmt_money(convert_rate(doc.buying_cost_other)),0)}\n out += '</table></div>';\n }\n return out;\n }\n\nfunction get_letter_head() {\n\t// add letter head\n\tvar cp = locals['Control Panel']['Control Panel'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= '';\n\t\t\n\treturn lh;\n}\n\n \n function convert_rate(val){\n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n }\n \n function get_transport_details(){\n var out = '';\n if(doc.transporter_name || doc.lr_no || doc.lr_date){\n out += '<div><table class=\"noborder\" style=\"width:40%\">'\n +'<tr><td style=\"width:80%\"><b>' + 'Transporter Details'+'</b></td><td style=\"width:20%\"></td></tr>'\n\n if(doc.transporter_name){ out += '<tr><td style=\"width:40%\">' + 'Transporter Name'+'</td><td style=\"width:60%\">'+doc.transporter_name+'</td></tr>'}\n if(doc.lr_no){ out += '<tr><td style=\"width:40%\">' + 'LR No'+'</td><td style=\"width:60%\">'+doc.lr_no+'</td></tr>'}\n if(doc.lr_date){ out += '<tr><td style=\"width:40%\">' + 'LR Date'+'</td><td style=\"width:60%\">'+doc.lr_date+'</td></tr>'}\n out += '</table></div>'\n }\n return out;\n }\n\n</script>\n</head>\n<body>\n<div style=\"border:1px solid black;padding:15px\">\n<!--header-->\n<div><script>get_letter_head()</script></div>\n<div style=\"border-bottom: 1px solid; padding-bottom: 5px;\">\n <div><br><b>Purchase Receipt: <script>doc.name</script></b></div>\n <div>Date: <script>date.str_to_user(doc.transaction_date)</script></div>\n</div>\n\n<div style=\"padding-top:15px\">\n<div><script>doc.supplier</script></div>\n<div><br><script>replace_newlines(doc.address_display)</script></div>\n</div>\n\n<div>\n<br>\n <script>\n var t = print_table('Purchase Receipt', doc.name, 'purchase_receipt_details', 'Purchase Receipt Item', ['SR', 'item_code','description','received_qty','qty','rejected_qty','po_rate','amount','billed_qty'], ['Sr', 'Item Code', 'Description','Received Quantity','Accepted Qty','Rejected Qty','Rate','Amount','Billed Qty'], ['4%','12%', '24%', '10%','10%','10%','10%','10%','10%'])\n if(t.appendChild) {\n // single\n out = t.innerHTML;\n } \n else {//multiple\n out = ''\n for(var i=0;i<t.length;i++) {\n if(i!=t.length-1){\n out += '<div style:\"padding-top:5px;\"></div>' + t[i].innerHTML +'<div style=\"page-break-after:always\"></div>';\n }\n else out += '<div style:\"padding-top:5px;\"></div>' + t[i].innerHTML;\n }\n }\n out;\n </script>\n\n</div>\n\n<!--Other charges table-->\n<div>\n<table style=\"width:100%\">\n <tr><td style=\"width:40%\"><script>get_buying_costs()</script></td>\n <td style=\"width:20%\"></td><td style=\"width:40%\"><script>get_other_charges()</script></td></tr>\n</table>\n</div>\n<div><script>get_transport_details()</script></div>\n<div><br>Payment Terms</div>\n<div><br><script>replace_newlines(doc.payment_terms)</script></div>\n<div><br>For NCSCI</div>\n<div><br><br>(Authorised Signatory)</div>\n</div></body>\n</html>",
- "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 63b62d6..a20723d 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 e894d0d..1e89dc1 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -23,7 +23,7 @@
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.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 @@
// 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 @@
// Purchase Cost Center
// -----------------------------
cur_frm.fields_dict['cost_center'].get_query = function(doc) {
- return{
+ return {
filters:{ 'group_or_ledger': "Ledger" }
}
}
@@ -85,15 +86,15 @@
// 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.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 @@
}
}
-// 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('<table style="width: 100%; table-layout: fixed;">'+
- '<tr><td style="width:110px"><img src="%(imgurl)s" width="100px"></td>'+
- '<td>%(desc)s</td></tr>'+
- '</table>', {imgurl: wn.utils.get_file_link(doc.image), desc:doc.description});
+ doc.description_html = repl('<table style="width: 100%; table-layout: fixed;">' +
+ '<tr><td style="width:110px"><img src="%(imgurl)s" width="100px"></td>' +
+ '<td>%(desc)s</td></tr>' +
+ '</table>', {imgurl: wn.utils.get_file_link(doc.image), desc:doc.description});
refresh_field('description_html');
}
+
// Quotation to validation - either customer or lead mandatory
-cur_frm.cscript.weight_to_validate = function(doc,cdt,cdn){
-
- if((doc.nett_weight || doc.gross_weight) && !doc.weight_uom)
- {
- alert(wn._('Weight is mentioned,\nPlease mention "Weight UOM" too'));
- validated=0;
- }
+cur_frm.cscript.weight_to_validate = function(doc, cdt, cdn){
+ if((doc.nett_weight || doc.gross_weight) && !doc.weight_uom) {
+ msgprint(wn._('Weight is mentioned,\nPlease mention "Weight UOM" too'));
+ validated = 0;
+ }
}
-cur_frm.cscript.validate = function(doc,cdt,cdn){
- cur_frm.cscript.weight_to_validate(doc,cdt,cdn);
+cur_frm.cscript.validate = function(doc, cdt, cdn){
+ cur_frm.cscript.weight_to_validate(doc, cdt, cdn);
}
-cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query =
-function(doc,cdt,cdn) {
- return{ query: "erpnext.controllers.queries.customer_query" } }
-
-cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query =
- function(doc,cdt,cdn) {
- return{ query: "erpnext.controllers.queries.supplier_query" } }
+cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) {
+ return { query: "erpnext.controllers.queries.customer_query" }
+}
+
+cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query = function(doc, cdt, cdn) {
+ return { query: "erpnext.controllers.queries.supplier_query" }
+}
cur_frm.cscript.copy_from_item_group = function(doc) {
wn.model.with_doc("Item Group", doc.item_group, function() {
@@ -172,9 +166,9 @@
cur_frm.cscript.image = function() {
refresh_field("image_view");
- if(!cur_frm.doc.description_html) {
+ if(!cur_frm.doc.description_html)
cur_frm.cscript.add_image(cur_frm.doc);
- } else {
+ else {
msgprint(wn._("You may need to update: ") +
wn.meta.get_docfield(cur_frm.doc.doctype, "description_html").label);
}
diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py
index 95026ad..523d555 100644
--- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py
+++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py
@@ -39,13 +39,13 @@
for pr in purchase_receipts:
pr_bean = webnotes.bean('Purchase Receipt', pr)
- idx = max([d.idx for d in pr_bean.doclist.get({"parentfield": "purchase_tax_details"})])
+ idx = max([d.idx for d in pr_bean.doclist.get({"parentfield": "other_charges"})])
for lc in self.doclist.get({"parentfield": "landed_cost_details"}):
amt = flt(lc.amount) * flt(pr_bean.doc.net_total)/ flt(total_amt)
matched_row = pr_bean.doclist.get({
- "parentfield": "purchase_tax_details",
+ "parentfield": "other_charges",
"category": "Valuation",
"add_deduct_tax": "Add",
"charge_type": "Actual",
@@ -53,7 +53,7 @@
})
if not matched_row: # add if not exists
- ch = addchild(pr_bean.doc, 'purchase_tax_details', 'Purchase Taxes and Charges')
+ ch = addchild(pr_bean.doc, 'other_charges', 'Purchase Taxes and Charges')
ch.category = 'Valuation'
ch.add_deduct_tax = 'Add'
ch.charge_type = 'Actual'
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.txt b/erpnext/stock/doctype/material_request_item/material_request_item.txt
index 6e8a0d6..56a4976 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.txt
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:02",
"docstatus": 0,
- "modified": "2013-12-20 19:23:21",
+ "modified": "2014-02-03 11:35:26",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -41,22 +41,26 @@
"width": "100px"
},
{
- "allow_on_submit": 0,
"doctype": "DocField",
- "fieldname": "schedule_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Required Date",
- "no_copy": 0,
- "oldfieldname": "schedule_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
"print_width": "100px",
- "reqd": 1,
+ "reqd": 0,
+ "search_index": 1,
"width": "100px"
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
@@ -89,21 +93,6 @@
},
{
"doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Stock UOM",
- "no_copy": 0,
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "print_width": "70px",
- "read_only": 1,
- "reqd": 1,
- "width": "70px"
- },
- {
- "doctype": "DocField",
"fieldname": "warehouse",
"fieldtype": "Link",
"in_list_view": 1,
@@ -118,37 +107,46 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Stock UOM",
+ "no_copy": 0,
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "print_width": "70px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "70px"
+ },
+ {
+ "allow_on_submit": 0,
+ "doctype": "DocField",
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Required Date",
+ "no_copy": 0,
+ "oldfieldname": "schedule_date",
+ "oldfieldtype": "Date",
+ "print_hide": 0,
+ "print_width": "100px",
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "more_info",
"fieldtype": "Section Break",
"label": "More Info"
},
{
- "doctype": "DocField",
- "fieldname": "lead_time_date",
- "fieldtype": "Date",
- "in_list_view": 0,
- "label": "Lead Time Date",
- "no_copy": 1,
- "oldfieldname": "lead_time_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_width": "100px",
- "reqd": 0,
- "search_index": 1,
- "width": "100px"
- },
- {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
"doctype": "DocField",
"fieldname": "item_group",
@@ -179,6 +177,33 @@
},
{
"doctype": "DocField",
+ "fieldname": "lead_time_date",
+ "fieldtype": "Date",
+ "in_list_view": 0,
+ "label": "Lead Time Date",
+ "no_copy": 1,
+ "oldfieldname": "lead_time_date",
+ "oldfieldtype": "Date",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "sales_order_no",
+ "fieldtype": "Link",
+ "label": "Sales Order No",
+ "no_copy": 0,
+ "options": "Sales Order",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "min_order_qty",
"fieldtype": "Float",
"label": "Min Order Qty",
@@ -215,16 +240,6 @@
"read_only": 1
},
{
- "doctype": "DocField",
- "fieldname": "sales_order_no",
- "fieldtype": "Link",
- "label": "Sales Order No",
- "no_copy": 0,
- "options": "Sales Order",
- "print_hide": 1,
- "read_only": 1
- },
- {
"allow_on_submit": 1,
"doctype": "DocField",
"fieldname": "page_break",
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index 5151c00..1a08cd2 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -3,7 +3,7 @@
cur_frm.cscript.tname = "Purchase Receipt Item";
cur_frm.cscript.fname = "purchase_receipt_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' %}
@@ -106,27 +106,28 @@
$.extend(cur_frm.cscript, new erpnext.stock.PurchaseReceiptController({frm: cur_frm}));
cur_frm.fields_dict['supplier_address'].get_query = function(doc, cdt, cdn) {
- return{
- filters:{ 'supplier': doc.supplier}
+ return {
+ filters: { 'supplier': doc.supplier}
}
}
cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
- return{
- filters:{ 'supplier': doc.supplier}
+ return {
+ filters: { 'supplier': doc.supplier }
}
}
-cur_frm.cscript.new_contact = function(){
+cur_frm.cscript.new_contact = function() {
tn = wn.model.make_new_doc_and_get_name('Contact');
locals['Contact'][tn].is_supplier = 1;
- if(doc.supplier) locals['Contact'][tn].supplier = doc.supplier;
+ if(doc.supplier)
+ locals['Contact'][tn].supplier = doc.supplier;
loaddoc('Contact', tn);
}
cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
- return{
- filters:[
+ return {
+ filters: [
['Project', 'status', 'not in', 'Completed, Cancelled']
]
}
@@ -134,28 +135,25 @@
cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('batch_no').get_query= function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
- if(d.item_code){
- return{
- filters:{'item': d.item_code}
+ if(d.item_code) {
+ return {
+ filters: {'item': d.item_code}
}
}
- else{
- alert(wn._("Please enter Item Code."));
- }
+ else
+ msgprint(wn._("Please enter Item Code."));
}
-cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
- if(doc.select_print_heading){
- // print heading
+cur_frm.cscript.select_print_heading = function(doc, cdt, cdn) {
+ if(doc.select_print_heading)
cur_frm.pformat.print_heading = doc.select_print_heading;
- }
else
cur_frm.pformat.print_heading = "Purchase Receipt";
}
cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
- return{
- filters:[
+ return {
+ filters: [
['Print Heading', 'docstatus', '!=', '2']
]
}
@@ -170,7 +168,6 @@
}
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
- if(cint(wn.boot.notification_settings.purchase_receipt)) {
+ if(cint(wn.boot.notification_settings.purchase_receipt))
cur_frm.email_doc(wn.boot.notification_settings.purchase_receipt_message);
- }
-}
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt
index 960bb21..28c2572 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-29 15:25:14",
"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",
@@ -346,7 +346,7 @@
},
{
"doctype": "DocField",
- "fieldname": "purchase_tax_details",
+ "fieldname": "other_charges",
"fieldtype": "Table",
"label": "Purchase Taxes and Charges",
"oldfieldname": "purchase_tax_details",
@@ -355,9 +355,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
},
@@ -836,6 +836,7 @@
"write": 1
},
{
+ "cancel": 0,
"delete": 0,
"doctype": "DocPerm",
"role": "Supplier"
diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
index 89e77ce..c40b72b 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -184,7 +184,7 @@
"charge_type": "Actual",
"description": "Shipping Charges",
"doctype": "Purchase Taxes and Charges",
- "parentfield": "purchase_tax_details",
+ "parentfield": "other_charges",
"rate": 100.0,
"tax_amount": 100.0,
},
@@ -195,7 +195,7 @@
"charge_type": "Actual",
"description": "VAT",
"doctype": "Purchase Taxes and Charges",
- "parentfield": "purchase_tax_details",
+ "parentfield": "other_charges",
"rate": 120.0,
"tax_amount": 120.0,
},
@@ -206,7 +206,7 @@
"charge_type": "Actual",
"description": "Customs Duty",
"doctype": "Purchase Taxes and Charges",
- "parentfield": "purchase_tax_details",
+ "parentfield": "other_charges",
"rate": 150.0,
"tax_amount": 150.0,
},
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
index 9bc66a4..393e1ed 100755
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:10",
"docstatus": 0,
- "modified": "2014-01-15 16:00:44",
+ "modified": "2014-02-03 12:18:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -57,6 +57,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
@@ -118,6 +123,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "uom",
"fieldtype": "Link",
"in_list_view": 0,
@@ -133,6 +143,35 @@
},
{
"doctype": "DocField",
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Currency",
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "rate_and_amount",
"fieldtype": "Section Break",
"in_list_view": 0,
@@ -159,6 +198,26 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "purchase_ref_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "options": "Company:company:default_currency",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "import_rate",
"fieldtype": "Currency",
"in_list_view": 1,
@@ -184,13 +243,8 @@
},
{
"doctype": "DocField",
- "fieldname": "purchase_ref_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break"
},
{
"doctype": "DocField",
@@ -203,7 +257,7 @@
"options": "Company:company:default_currency",
"print_hide": 1,
"print_width": "100px",
- "read_only": 0,
+ "read_only": 1,
"reqd": 1,
"width": "100px"
},
@@ -218,7 +272,7 @@
"options": "Company:company:default_currency",
"print_hide": 1,
"print_width": "100px",
- "read_only": 0,
+ "read_only": 1,
"reqd": 0,
"width": "100px"
},
@@ -246,68 +300,6 @@
},
{
"doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Text",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Serial No",
- "no_copy": 1,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Text",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "rejected_serial_no",
- "fieldtype": "Text",
- "label": "Rejected Serial No",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "label": "Batch No",
- "oldfieldname": "batch_no",
- "oldfieldtype": "Link",
- "options": "Batch",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -322,19 +314,6 @@
"width": "100px"
},
{
- "doctype": "DocField",
- "fieldname": "schedule_date",
- "fieldtype": "Date",
- "label": "Required By",
- "no_copy": 0,
- "oldfieldname": "schedule_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0
- },
- {
"default": ":Company",
"depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
"doctype": "DocField",
@@ -368,36 +347,22 @@
},
{
"doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "label": "Required By",
+ "no_copy": 0,
+ "oldfieldname": "schedule_date",
+ "oldfieldtype": "Date",
"print_hide": 1,
"read_only": 1,
- "search_index": 1
+ "report_hide": 0,
+ "reqd": 0
},
{
"doctype": "DocField",
"fieldname": "stock_qty",
"fieldtype": "Float",
- "label": "Stock Qty",
+ "label": "Qty as per Stock UOM",
"oldfieldname": "stock_qty",
"oldfieldtype": "Currency",
"print_hide": 1,
@@ -437,6 +402,87 @@
},
{
"doctype": "DocField",
+ "fieldname": "prevdoc_detail_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Purchase Order Item No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_detail_docname",
+ "oldfieldtype": "Data",
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "serial_no",
+ "fieldtype": "Text",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Serial No",
+ "no_copy": 1,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Text",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "rejected_serial_no",
+ "fieldtype": "Text",
+ "label": "Rejected Serial No",
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "label": "Batch No",
+ "oldfieldname": "batch_no",
+ "oldfieldtype": "Link",
+ "options": "Batch",
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "doctype": "DocField",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "rm_supp_cost",
"fieldtype": "Currency",
"hidden": 1,
@@ -470,22 +516,6 @@
},
{
"doctype": "DocField",
- "fieldname": "prevdoc_detail_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Purchase Order Item No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_detail_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
"fieldname": "valuation_rate",
"fieldtype": "Currency",
"hidden": 1,
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 5dbcef8..5c7fdef 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -7,7 +7,7 @@
wn.require("assets/erpnext/js/controllers/stock_controller.js");
wn.provide("erpnext.stock");
-erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
+erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
setup: function() {
var me = this;
@@ -54,11 +54,11 @@
}
}
},
-
+
onload_post_render: function() {
this.set_default_account();
},
-
+
refresh: function() {
var me = this;
erpnext.hide_naming_series();
@@ -79,11 +79,11 @@
}
},
-
+
on_submit: function() {
this.clean_up();
},
-
+
after_cancel: function() {
this.clean_up();
},
@@ -113,7 +113,7 @@
});
}
},
-
+
clean_up: function() {
// Clear Production Order record from locals, because it is updated via Stock Entry
if(this.frm.doc.production_order &&
@@ -122,7 +122,7 @@
this.frm.doc.production_order);
}
},
-
+
get_items: function() {
if(this.frm.doc.production_order || this.frm.doc.bom_no) {
// if production order / bom is mentioned, get items
@@ -135,13 +135,13 @@
});
}
},
-
+
qty: function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
d.transfer_qty = flt(d.qty) * flt(d.conversion_factor);
refresh_field('mtn_details');
},
-
+
production_order: function() {
var me = this;
this.toggle_enable_bom();
@@ -157,11 +157,11 @@
}
});
},
-
+
toggle_enable_bom: function() {
this.frm.toggle_enable("bom_no", !this.frm.doc.production_order);
},
-
+
get_doctype_docname: function() {
if(this.frm.doc.purpose === "Sales Return") {
if(this.frm.doc.delivery_note_no && this.frm.doc.sales_invoice_no) {
@@ -190,7 +190,7 @@
}
}
},
-
+
add_excise_button: function() {
if(wn.boot.control_panel.country === "India")
this.frm.add_custom_button(wn._("Make Excise Invoice"), function() {
@@ -200,7 +200,7 @@
loaddoc('Journal Voucher', excise.name);
});
},
-
+
make_return_jv: function() {
if(this.get_doctype_docname()) {
return this.frm.call({
@@ -232,7 +232,7 @@
if(!row.s_warehouse) row.s_warehouse = this.frm.doc.from_warehouse;
if(!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;
},
-
+
mtn_details_on_form_rendered: function(doc, grid_row) {
erpnext.setup_serial_no(grid_row)
},
@@ -308,8 +308,8 @@
}
cur_frm.fields_dict['production_order'].get_query = function(doc) {
- return{
- filters:[
+ return {
+ filters: [
['Production Order', 'docstatus', '=', 1],
['Production Order', 'qty', '>','`tabProduction Order`.produced_qty']
]
@@ -322,7 +322,7 @@
// Overloaded query for link batch_no
cur_frm.fields_dict['mtn_details'].grid.get_field('batch_no').get_query = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
+ var d = locals[cdt][cdn];
if(d.item_code) {
return{
query: "erpnext.stock.doctype.stock_entry.stock_entry.get_batch_no",
@@ -387,7 +387,7 @@
cur_frm.cscript.validate_items = function(doc) {
cl = getchildren('Stock Entry Detail', doc.name, 'mtn_details');
if (!cl.length) {
- alert(wn._("Item table can not be blank"));
+ msgprint(wn._("Item table can not be blank"));
validated = false;
}
}
@@ -401,9 +401,9 @@
}
cur_frm.fields_dict.customer.get_query = function(doc, cdt, cdn) {
- return{ query: "erpnext.controllers.queries.customer_query" }
+ return { query: "erpnext.controllers.queries.customer_query" }
}
cur_frm.fields_dict.supplier.get_query = function(doc, cdt, cdn) {
- return{ query: "erpnext.controllers.queries.supplier_query" }
+ return { query: "erpnext.controllers.queries.supplier_query" }
}
diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
index 4410b84..4ec6c89 100644
--- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
@@ -483,7 +483,7 @@
d.expense_head = "_Test Account Cost for Goods Sold - _TC"
d.cost_center = "_Test Cost Center - _TC"
- for d in pi.doclist.get({"parentfield": "purchase_tax_details"}):
+ for d in pi.doclist.get({"parentfield": "other_charges"}):
d.cost_center = "_Test Cost Center - _TC"
pi.run_method("calculate_taxes_and_totals")
@@ -585,7 +585,7 @@
for d in pi.doclist.get({"parentfield": "entries"}):
d.expense_head = "_Test Account Cost for Goods Sold - _TC"
d.cost_center = "_Test Cost Center - _TC"
- for d in pi.doclist.get({"parentfield": "purchase_tax_details"}):
+ for d in pi.doclist.get({"parentfield": "other_charges"}):
d.cost_center = "_Test Cost Center - _TC"
pi.run_method("calculate_taxes_and_totals")
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
index 25835e0bf..3bc1695 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-29 18:22:12",
"docstatus": 0,
- "modified": "2014-01-15 16:08:45",
+ "modified": "2014-02-03 12:59:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -40,6 +40,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "t_warehouse",
"fieldtype": "Link",
"in_filter": 1,
@@ -53,6 +58,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "item_code",
"fieldtype": "Link",
"in_filter": 1,
@@ -75,6 +85,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
@@ -87,6 +102,12 @@
},
{
"doctype": "DocField",
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "label": "Quantity and Rate"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "qty",
"fieldtype": "Float",
"in_list_view": 1,
@@ -110,6 +131,58 @@
},
{
"doctype": "DocField",
+ "fieldname": "incoming_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Valuation Rate",
+ "oldfieldname": "incoming_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_filter": 0,
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "label": "Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Currency",
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "label": "Amount",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "serial_no_batch",
"fieldtype": "Section Break",
"label": "Serial No / Batch"
@@ -127,6 +200,11 @@
},
{
"doctype": "DocField",
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "batch_no",
"fieldtype": "Link",
"label": "Batch No",
@@ -143,28 +221,6 @@
"label": "Accounting"
},
{
- "doctype": "DocField",
- "fieldname": "incoming_rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Valuation Rate",
- "oldfieldname": "incoming_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "label": "Amount",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
"depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
"doctype": "DocField",
"fieldname": "expense_account",
@@ -174,6 +230,11 @@
"print_hide": 1
},
{
+ "doctype": "DocField",
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break"
+ },
+ {
"default": ":Company",
"depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
"doctype": "DocField",
@@ -207,15 +268,21 @@
"search_index": 1
},
{
+ "description": "BOM No. for a Finished Good Item",
"doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "label": "Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Currency",
+ "fieldname": "bom_no",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "BOM No",
+ "no_copy": 0,
+ "options": "BOM",
"print_hide": 1,
- "read_only": 1,
- "reqd": 1
+ "read_only": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break6",
+ "fieldtype": "Column Break"
},
{
"doctype": "DocField",
@@ -229,32 +296,6 @@
"reqd": 1
},
{
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_filter": 0,
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "description": "BOM No. for a Finished Good Item",
- "doctype": "DocField",
- "fieldname": "bom_no",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "BOM No",
- "no_copy": 0,
- "options": "BOM",
- "print_hide": 1,
- "read_only": 0
- },
- {
"description": "Material Request used to make this Stock Entry",
"doctype": "DocField",
"fieldname": "material_request",
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index 48f3e45..b12b38a 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -40,6 +40,14 @@
}
}
}
+ this.frm.fields_dict["cost_center"].get_query = function() {
+ return {
+ "filters": {
+ 'company': me.frm.doc.company,
+ 'group_or_ledger': 'Ledger'
+ }
+ }
+ }
}
},
diff --git a/erpnext/support/doctype/newsletter/newsletter.txt b/erpnext/support/doctype/newsletter/newsletter.txt
index 0618394..7cf149a 100644
--- a/erpnext/support/doctype/newsletter/newsletter.txt
+++ b/erpnext/support/doctype/newsletter/newsletter.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:31",
"docstatus": 0,
- "modified": "2014-01-24 13:00:11",
+ "modified": "2014-01-31 17:32:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,20 +26,20 @@
},
{
"cancel": 0,
- "create": 0,
+ "create": 1,
"delete": 0,
"doctype": "DocPerm",
- "email": 1,
+ "email": 0,
"name": "__common__",
"parent": "Newsletter",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
- "print": 1,
+ "print": 0,
"read": 1,
- "report": 1,
+ "report": 0,
"submit": 0,
- "write": 0
+ "write": 1
},
{
"doctype": "DocType",
diff --git a/erpnext/templates/includes/footer_extension.html b/erpnext/templates/includes/footer_extension.html
index 51367e1..315be06 100644
--- a/erpnext/templates/includes/footer_extension.html
+++ b/erpnext/templates/includes/footer_extension.html
@@ -11,11 +11,10 @@
<script>
$("#footer-subscribe-button").click(function() {
- $("#footer-subscribe-email").attr('disabled', true);
- $("#footer-subscribe-button").html("Sending...")
- .attr("disabled", true);
-
if($("#footer-subscribe-email").val()) {
+ $("#footer-subscribe-email").attr('disabled', true);
+ $("#footer-subscribe-button").html("Sending...")
+ .attr("disabled", true);
erpnext.send_message({
subject:"Subscribe me",
sender: $("#footer-subscribe-email").val(),
@@ -32,5 +31,7 @@
}
});
}
+ else
+ wn.msgprint(wn._("Please enter email address"))
});
</script>
diff --git a/erpnext/utilities/doctype/address/address.txt b/erpnext/utilities/doctype/address/address.txt
index 669da2b..aa9230d 100644
--- a/erpnext/utilities/doctype/address/address.txt
+++ b/erpnext/utilities/doctype/address/address.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:32",
"docstatus": 0,
- "modified": "2013-12-20 19:23:54",
+ "modified": "2014-01-27 11:19:06",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,7 +26,9 @@
"permlevel": 0
},
{
+ "cancel": 0,
"create": 1,
+ "delete": 0,
"doctype": "DocPerm",
"email": 1,
"name": "__common__",
@@ -56,6 +58,7 @@
"doctype": "DocField",
"fieldname": "address_title",
"fieldtype": "Data",
+ "in_list_view": 1,
"label": "Address Title",
"reqd": 0
},
@@ -95,6 +98,7 @@
"fieldname": "state",
"fieldtype": "Data",
"in_filter": 1,
+ "in_list_view": 1,
"label": "State",
"options": "Suggest",
"search_index": 0
@@ -104,6 +108,7 @@
"fieldname": "pincode",
"fieldtype": "Data",
"in_filter": 1,
+ "in_list_view": 1,
"label": "Pincode",
"search_index": 1
},
@@ -170,7 +175,6 @@
"options": "icon-pushpin"
},
{
- "depends_on": "eval:!doc.supplier && !doc.sales_partner",
"doctype": "DocField",
"fieldname": "customer",
"fieldtype": "Link",
@@ -178,17 +182,15 @@
"options": "Customer"
},
{
- "depends_on": "eval:!doc.supplier && !doc.sales_partner",
"doctype": "DocField",
"fieldname": "customer_name",
"fieldtype": "Data",
"in_filter": 1,
- "in_list_view": 1,
+ "in_list_view": 0,
"label": "Customer Name",
"read_only": 1
},
{
- "depends_on": "eval:!doc.customer && !doc.sales_partner && !doc.lead",
"doctype": "DocField",
"fieldname": "supplier",
"fieldtype": "Link",
@@ -196,18 +198,16 @@
"options": "Supplier"
},
{
- "depends_on": "eval:!doc.customer && !doc.sales_partner && !doc.lead",
"doctype": "DocField",
"fieldname": "supplier_name",
"fieldtype": "Data",
"in_filter": 1,
- "in_list_view": 1,
+ "in_list_view": 0,
"label": "Supplier Name",
"read_only": 1,
"search_index": 0
},
{
- "depends_on": "eval:!doc.customer && !doc.supplier && !doc.lead",
"doctype": "DocField",
"fieldname": "sales_partner",
"fieldtype": "Link",