[cleanup] moved company to top section, hide company if only one exists, changed field labels

This commit is contained in:
Anand Doshi
2013-07-09 13:03:39 +05:30
parent 8f050f4cd3
commit bdee6e074a
23 changed files with 616 additions and 742 deletions

View File

@@ -220,6 +220,21 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
}
},
purchase_other_charges: function() {
var me = this;
if(this.frm.doc.purchase_other_charges) {
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");

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:39",
"docstatus": 0,
"modified": "2013-07-08 17:49:29",
"modified": "2013-07-09 12:50:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -139,55 +139,37 @@
},
{
"doctype": "DocField",
"fieldname": "items",
"fieldtype": "Section Break",
"label": "Items",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart"
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 0,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"print_hide": 1,
"read_only": 1,
"report_hide": 0
},
{
"allow_on_submit": 1,
"description": "Select the relevant company name if you have multiple companies",
"doctype": "DocField",
"fieldname": "po_details",
"fieldtype": "Table",
"label": "Purchase Order Items",
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"no_copy": 0,
"oldfieldname": "po_details",
"oldfieldtype": "Table",
"options": "Purchase Order Item"
},
{
"doctype": "DocField",
"fieldname": "sb_last_purchase",
"fieldtype": "Section Break"
},
{
"doctype": "DocField",
"fieldname": "get_last_purchase_rate",
"fieldtype": "Button",
"label": "Get Last Purchase Rate",
"oldfieldtype": "Button",
"print_hide": 0
},
{
"doctype": "DocField",
"fieldname": "column_break2",
"fieldtype": "Column Break",
"print_width": "50%",
"width": "50%"
},
{
"doctype": "DocField",
"fieldname": "recalculate_values",
"fieldtype": "Button",
"label": "Re-Calculate Values",
"oldfieldtype": "Button"
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"print_hide": 1,
"reqd": 1,
"search_index": 1
},
{
"doctype": "DocField",
"fieldname": "price_list_and_currency",
"fieldtype": "Section Break",
"label": "Currency & Price List",
"label": "Currency and Price List",
"options": "icon-tag"
},
{
@@ -253,6 +235,68 @@
"label": "Price List Exchange Rate",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "items",
"fieldtype": "Section Break",
"label": "Items",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart"
},
{
"allow_on_submit": 1,
"doctype": "DocField",
"fieldname": "po_details",
"fieldtype": "Table",
"label": "Purchase Order Items",
"no_copy": 0,
"oldfieldname": "po_details",
"oldfieldtype": "Table",
"options": "Purchase Order Item"
},
{
"doctype": "DocField",
"fieldname": "sb_last_purchase",
"fieldtype": "Section Break"
},
{
"doctype": "DocField",
"fieldname": "net_total_import",
"fieldtype": "Currency",
"label": "Net Total",
"no_copy": 0,
"oldfieldname": "net_total_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "get_last_purchase_rate",
"fieldtype": "Button",
"label": "Get Last Purchase Rate",
"oldfieldtype": "Button",
"print_hide": 0
},
{
"doctype": "DocField",
"fieldname": "column_break_26",
"fieldtype": "Column Break"
},
{
"doctype": "DocField",
"fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"no_copy": 1,
"oldfieldname": "net_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1,
"reqd": 0
},
{
"doctype": "DocField",
"fieldname": "taxes",
@@ -274,15 +318,6 @@
"options": "Purchase Taxes and Charges Master",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "get_tax_detail",
"fieldtype": "Button",
"label": "Get Tax Detail",
"oldfieldtype": "Button",
"options": "get_purchase_tax_details",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "purchase_tax_details",
@@ -293,14 +328,6 @@
"oldfieldtype": "Table",
"options": "Purchase Taxes and Charges"
},
{
"doctype": "DocField",
"fieldname": "calculate_tax",
"fieldtype": "Button",
"label": "Calculate Tax",
"oldfieldtype": "Button",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "tax_calculation",
@@ -318,23 +345,11 @@
"oldfieldtype": "Section Break",
"options": "icon-money"
},
{
"doctype": "DocField",
"fieldname": "net_total_import",
"fieldtype": "Currency",
"label": "Net Total (Import)",
"no_copy": 0,
"oldfieldname": "net_total_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "other_charges_added_import",
"fieldtype": "Currency",
"label": "Taxes and Charges Added (Import)",
"label": "Taxes and Charges Added",
"no_copy": 0,
"oldfieldname": "other_charges_added_import",
"oldfieldtype": "Currency",
@@ -347,7 +362,7 @@
"doctype": "DocField",
"fieldname": "other_charges_deducted_import",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted (Import)",
"label": "Taxes and Charges Deducted",
"no_copy": 0,
"oldfieldname": "other_charges_deducted_import",
"oldfieldtype": "Currency",
@@ -361,7 +376,7 @@
"fieldname": "grand_total_import",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total (Import)",
"label": "Grand Total",
"no_copy": 0,
"oldfieldname": "grand_total_import",
"oldfieldtype": "Currency",
@@ -374,7 +389,7 @@
"doctype": "DocField",
"fieldname": "in_words_import",
"fieldtype": "Data",
"label": "In Words(Import)",
"label": "In Words",
"oldfieldname": "in_words_import",
"oldfieldtype": "Data",
"print_hide": 1,
@@ -387,24 +402,11 @@
"oldfieldtype": "Column Break",
"print_hide": 0
},
{
"doctype": "DocField",
"fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total*",
"no_copy": 1,
"oldfieldname": "net_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1,
"reqd": 0
},
{
"doctype": "DocField",
"fieldname": "other_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added",
"label": "Taxes and Charges Added (Company Currency)",
"no_copy": 0,
"oldfieldname": "other_charges_added",
"oldfieldtype": "Currency",
@@ -416,7 +418,7 @@
"doctype": "DocField",
"fieldname": "other_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted",
"label": "Taxes and Charges Deducted (Company Currency)",
"no_copy": 0,
"oldfieldname": "other_charges_deducted",
"oldfieldtype": "Currency",
@@ -428,7 +430,7 @@
"doctype": "DocField",
"fieldname": "total_tax",
"fieldtype": "Currency",
"label": "Total Tax*",
"label": "Total Tax (Company Currency)",
"no_copy": 1,
"oldfieldname": "total_tax",
"oldfieldtype": "Currency",
@@ -440,7 +442,7 @@
"doctype": "DocField",
"fieldname": "grand_total",
"fieldtype": "Currency",
"label": "Grand Total",
"label": "Grand Total (Company Currency)",
"no_copy": 1,
"oldfieldname": "grand_total",
"oldfieldtype": "Currency",
@@ -452,7 +454,7 @@
"doctype": "DocField",
"fieldname": "rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total",
"label": "Rounded Total (Company Currency)",
"oldfieldname": "rounded_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -464,7 +466,7 @@
"doctype": "DocField",
"fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
"oldfieldtype": "Data",
"print_hide": 1,
@@ -581,34 +583,6 @@
"options": "link:Letter Head",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 0,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"print_hide": 1,
"read_only": 1,
"report_hide": 0
},
{
"description": "Select the relevant company name if you have multiple companies",
"doctype": "DocField",
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"print_hide": 1,
"reqd": 1,
"search_index": 1
},
{
"doctype": "DocField",
"fieldname": "fiscal_year",

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:06",
"docstatus": 0,
"modified": "2013-07-08 13:51:42",
"modified": "2013-07-09 12:16:19",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -160,7 +160,7 @@
"doctype": "DocField",
"fieldname": "purchase_ref_rate",
"fieldtype": "Currency",
"label": "Ref Rate*",
"label": "Price List Rate (Company Currency)",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 0
@@ -170,7 +170,7 @@
"doctype": "DocField",
"fieldname": "purchase_rate",
"fieldtype": "Currency",
"label": "Rate*",
"label": "Rate (Company Currency)",
"oldfieldname": "purchase_rate",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -185,7 +185,7 @@
"doctype": "DocField",
"fieldname": "amount",
"fieldtype": "Currency",
"label": "Amount*",
"label": "Amount (Company Currency)",
"oldfieldname": "amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:45",
"docstatus": 0,
"modified": "2013-07-08 15:14:48",
"modified": "2013-07-09 12:49:31",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -139,40 +139,37 @@
},
{
"doctype": "DocField",
"fieldname": "items",
"fieldtype": "Section Break",
"label": "Items",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart"
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"print_hide": 1,
"read_only": 1,
"report_hide": 0
},
{
"allow_on_submit": 1,
"description": "Select the relevant company name if you have multiple companies",
"doctype": "DocField",
"fieldname": "quotation_items",
"fieldtype": "Table",
"label": "Quotation Items",
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"no_copy": 0,
"oldfieldname": "po_details",
"oldfieldtype": "Table",
"options": "Supplier Quotation Item"
},
{
"doctype": "DocField",
"fieldname": "section_break0",
"fieldtype": "Section Break"
},
{
"doctype": "DocField",
"fieldname": "recalculate_values",
"fieldtype": "Button",
"label": "Re-Calculate Values",
"oldfieldtype": "Button"
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"print_hide": 1,
"reqd": 1,
"search_index": 1
},
{
"doctype": "DocField",
"fieldname": "currency_price_list",
"fieldtype": "Section Break",
"label": "Currency & Price List",
"label": "Currency and Price List",
"options": "icon-tag"
},
{
@@ -235,6 +232,60 @@
"label": "Price List Exchange Rate",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "items",
"fieldtype": "Section Break",
"label": "Items",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart"
},
{
"allow_on_submit": 1,
"doctype": "DocField",
"fieldname": "quotation_items",
"fieldtype": "Table",
"label": "Quotation Items",
"no_copy": 0,
"oldfieldname": "po_details",
"oldfieldtype": "Table",
"options": "Supplier Quotation Item"
},
{
"doctype": "DocField",
"fieldname": "section_break_22",
"fieldtype": "Section Break"
},
{
"doctype": "DocField",
"fieldname": "net_total_import",
"fieldtype": "Currency",
"label": "Net Total",
"no_copy": 0,
"oldfieldname": "net_total_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "column_break_24",
"fieldtype": "Column Break"
},
{
"doctype": "DocField",
"fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"no_copy": 1,
"oldfieldname": "net_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1,
"reqd": 0
},
{
"doctype": "DocField",
"fieldname": "taxes",
@@ -255,15 +306,6 @@
"options": "Purchase Taxes and Charges Master",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "get_tax_detail",
"fieldtype": "Button",
"label": "Get Tax Detail",
"oldfieldtype": "Button",
"options": "get_purchase_tax_details",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "purchase_tax_details",
@@ -274,14 +316,6 @@
"oldfieldtype": "Table",
"options": "Purchase Taxes and Charges"
},
{
"doctype": "DocField",
"fieldname": "calculate_tax",
"fieldtype": "Button",
"label": "Calculate Tax",
"oldfieldtype": "Button",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "tax_calculation",
@@ -299,23 +333,11 @@
"oldfieldtype": "Section Break",
"options": "icon-money"
},
{
"doctype": "DocField",
"fieldname": "net_total_import",
"fieldtype": "Currency",
"label": "Net Total (Import)",
"no_copy": 0,
"oldfieldname": "net_total_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "other_charges_added_import",
"fieldtype": "Currency",
"label": "Taxes and Charges Added (Import)",
"label": "Taxes and Charges Added",
"no_copy": 0,
"oldfieldname": "other_charges_added_import",
"oldfieldtype": "Currency",
@@ -328,7 +350,7 @@
"doctype": "DocField",
"fieldname": "other_charges_deducted_import",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted (Import)",
"label": "Taxes and Charges Deducted",
"no_copy": 0,
"oldfieldname": "other_charges_deducted_import",
"oldfieldtype": "Currency",
@@ -342,7 +364,7 @@
"fieldname": "grand_total_import",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total (Import)",
"label": "Grand Total",
"no_copy": 0,
"oldfieldname": "grand_total_import",
"oldfieldtype": "Currency",
@@ -355,7 +377,7 @@
"doctype": "DocField",
"fieldname": "in_words_import",
"fieldtype": "Data",
"label": "In Words(Import)",
"label": "In Words",
"oldfieldname": "in_words_import",
"oldfieldtype": "Data",
"print_hide": 1,
@@ -368,24 +390,11 @@
"oldfieldtype": "Column Break",
"print_hide": 0
},
{
"doctype": "DocField",
"fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total*",
"no_copy": 1,
"oldfieldname": "net_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1,
"reqd": 0
},
{
"doctype": "DocField",
"fieldname": "other_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added",
"label": "Taxes and Charges Added (Company Currency)",
"no_copy": 0,
"oldfieldname": "other_charges_added",
"oldfieldtype": "Currency",
@@ -397,7 +406,7 @@
"doctype": "DocField",
"fieldname": "other_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted",
"label": "Taxes and Charges Deducted (Company Currency)",
"no_copy": 0,
"oldfieldname": "other_charges_deducted",
"oldfieldtype": "Currency",
@@ -409,7 +418,7 @@
"doctype": "DocField",
"fieldname": "total_tax",
"fieldtype": "Currency",
"label": "Total Tax*",
"label": "Total Tax (Company Currency)",
"no_copy": 1,
"oldfieldname": "total_tax",
"oldfieldtype": "Currency",
@@ -421,7 +430,7 @@
"doctype": "DocField",
"fieldname": "grand_total",
"fieldtype": "Currency",
"label": "Grand Total",
"label": "Grand Total (Company Currency)",
"no_copy": 1,
"oldfieldname": "grand_total",
"oldfieldtype": "Currency",
@@ -433,7 +442,7 @@
"doctype": "DocField",
"fieldname": "rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total",
"label": "Rounded Total (Company Currency)",
"oldfieldname": "rounded_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -445,7 +454,7 @@
"doctype": "DocField",
"fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
"oldfieldtype": "Data",
"print_hide": 1,
@@ -553,39 +562,11 @@
"options": "\nYes\nNo",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"print_hide": 1,
"read_only": 1,
"report_hide": 0
},
{
"doctype": "DocField",
"fieldname": "column_break_57",
"fieldtype": "Column Break"
},
{
"description": "Select the relevant company name if you have multiple companies",
"doctype": "DocField",
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"print_hide": 1,
"reqd": 1,
"search_index": 1
},
{
"doctype": "DocField",
"fieldname": "fiscal_year",

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-03-07 11:42:56",
"creation": "2013-05-22 12:43:10",
"docstatus": 0,
"modified": "2013-05-22 12:02:28",
"modified": "2013-07-09 12:15:15",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -106,7 +106,7 @@
"doctype": "DocField",
"fieldname": "import_ref_rate",
"fieldtype": "Currency",
"label": "Ref Rate ",
"label": "Price List Rate",
"options": "currency",
"print_hide": 1,
"read_only": 0
@@ -145,7 +145,7 @@
"doctype": "DocField",
"fieldname": "purchase_ref_rate",
"fieldtype": "Currency",
"label": "Ref Rate*",
"label": "Price List Rate (Company Currency)",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 0
@@ -155,7 +155,7 @@
"doctype": "DocField",
"fieldname": "purchase_rate",
"fieldtype": "Currency",
"label": "Rate*",
"label": "Rate (Company Currency)",
"oldfieldname": "purchase_rate",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -170,7 +170,7 @@
"doctype": "DocField",
"fieldname": "amount",
"fieldtype": "Currency",
"label": "Amount*",
"label": "Amount (Company Currency)",
"oldfieldname": "amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",