From 903c42a130d009b95730050f9e3c60543a6701e8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Feb 2015 15:24:49 +0530 Subject: [PATCH] multiplefixes --- .../purchase_invoice/purchase_invoice.json | 6 ++-- .../doctype/sales_invoice/sales_invoice.json | 8 ++--- .../purchase_order/purchase_order.json | 6 ++-- .../supplier_quotation.json | 6 ++-- erpnext/public/js/controllers/transaction.js | 11 +++++++ .../selling/doctype/quotation/quotation.json | 32 +++++++++++++------ .../doctype/sales_order/sales_order.json | 7 ++-- .../doctype/delivery_note/delivery_note.json | 8 +++-- .../purchase_receipt/purchase_receipt.json | 6 ++-- 9 files changed, 58 insertions(+), 32 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index bd8199c0fe..b89f21591e 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -298,7 +298,7 @@ "options": "currency", "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "read_only": 1 }, { @@ -309,7 +309,7 @@ "oldfieldtype": "Currency", "options": "currency", "permlevel": 0, - "print_hide": 0, + "print_hide": 1, "read_only": 1 }, { @@ -962,7 +962,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2015-02-23 15:33:28.554922", + "modified": "2015-02-24 15:24:24.402882", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index d7837a2e9d..b909cb438c 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -365,7 +365,7 @@ "options": "currency", "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "read_only": 1 }, { @@ -374,7 +374,7 @@ "label": "Net Total", "options": "currency", "permlevel": 0, - "print_hide": 0, + "print_hide": 1, "read_only": 1 }, { @@ -495,7 +495,7 @@ "label": "Discount Amount", "options": "currency", "permlevel": 0, - "print_hide": 0 + "print_hide": 1 }, { "fieldname": "base_discount_amount", @@ -1244,7 +1244,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2015-02-23 15:53:37.894033", + "modified": "2015-02-24 15:23:28.554373", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 6776535713..273bf2703f 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -272,7 +272,7 @@ "options": "currency", "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "read_only": 1 }, { @@ -284,7 +284,7 @@ "oldfieldtype": "Currency", "options": "currency", "permlevel": 0, - "print_hide": 0, + "print_hide": 1, "read_only": 1 }, { @@ -856,7 +856,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2015-02-23 15:10:05.156787", + "modified": "2015-02-24 15:23:59.609724", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index 0ed60230d5..8b5f8d6578 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -263,7 +263,7 @@ "options": "currency", "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "read_only": 1 }, { @@ -275,7 +275,7 @@ "oldfieldtype": "Currency", "options": "currency", "permlevel": 0, - "print_hide": 0, + "print_hide": 1, "read_only": 1 }, { @@ -657,7 +657,7 @@ "icon": "icon-shopping-cart", "idx": 1, "is_submittable": 1, - "modified": "2015-02-23 15:24:02.428061", + "modified": "2015-02-24 15:23:43.663479", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 3f9846f195..a1c4fb223d 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -329,6 +329,15 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ me.frm.fields_dict[fname].set_label(label); }); + var show =cint(cur_frm.doc.discount_amount) || + ((cur_frm.doc.taxes || []).filter(function(d) {return d.included_in_print_rate===1}).length); + + if(frappe.meta.get_docfield(cur_frm.doctype, "net_total")) + cur_frm.toggle_display("net_total", show); + + if(frappe.meta.get_docfield(cur_frm.doctype, "base_net_total")) + cur_frm.toggle_display("base_net_total", (show && (me.frm.doc.currency != company_currency))); + }, change_grid_labels: function(company_currency) { @@ -702,6 +711,7 @@ frappe.ui.form.on(cur_frm.cscript.tax_table, "row_id", function(frm, cdt, cdn) { }) frappe.ui.form.on(cur_frm.cscript.tax_table, "included_in_print_rate", function(frm, cdt, cdn) { + cur_frm.cscript.set_dynamic_labels(); cur_frm.cscript.calculate_taxes_and_totals(); }) @@ -710,5 +720,6 @@ frappe.ui.form.on(cur_frm.doctype, "apply_discount_on", function(frm) { }) frappe.ui.form.on(cur_frm.doctype, "discount_amount", function(frm) { + cur_frm.cscript.set_dynamic_labels(); cur_frm.cscript.calculate_taxes_and_totals(); }) diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 675e6b0fd7..1f5a6642ec 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -428,15 +428,6 @@ "fieldtype": "Section Break", "permlevel": 0 }, - { - "fieldname": "total_taxes_and_charges", - "fieldtype": "Currency", - "label": "Total Taxes and Charges", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, { "fieldname": "base_total_taxes_and_charges", "fieldtype": "Currency", @@ -453,6 +444,21 @@ "fieldtype": "Column Break", "permlevel": 0 }, + { + "fieldname": "total_taxes_and_charges", + "fieldtype": "Currency", + "label": "Total Taxes and Charges", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "section_break_44", + "fieldtype": "Section Break", + "permlevel": 0, + "precision": "" + }, { "default": "Grand Total", "fieldname": "apply_discount_on", @@ -463,6 +469,12 @@ "precision": "", "print_hide": 1 }, + { + "fieldname": "column_break_46", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, { "fieldname": "discount_amount", "fieldtype": "Currency", @@ -844,7 +856,7 @@ "idx": 1, "is_submittable": 1, "max_attachments": 1, - "modified": "2015-02-23 01:18:17.421144", + "modified": "2015-02-24 14:52:49.998224", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index db7cc800f7..0e988a5483 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -360,7 +360,7 @@ "options": "currency", "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "read_only": 1 }, { @@ -369,6 +369,7 @@ "label": "Net Total", "options": "currency", "permlevel": 0, + "print_hide": 1, "read_only": 1 }, { @@ -485,7 +486,7 @@ "label": "Discount Amount", "options": "currency", "permlevel": 0, - "print_hide": 0 + "print_hide": 1 }, { "fieldname": "base_discount_amount", @@ -1076,7 +1077,7 @@ "idx": 1, "is_submittable": 1, "issingle": 0, - "modified": "2015-02-23 15:40:17.414233", + "modified": "2015-02-24 15:22:27.195416", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index a68f8cb29d..8fd5702100 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -377,7 +377,7 @@ "options": "currency", "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "read_only": 1 }, { @@ -386,6 +386,7 @@ "label": "Net Total", "options": "currency", "permlevel": 0, + "print_hide": 1, "read_only": 1 }, { @@ -507,7 +508,8 @@ "fieldtype": "Currency", "label": "Discount Amount", "options": "currency", - "permlevel": 0 + "permlevel": 0, + "print_hide": 1 }, { "fieldname": "base_discount_amount", @@ -1065,7 +1067,7 @@ "idx": 1, "in_create": 0, "is_submittable": 1, - "modified": "2015-02-23 15:49:10.972483", + "modified": "2015-02-24 15:23:10.431286", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index 7964dd2455..60ea3d49d6 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -274,7 +274,7 @@ "options": "currency", "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "read_only": 1 }, { @@ -285,7 +285,7 @@ "oldfieldtype": "Currency", "options": "currency", "permlevel": 0, - "print_hide": 0, + "print_hide": 1, "read_only": 1 }, { @@ -849,7 +849,7 @@ "icon": "icon-truck", "idx": 1, "is_submittable": 1, - "modified": "2015-02-23 15:16:36.617354", + "modified": "2015-02-24 15:24:11.158048", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt",