Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
revant committed Jun 6, 2016
2 parents 4fdaf95 + 52d4993 commit 4e78217
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion kiratplastics_erpnext/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import unicode_literals
__version__ = "1.1.1"
__version__ = "1.1.2"

42 changes: 21 additions & 21 deletions kiratplastics_erpnext/fixtures/custom_field.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"in_list_view": 0,
"insert_after": "kirat_excise_chapter_head",
"label": "Name of Commodity",
"modified": "2016-05-23 19:37:29.679308",
"modified": "2016-06-06 12:17:22.145833",
"name": "Sales Invoice-kirat_excise_chapter_name",
"no_copy": 0,
"options": "kirat_excise_chapter_head.excise_chapter_name",
Expand Down Expand Up @@ -53,7 +53,7 @@
"in_list_view": 0,
"insert_after": "net_total",
"label": "Total Excise Payable",
"modified": "2016-05-23 19:37:35.835194",
"modified": "2016-06-06 12:17:27.809924",
"name": "Sales Invoice-kirat_excise_payable_total",
"no_copy": 0,
"options": "currency",
Expand Down Expand Up @@ -88,7 +88,7 @@
"in_list_view": 0,
"insert_after": "kirat_excise_payable_total",
"label": "Total Amount with Excise",
"modified": "2016-05-23 19:37:36.335930",
"modified": "2016-06-06 12:17:28.305445",
"name": "Sales Invoice-kirat_amount_with_excise_total",
"no_copy": 0,
"options": "currency",
Expand Down Expand Up @@ -123,7 +123,7 @@
"in_list_view": 0,
"insert_after": "kirat_amount_with_excise_total",
"label": "Total Excise Payable (In Words)",
"modified": "2016-05-23 19:37:36.846822",
"modified": "2016-06-06 12:17:28.829856",
"name": "Sales Invoice-kirat_total_excise_payable_in_words",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -298,7 +298,7 @@
"in_list_view": 0,
"insert_after": "title",
"label": "Invoice Type",
"modified": "2016-05-23 19:37:27.234126",
"modified": "2016-06-06 12:17:19.649547",
"name": "Sales Invoice-kirat_invoice_type",
"no_copy": 0,
"options": "Sales Invoice\nSupplementary Invoice\nInvoice for Sample\nChallan\nExport\nJob Work",
Expand Down Expand Up @@ -578,7 +578,7 @@
"in_list_view": 0,
"insert_after": "mode_of_payment",
"label": "Chapter Head",
"modified": "2016-05-23 19:37:29.212878",
"modified": "2016-06-06 12:17:21.648960",
"name": "Sales Invoice-kirat_excise_chapter_head",
"no_copy": 0,
"options": "Excise Chapter",
Expand Down Expand Up @@ -613,7 +613,7 @@
"in_list_view": 0,
"insert_after": "kirat_excise_chapter_rate",
"label": "Mode of Transport",
"modified": "2016-05-23 19:37:30.678401",
"modified": "2016-06-06 12:17:23.215558",
"name": "Sales Invoice-kirat_mode_of_transport",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -648,7 +648,7 @@
"in_list_view": 0,
"insert_after": "kirat_mode_of_transport",
"label": "Motor Vehicle Registration No",
"modified": "2016-05-23 19:37:31.190290",
"modified": "2016-06-06 12:17:23.713243",
"name": "Sales Invoice-kirat_motor_vehicle_registration_no",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -683,7 +683,7 @@
"in_list_view": 0,
"insert_after": "kirat_motor_vehicle_registration_no",
"label": "Approx. Weight",
"modified": "2016-05-23 19:37:31.658154",
"modified": "2016-06-06 12:17:24.191995",
"name": "Sales Invoice-kirat_approx_weight",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -718,7 +718,7 @@
"in_list_view": 0,
"insert_after": "kirat_approx_weight",
"label": "Notification under which concessional duty claimed",
"modified": "2016-05-23 19:37:32.342977",
"modified": "2016-06-06 12:17:24.780616",
"name": "Sales Invoice-kirat_concessional_duty_claim_notif",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -753,7 +753,7 @@
"in_list_view": 0,
"insert_after": "kirat_excise_chapter_name",
"label": "Duty Charged",
"modified": "2016-05-23 19:37:30.200518",
"modified": "2016-06-06 12:17:22.715439",
"name": "Sales Invoice-kirat_excise_chapter_rate",
"no_copy": 0,
"options": "kirat_excise_chapter_head.rate_of_duty",
Expand Down Expand Up @@ -893,7 +893,7 @@
"in_list_view": 0,
"insert_after": "contact_email",
"label": "ECC No.",
"modified": "2016-05-23 19:37:27.711532",
"modified": "2016-06-06 12:17:20.146992",
"name": "Sales Invoice-kirat_cust_ecc_no",
"no_copy": 0,
"options": "customer.kirat_ecc_no",
Expand Down Expand Up @@ -928,7 +928,7 @@
"in_list_view": 0,
"insert_after": "kirat_cust_ecc_no",
"label": "CST/LST No",
"modified": "2016-05-23 19:37:28.222365",
"modified": "2016-06-06 12:17:20.657940",
"name": "Sales Invoice-kirat_cust_cst_lst_no",
"no_copy": 0,
"options": "customer.kirat_cst_lst_no",
Expand Down Expand Up @@ -963,7 +963,7 @@
"in_list_view": 0,
"insert_after": "kirat_cust_cst_lst_no",
"label": "CST/LST Date",
"modified": "2016-05-23 19:37:28.701652",
"modified": "2016-06-06 12:17:21.146641",
"name": "Sales Invoice-kirat_cust_cst_lst_date",
"no_copy": 0,
"options": "customer_cst_lst_date",
Expand Down Expand Up @@ -998,13 +998,13 @@
"in_list_view": 0,
"insert_after": "customer_section",
"label": "kirat_cust_chapter_select_prompt",
"modified": "2016-05-23 19:37:26.679795",
"modified": "2016-06-06 12:17:19.133530",
"name": "Sales Invoice-kirat_cust_chapter_select_prompt",
"no_copy": 0,
"options": "<span class=\"value\" style=\"color: #da261d;\">*Please select Customer and Chapter Head before selecting items.</span>",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": null,
"read_only": 0,
Expand Down Expand Up @@ -1033,7 +1033,7 @@
"in_list_view": 0,
"insert_after": "kirat_concessional_duty_claim_notif",
"label": "Place",
"modified": "2016-05-23 19:37:32.822558",
"modified": "2016-06-06 12:17:25.260463",
"name": "Sales Invoice-kirat_place",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -1068,7 +1068,7 @@
"in_list_view": 0,
"insert_after": "kirat_sec_brk_1",
"label": "Order No",
"modified": "2016-05-23 19:37:33.834185",
"modified": "2016-06-06 12:17:26.258307",
"name": "Sales Invoice-kirat_customer_order_no",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -1103,7 +1103,7 @@
"in_list_view": 0,
"insert_after": "kirat_col_brk_order_no_date",
"label": "Order Date",
"modified": "2016-05-23 19:37:35.324196",
"modified": "2016-06-06 12:17:27.263207",
"name": "Sales Invoice-kirat_customer_order_date",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -1138,7 +1138,7 @@
"in_list_view": 0,
"insert_after": "shipping_address",
"label": "Against Order",
"modified": "2016-05-23 19:37:33.355642",
"modified": "2016-06-06 12:17:25.784526",
"name": "Sales Invoice-kirat_sec_brk_1",
"no_copy": 0,
"options": null,
Expand Down Expand Up @@ -1173,7 +1173,7 @@
"in_list_view": 0,
"insert_after": "kirat_customer_order_no",
"label": "",
"modified": "2016-05-23 19:37:34.807015",
"modified": "2016-06-06 12:17:26.771614",
"name": "Sales Invoice-kirat_col_brk_order_no_date",
"no_copy": 0,
"options": null,
Expand Down
4 changes: 2 additions & 2 deletions kiratplastics_erpnext/fixtures/custom_script.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"docstatus": 0,
"doctype": "Custom Script",
"dt": "Sales Invoice",
"modified": "2016-06-04 16:18:27.657730",
"modified": "2016-06-06 17:47:34.476095",
"name": "Sales Invoice-Client",
"script": "frappe.ui.form.on(\"Sales Invoice Item\", \"rate\", function(frm, cdt, cdn) {\n var sii = locals[cdt][cdn];\n if ((frm.doc.kirat_invoice_type != \"Invoice for Sample\") && (frm.doc.kirat_invoice_type != \"Challan\")) {\n if (sii.rate == 0.0) {\n msgprint(\"Rate cannot be zero for invoices other than Sample and Challan.\");\n }\n }\n});\n\nfrappe.ui.form.on(\"Sales Invoice Item\", \"kirat_excise_price\", function(frm, cdt, cdn) { \n cur_frm.cscript.calculate_item_values();\n refresh_field(\"items\"); //This updates excise duty amount in the dialog when the excise rate is changed.\n});\n\n\n//Toggle readonly for Customer and Chapter Head depending on whether items exist.\nfrappe.ui.form.on(\"Sales Invoice Item\", \"items_add\", function(frm, cdt, cdn) {\n set_customer_readonly(frm);\n set_chapter_head_readonly(frm);\n set_invoice_type_and_series_readonly(frm);\n set_excise_price_readonly(frm);\n});\n\nfrappe.ui.form.on(\"Sales Invoice Item\", \"items_remove\", function(frm) {\n set_customer_readonly(frm);\n set_chapter_head_readonly(frm);\n set_invoice_type_and_series_readonly(frm);\n});\nfrappe.ui.form.on(\"Sales Invoice\", \"refresh\", function(frm) { \n set_excise_chapter_filter(frm);\n make_taxes_unsortable(frm);\n set_item_filter_query(frm);\n set_invoice_type_and_series_readonly(frm);\n set_chapter_head_readonly(frm);\n set_customer_readonly(frm);\n});\n\nfrappe.ui.form.on(\"Sales Invoice\", \"onload\", function(frm) {\n make_taxes_unsortable(frm);\n get_company_account(frm); //Load excise account from settings and keep in global var for *1.\n get_zero_price_list(frm); //Load zero price list name from settings for *2\n});\n\n// Add Excise Row to Taxes and Charges\nfrappe.ui.form.on(\"Sales Invoice\", \"validate\", function(frm) {\n inject_excise_row_and_append_taxes(frm);\n});\n\nfrappe.ui.form.on(\"Sales Invoice\", \"kirat_invoice_type\", function(frm) {\n set_naming_series_and_price_list(frm);\n});\n\nfrappe.ui.form.on(\"Sales Invoice\", \"kirat_excise_chapter_head\", function(frm) {\n frappe.model.with_doc(\"Excise Chapter\", frm.doc.kirat_excise_chapter_head, function() { \n var ec = frappe.model.get_doc(\"Excise Chapter\", frm.doc.kirat_excise_chapter_head);\n frm.set_value(\"kirat_excise_chapter_name\", ec.excise_chapter_name);\n frm.set_value(\"kirat_excise_chapter_rate\", ec.rate_of_duty);\n });\n});\n\nfrappe.ui.form.on(\"Sales Invoice\", \"customer\", function(frm) {\n frappe.model.with_doc(\"Customer\", frm.doc.customer, function() { \n var cu = frappe.model.get_doc(\"Customer\", frm.doc.customer);\n frm.set_value(\"kirat_cust_ecc_no\", cu.kirat_ecc_no);\n frm.set_value(\"kirat_cust_cst_lst_no\", cu.kirat_cst_lst_no);\n frm.set_value(\"kirat_cust_cst_lst_date\", cu.kirat_cst_lst_date);\n set_naming_series_and_price_list(frm);\n });\n});",
"script": "frappe.ui.form.on(\"Sales Invoice Item\", \"rate\", function(frm, cdt, cdn) {\n var sii = locals[cdt][cdn];\n if ((frm.doc.kirat_invoice_type != \"Invoice for Sample\") && (frm.doc.kirat_invoice_type != \"Challan\")) {\n if (sii.rate == 0.0) {\n msgprint(\"Rate cannot be zero for invoices other than Sample and Challan.\");\n }\n }\n});\n\nfrappe.ui.form.on(\"Sales Invoice Item\", \"kirat_excise_price\", function(frm, cdt, cdn) { \n cur_frm.cscript.calculate_item_values();\n refresh_field(\"items\"); //This updates excise duty amount in the dialog when the excise rate is changed.\n});\n\n//Toggle readonly for Customer and Chapter Head depending on whether items exist.\nfrappe.ui.form.on(\"Sales Invoice Item\", \"items_add\", function(frm, cdt, cdn) {\n set_customer_readonly(frm);\n set_chapter_head_readonly(frm);\n set_invoice_type_and_series_readonly(frm);\n set_excise_price_readonly(frm);\n});\n\nfrappe.ui.form.on(\"Sales Invoice Item\", \"items_remove\", function(frm) {\n set_customer_readonly(frm);\n set_chapter_head_readonly(frm);\n set_invoice_type_and_series_readonly(frm);\n});\nfrappe.ui.form.on(\"Sales Invoice\", \"refresh\", function(frm) { \n set_excise_chapter_filter(frm);\n make_taxes_unsortable(frm);\n set_item_filter_query(frm);\n set_invoice_type_and_series_readonly(frm);\n set_chapter_head_readonly(frm);\n set_customer_readonly(frm);\n //set_naming_series_and_price_list(frm);\n});\n\nfrappe.ui.form.on(\"Sales Invoice\", \"onload\", function(frm) {\n make_taxes_unsortable(frm);\n get_company_account(frm); //Load excise account from settings and keep in global var for 1.\n get_zero_price_list(frm); //Load zero price list name from settings for 2\n set_excise_price_readonly(frm);\n});\n\n// Add Excise Row to Taxes and Charges\nfrappe.ui.form.on(\"Sales Invoice\", \"validate\", function(frm) {\n inject_excise_row_and_append_taxes(frm);\n});\n\nfrappe.ui.form.on(\"Sales Invoice\", \"kirat_invoice_type\", function(frm) {\n set_naming_series_and_price_list(frm);\n});\n\nfrappe.ui.form.on(\"Sales Invoice\", \"kirat_excise_chapter_head\", function(frm) {\n frappe.model.with_doc(\"Excise Chapter\", frm.doc.kirat_excise_chapter_head, function() { \n var ec = frappe.model.get_doc(\"Excise Chapter\", frm.doc.kirat_excise_chapter_head);\n frm.set_value(\"kirat_excise_chapter_name\", ec.excise_chapter_name);\n frm.set_value(\"kirat_excise_chapter_rate\", ec.rate_of_duty);\n });\n});\n\nfrappe.ui.form.on(\"Sales Invoice\", \"customer\", function(frm) {\n frappe.model.with_doc(\"Customer\", frm.doc.customer, function() { \n var cu = frappe.model.get_doc(\"Customer\", frm.doc.customer);\n frm.set_value(\"kirat_cust_ecc_no\", cu.kirat_ecc_no);\n frm.set_value(\"kirat_cust_cst_lst_no\", cu.kirat_cst_lst_no);\n frm.set_value(\"kirat_cust_cst_lst_date\", cu.kirat_cst_lst_date);\n //set_naming_series_and_price_list(frm);\n });\n});\n\ncur_frm.cscript.customer = function() {\n var me = this;\n if(this.frm.updating_party_details) return;\n\n erpnext.utils.get_party_details(this.frm,\n \"erpnext.accounts.party.get_party_details\", {\n posting_date: this.frm.doc.posting_date,\n party: this.frm.doc.customer,\n party_type: \"Customer\",\n account: this.frm.doc.debit_to,\n price_list: this.frm.doc.selling_price_list,\n }, function() {\n me.apply_pricing_rule();\n set_naming_series_and_price_list(cur_frm);\n })\n}\n\n//Replaces calculation of item value\ncur_frm.cscript.calculate_item_values = function() { \n var me = this;\n if (!this.discount_amount_applied) {\n $.each(this.frm.doc[\"items\"] || [], function(i, item) {\n frappe.model.round_floats_in(item);\n item.net_rate = item.rate;\n item.amount = flt(item.rate * item.qty, precision(\"amount\", item));\n item.net_amount = item.amount;\n item.item_tax_amount = 0.0;\n calculate_excise_duty_amount(item);\n me.set_in_company_currency(item, [\"price_list_rate\", \"rate\", \"amount\", \"net_rate\", \"net_amount\"]);\n });\n }\n}\n",
"script_type": "Client"
},
{
Expand Down
Loading

0 comments on commit 4e78217

Please sign in to comment.