[merge] [minor] Fixed conflict while merging serial_no branch with master
diff --git a/accounts/Print Format/POS Invoice/POS Invoice.txt b/accounts/Print Format/POS Invoice/POS Invoice.txt
index edd5f11..672c107 100644
--- a/accounts/Print Format/POS Invoice/POS Invoice.txt
+++ b/accounts/Print Format/POS Invoice/POS Invoice.txt
@@ -1,21 +1,22 @@
[
{
- "owner": "Administrator",
- "docstatus": 0,
"creation": "2011-12-21 11:08:55",
+ "docstatus": 0,
+ "modified": "2013-08-16 16:15:46",
"modified_by": "Administrator",
- "modified": "2012-03-20 12:29:49"
+ "owner": "Administrator"
},
{
"doc_type": "Sales Invoice",
- "name": "__common__",
- "module": "Accounts",
"doctype": "Print Format",
- "html": "<html>\n<head>\n<!--Other charges function-->\n<script>\nvar make_row = function(title,val,bold){\nvar bstart = '<b>'; var bend = '</b>';\nreturn '<tr><td style=\"width:50%\">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'\n +'<td style=\"width:20%\">'+doc.currency+'</td>'\n +'<td style=\"width:30%;text-align:right\">'+(val?val:'0.00')+'</td>'\n +'</tr>'\n}\nvar make_row1 = function(title,val,bold){\n var bstart = '<b>'; var bend = '</b>';\n \n return '<tr style=\"font-family:courier new; line-height:150%\"><td style=\"width:50%\">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'\n +'<td style=\"width:50%;text-align:right\">'+(bold?bstart:'')+(val?val:'0.00')+(bold?bend:'')+'</td>'\n +'</tr>'\n}\n\nfunction get_letter_head() {\n // add letter head\n var cp = wn.boot.control_panel;\n if(doc.letter_head)\n var lh= cstr(_p.letter_heads[doc.letter_head]);\n else if(cp.letter_head)\n var lh= cp.letter_head;\n else \n var lh= '';\n \n return lh;\n}\n\nfunction get_tax_details(){\n var cl = getchildren('Sales Taxes and Charges',doc.name,'other_charges');\n var out = '';\n\n out += '<div><table style=\"float: right;\">';\n for(var i=0;i<cl.length;i++){\n if(cl[i].tax_amount) {\n out += make_row1(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);\n }\n }\n out += make_row1('TOTAL',doc.currency + \" \" + fmt_money(convert_rate(doc.grand_total)),1);\n out +='</table></div>';\n return out;\n}\n\nfunction convert_rate(val){ \n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n}\n</script>\n<style>\n table, td, tr, div, span {\n font-family: courier new;\n line-height: 200%;\n }\n</style>\n</head>\n\n<body>\n<table width=\"100%\" style=\"font-family: courier new; line-height:200%\">\n<tr>\n <td align=\"left\">NO: <script>doc.name</script></td>\n <td align=\"right\">DATE: <script>date.str_to_user(doc.posting_date)</script></td>\n</tr>\n<tr>\n <td>M/s <script>doc.contact_display</script></td>\n</tr>\n</table>\n<!--Item Table-->\n<div>\n<script>\nvar t = print_table('Sales Invoice', doc.name, 'entries', 'Sales Invoice Item',\n ['description','qty','export_rate','export_amount'], ['ITEM', 'QTY','RATE','AMOUNT'],\n ['35%','20%','20%','25%']);\nif(t.appendChild) { // single\n out = t.innerHTML.replace(/style=\"/gi,'style=\"font-family:courier new;line-height:150%;');\n} else { //multiple\n out = '<table class=\"None\" border=\"0px\" width=\"100%\" style=\"border:0px; font-family:courier-new\">';\n\n for(var i=0;i<t.length;i++) {\n if(i==0) {\n out += '<tr>' + t[i].childNodes[0].childNodes[0].childNodes[0].innerHTML\n .replace(/style=\"border: 1px solid rgb\\(0, 0, 0\\);/gi,'style=\"font-family:courier new;')\n + '</tr>';\n }\n out += '<tr>' + t[i].childNodes[0].childNodes[0].childNodes[1].innerHTML\n .replace(/style=\"border: 1px solid rgb\\(0, 0, 0\\);/gi,'style=\"font-family:courier new;')\n + '</tr>';\n }\n out += '</table>';\n}\nout;\n</script>\n</div>\n<!--Tax table-->\n<div><script>get_tax_details();</script></div><br />\n<table style=\"font-family:courier new;\">\n <tr><td><b><script>doc.terms</script></b></td></tr>\n <tr><td nowrap><b>For <script>doc.company</script></b></td></tr>\n <tr><td> </td></tr>\n <tr><td nowrap><b>Signatory</b></td></tr>\n</table>\n</body>\n</html>\n",
+ "html": "<html>\n<head>\n<!--Other charges function-->\n<script>\nvar make_row = function(title,val,bold){\nvar bstart = '<b>'; var bend = '</b>';\nreturn '<tr><td style=\"width:50%\">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'\n +'<td style=\"width:20%\">'+doc.currency+'</td>'\n +'<td style=\"width:30%;text-align:right\">'+(val?val:'0.00')+'</td>'\n +'</tr>'\n}\nvar make_row1 = function(title,val,bold){\n var bstart = '<b>'; var bend = '</b>';\n \n return '<tr style=\"font-family:courier new; line-height:150%\"><td style=\"width:50%\">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'\n +'<td style=\"width:50%;text-align:right\">'+(bold?bstart:'')+(val?val:'0.00')+(bold?bend:'')+'</td>'\n +'</tr>'\n}\n\nfunction get_letter_head() {\n // add letter head\n var cp = wn.boot.control_panel;\n if(doc.letter_head)\n var lh= cstr(_p.letter_heads[doc.letter_head]);\n else if(cp.letter_head)\n var lh= cp.letter_head;\n else \n var lh= '';\n \n return lh;\n}\n\nfunction get_tax_details(){\n var cl = getchildren('Sales Taxes and Charges',doc.name,'other_charges');\n var out = '';\n\n out += '<div><table style=\"float: right;\">';\n for(var i=0;i<cl.length;i++){\n if(cl[i].tax_amount) {\n out += make_row1(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);\n }\n }\n out += make_row1('TOTAL',doc.currency + \" \" + fmt_money(convert_rate(doc.grand_total)),1);\n out +='</table></div>';\n return out;\n}\n\nfunction convert_rate(val){ \n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n}\n</script>\n<style>\n table, td, tr, div, span {\n font-family: courier new;\n line-height: 200%;\n }\n</style>\n</head>\n\n<body>\n<table width=\"100%\" style=\"font-family: courier new; line-height:200%\">\n<tr>\n <td align=\"left\">NO: <script>doc.name</script></td>\n <td align=\"right\">DATE: <script>date.str_to_user(doc.posting_date)</script></td>\n</tr>\n<tr>\n <td>M/s <script>doc.contact_display</script></td>\n</tr>\n</table>\n<!--Item Table-->\n<div>\n<script>\nvar t = print_table(\n \t\t\t'Sales Invoice',\n\t\t\t\tdoc.name,\n\t\t\t\t'entries',\n\t\t\t\t'Sales Invoice Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'description', 'qty', 'export_rate', 'export_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', 'Description', 'Qty', 'Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'5%', '35%', '20%', '20%', '20%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\nif(t.appendChild) { // single\n out = t.innerHTML.replace(/style=\"/gi,'style=\"font-family:courier new;line-height:150%;');\n} else { //multiple\n out = '<table class=\"None\" border=\"0px\" width=\"100%\" style=\"border:0px; font-family:courier-new\">';\n\n for(var i=0;i<t.length;i++) {\n if(i==0) {\n out += '<tr>' + t[i].childNodes[0].childNodes[0].childNodes[0].innerHTML\n .replace(/style=\"border: 1px solid rgb\\(0, 0, 0\\);/gi,'style=\"font-family:courier new;')\n + '</tr>';\n }\n out += '<tr>' + t[i].childNodes[0].childNodes[0].childNodes[1].innerHTML\n .replace(/style=\"border: 1px solid rgb\\(0, 0, 0\\);/gi,'style=\"font-family:courier new;')\n + '</tr>';\n }\n out += '</table>';\n}\nout;\n</script>\n</div>\n<!--Tax table-->\n<div><script>get_tax_details();</script></div><br />\n<table style=\"font-family:courier new;\">\n <tr><td><b><script>doc.terms</script></b></td></tr>\n <tr><td nowrap><b>For <script>doc.company</script></b></td></tr>\n <tr><td> </td></tr>\n <tr><td nowrap><b>Signatory</b></td></tr>\n</table>\n</body>\n</html>\n",
+ "module": "Accounts",
+ "name": "__common__",
+ "print_format_type": "Client",
"standard": "Yes"
},
{
- "name": "POS Invoice",
- "doctype": "Print Format"
+ "doctype": "Print Format",
+ "name": "POS Invoice"
}
]
\ No newline at end of file
diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py
index b017f04..f4ac6b0 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/accounts/doctype/sales_invoice/sales_invoice.py
@@ -493,18 +493,20 @@
if not d.warehouse:
d.warehouse = cstr(w)
- if flt(self.doc.paid_amount) == 0:
- if self.doc.cash_bank_account:
- webnotes.conn.set(self.doc, 'paid_amount',
- (flt(self.doc.grand_total) - flt(self.doc.write_off_amount)))
- else:
- # show message that the amount is not paid
- webnotes.conn.set(self.doc,'paid_amount',0)
- webnotes.msgprint("Note: Payment Entry will not be created since 'Cash/Bank Account' was not specified.")
-
self.make_packing_list()
else:
self.doclist = self.doc.clear_table(self.doclist, 'packing_details')
+
+ if cint(self.doc.is_pos) == 1:
+ if flt(self.doc.paid_amount) == 0:
+ if self.doc.cash_bank_account:
+ webnotes.conn.set(self.doc, 'paid_amount',
+ (flt(self.doc.grand_total) - flt(self.doc.write_off_amount)))
+ else:
+ # show message that the amount is not paid
+ webnotes.conn.set(self.doc,'paid_amount',0)
+ webnotes.msgprint("Note: Payment Entry will not be created since 'Cash/Bank Account' was not specified.")
+ else:
webnotes.conn.set(self.doc,'paid_amount',0)
def check_prev_docstatus(self):
diff --git a/controllers/accounts_controller.py b/controllers/accounts_controller.py
index d6bf392..a3dae8e 100644
--- a/controllers/accounts_controller.py
+++ b/controllers/accounts_controller.py
@@ -75,7 +75,7 @@
self.doc.conversion_rate = self.doc.plc_conversion_rate
if self.meta.get_field("currency"):
- if self.doc.currency != company_currency:
+ if self.doc.currency and self.doc.currency != company_currency:
if not self.doc.conversion_rate:
exchange = self.doc.currency + "-" + company_currency
self.doc.conversion_rate = flt(webnotes.conn.get_value("Currency Exchange",
diff --git a/patches/patch_list.py b/patches/patch_list.py
index d8b9c72..41160aa 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -255,4 +255,5 @@
"patches.august_2013.p03_pos_setting_replace_customer_account",
"patches.august_2013.p05_update_serial_no_status",
"patches.august_2013.p05_employee_birthdays",
+ "execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-08-16",
]
\ No newline at end of file
diff --git a/startup/__init__.py b/startup/__init__.py
index 5bc86df..9246b5e 100644
--- a/startup/__init__.py
+++ b/startup/__init__.py
@@ -32,12 +32,13 @@
"nederlands": "nl",
"српски":"sr",
"தமிழ்": "ta",
- "Hrvatski": "hr",
+ "hrvatski": "hr",
+ "italiano": "it",
"ไทย": "th",
"العربية":"ar"
}
-lang_list = ["ar", "de", "en", "hi", "es", "fr", "pt-BR", "pt", "nl", "hr", "th"]
+lang_list = ["ar", "de", "en", "es", "fr", "hi", "hr", "it", "nl", "pt-BR", "pt", "th", "sr", "ta"]
product_name = "ERPNext"
profile_defaults = {
diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js
index 917e53d..529cb62 100644
--- a/stock/doctype/stock_entry/stock_entry.js
+++ b/stock/doctype/stock_entry/stock_entry.js
@@ -122,16 +122,15 @@
},
get_items: function() {
- if(this.frm.doc.__islocal && (this.frm.doc.production_order || this.frm.doc.bom_no)
- && !getchildren('Stock Entry Detail', this.frm.doc.name, 'mtn_details').length) {
- // if production order / bom is mentioned, get items
- return this.frm.call({
- doc: this.frm.doc,
- method: "get_items",
- callback: function(r) {
- if(!r.exc) refresh_field("mtn_details");
- }
- });
+ if(this.frm.doc.production_order || this.frm.doc.bom_no) {
+ // if production order / bom is mentioned, get items
+ return this.frm.call({
+ doc: this.frm.doc,
+ method: "get_items",
+ callback: function(r) {
+ if(!r.exc) refresh_field("mtn_details");
+ }
+ });
}
},
diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py
index 151a5b4..b050c8c 100644
--- a/stock/doctype/stock_entry/stock_entry.py
+++ b/stock/doctype/stock_entry/stock_entry.py
@@ -559,7 +559,6 @@
for item in item_dict:
pending_to_issue = (max_qty * item_dict[item]["qty"]) - issued_item_qty.get(item, 0)
desire_to_transfer = flt(self.doc.fg_completed_qty) * item_dict[item]["qty"]
-
if desire_to_transfer <= pending_to_issue:
item_dict[item]["qty"] = desire_to_transfer
else:
diff --git a/translations/it.csv b/translations/it.csv
index 8205e7a..c91fc84 100644
--- a/translations/it.csv
+++ b/translations/it.csv
Binary files differ