From e3d2643f2bae41de6a0aea1ad14f3e907e352566 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Wed, 10 Sep 2014 13:07:59 +0530 Subject: [PATCH 1/9] Changes for Recurring PO/PI --- .../purchase_invoice/purchase_invoice.js | 36 +++++++++++++++++ .../purchase_invoice/purchase_invoice.json | 39 ++++++++++++++----- .../purchase_invoice/purchase_invoice.py | 13 ++++++- .../doctype/purchase_order/purchase_order.js | 33 ++++++++++++++++ .../purchase_order/purchase_order.json | 19 +++++++++ .../doctype/purchase_order/purchase_order.py | 11 ++++++ .../purchase_order/test_purchase_order.py | 5 +++ erpnext/controllers/buying_controller.py | 6 ++- 8 files changed, 150 insertions(+), 12 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 49ed12cc24..680c6a0bbd 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -232,6 +232,42 @@ cur_frm.fields_dict['entries'].grid.get_field('project_name').get_query = functi } } +//added by sambhaji + + +cur_frm.cscript.is_recurring = function(doc, dt, dn) { + // set default values for recurring invoices + if(doc.is_recurring) { + var owner_email = doc.owner=="Administrator" + ? frappe.user_info("Administrator").email + : doc.owner; + + doc.notification_email_address = $.map([cstr(owner_email), + cstr(doc.contact_email)], function(v) { return v || null; }).join(", "); + doc.repeat_on_day_of_month = frappe.datetime.str_to_obj(doc.posting_date).getDate(); + } + + refresh_many(["notification_email_address", "repeat_on_day_of_month"]); +} + + +cur_frm.cscript.from_date = function(doc, dt, dn) { + // set to_date + if(doc.from_date) { + var recurring_type_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, + 'Yearly': 12}; + + var months = recurring_type_map[doc.recurring_type]; + if(months) { + var to_date = frappe.datetime.add_months(doc.from_date, + months); + doc.to_date = frappe.datetime.add_days(to_date, -1); + refresh_field('to_date'); + } + } +} + +//end of added by sambhajii cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){ if(doc.select_print_heading){ diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 489bc4648a..dab029f191 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -1,4 +1,5 @@ { + "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", "creation": "2013-05-21 16:16:39", @@ -143,16 +144,34 @@ "search_index": 1 }, { - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Link", - "options": "Purchase Invoice", - "permlevel": 0, - "print_hide": 1, + "allow_on_submit": 1, + "description": "Start date of current invoice's period", + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From", + "no_copy": 1, + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "description": "End date of current invoice's period", + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To", + "no_copy": 1, + "permlevel": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Link", + "options": "Purchase Invoice", + "permlevel": 0, + "print_hide": 1, "read_only": 1 }, { diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 956dacb55f..7d35f41c96 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -4,7 +4,10 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, cstr, flt, formatdate + +from frappe.utils import add_days, cint, cstr, date_diff, formatdate, flt, getdate, nowdate, \ + get_first_day, get_last_day +from frappe.model.naming import make_autoname from frappe import msgprint, _, throw from erpnext.setup.utils import get_company_currency @@ -14,6 +17,8 @@ import frappe.defaults from erpnext.controllers.buying_controller import BuyingController from erpnext.accounts.party import get_party_account, get_due_date +from erpnext.controllers.recurring_document import * + form_grid_templates = { "entries": "templates/form_grid/item_grid.html" } @@ -61,6 +66,7 @@ class PurchaseInvoice(BuyingController): self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", "purchase_receipt_details") self.create_remarks() + validate_recurring_document(self) def create_remarks(self): if not self.remarks: @@ -259,6 +265,11 @@ class PurchaseInvoice(BuyingController): self.update_against_document_in_jv() self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") + convert_to_recurring(self, "RECINV.#####", self.posting_date) + + def on_update_after_submit(self): + validate_recurring_document(self) + convert_to_recurring(self, "RECINV.#####", self.posting_date) def make_gl_entries(self): auto_accounting_for_stock = \ diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 9433ebe20c..071d622cdd 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -205,7 +205,40 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) { cur_frm.email_doc(frappe.boot.notification_settings.purchase_order_message); } } +//added by sambhaji +cur_frm.cscript.is_recurring = function(doc, dt, dn) { + // set default values for recurring orders + if(doc.is_recurring) { + var owner_email = doc.owner=="Administrator" + ? frappe.user_info("Administrator").email + : doc.owner; + + doc.notification_email_address = $.map([cstr(owner_email), + cstr(doc.contact_email)], function(v) { return v || null; }).join(", "); + doc.repeat_on_day_of_month = frappe.datetime.str_to_obj(doc.posting_date).getDate(); + } + + refresh_many(["notification_email_address", "repeat_on_day_of_month"]); +} + +cur_frm.cscript.from_date = function(doc, dt, dn) { + // set to_date + if(doc.from_date) { + var recurring_type_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, + 'Yearly': 12}; + + var months = recurring_type_map[doc.recurring_type]; + if(months) { + var to_date = frappe.datetime.add_months(doc.from_date, + months); + doc.to_date = frappe.datetime.add_days(to_date, -1); + refresh_field('to_date'); + } + } +} + +//end of added by sambhaji cur_frm.cscript.send_sms = function() { frappe.require("assets/erpnext/js/sms_manager.js"); var sms_man = new SMSManager(cur_frm.doc); diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 647823cab6..289567f34c 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -1,4 +1,5 @@ { + "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", "creation": "2013-05-21 16:16:39", @@ -101,6 +102,24 @@ "reqd": 1, "search_index": 1 }, + { + "allow_on_submit": 1, + "description": "Start date of current order's period", + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From", + "no_copy": 1, + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "description": "End date of current order's period", + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To", + "no_copy": 1, + "permlevel": 0 + }, { "fieldname": "amended_from", "fieldtype": "Link", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 6c7c0c6d08..beebf0b1fb 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -6,6 +6,9 @@ import frappe from frappe.utils import cstr, flt from frappe import msgprint, _, throw from frappe.model.mapper import get_mapped_doc + +from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document + from erpnext.controllers.buying_controller import BuyingController form_grid_templates = { @@ -52,6 +55,8 @@ class PurchaseOrder(BuyingController): self.validate_for_subcontracting() self.validate_minimum_order_qty() self.create_raw_materials_supplied("po_raw_material_details") + + validate_recurring_document(self) def validate_with_previous_doc(self): super(PurchaseOrder, self).validate_with_previous_doc(self.tname, { @@ -173,6 +178,8 @@ class PurchaseOrder(BuyingController): purchase_controller.update_last_purchase_rate(self, is_submit = 1) frappe.db.set(self,'status','Submitted') + + convert_to_recurring(self, "SO/REC/.#####", self.transaction_date) def on_cancel(self): pc_obj = frappe.get_doc('Purchase Common') @@ -197,6 +204,10 @@ class PurchaseOrder(BuyingController): def on_update(self): pass +def on_update_after_submit(self): + validate_recurring_document(self) + convert_to_recurring(self, "SO/REC/.#####", self.transaction_date) + def set_missing_values(source, target): target.ignore_pricing_rule = 1 target.run_method("set_missing_values") diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index d1d183a7a1..0c9f912dbb 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -107,6 +107,11 @@ class TestPurchaseOrder(unittest.TestCase): po.get("po_details")[0].qty = 3.4 self.assertRaises(UOMMustBeIntegerError, po.insert) + def test_recurring_order(self): + from erpnext.controllers.tests.test_recurring_document import test_recurring_document + + test_recurring_document(self, test_records) + test_dependencies = ["BOM"] diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 5f418c4df2..a3f59082f6 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -4,7 +4,11 @@ from __future__ import unicode_literals import frappe from frappe import _, msgprint -from frappe.utils import flt, rounded + +from frappe.utils import add_days, cint, cstr, today, date_diff, flt, rounded, getdate, nowdate, \ + get_first_day, get_last_day +from frappe.model.naming import make_autoname + from erpnext.setup.utils import get_company_currency from erpnext.accounts.party import get_party_details From 6b679c45dfc5351a5e74070fb61e42ad65d639d8 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Wed, 10 Sep 2014 13:57:45 +0530 Subject: [PATCH 2/9] Updated purchase_invoice.json and purchase_order.json with some missed out changes --- .../purchase_invoice/purchase_invoice.json | 1463 +++++++++-------- .../purchase_order/purchase_order.json | 112 +- 2 files changed, 894 insertions(+), 681 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index dab029f191..ea3eb8a0a5 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -1,148 +1,147 @@ { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "creation": "2013-05-21 16:16:39", - "docstatus": 0, - "doctype": "DocType", + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-21 16:16:39", + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "fieldname": "supplier_section", - "fieldtype": "Section Break", - "label": "Supplier", - "options": "icon-user", + "fieldname": "supplier_section", + "fieldtype": "Section Break", + "label": "Supplier", + "options": "icon-user", "permlevel": 0 - }, + }, { - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, "width": "50%" - }, + }, { - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "PINV-", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "PINV-", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, "reqd": 1 - }, + }, { - "fieldname": "supplier", - "fieldtype": "Link", - "hidden": 0, - "label": "Supplier", - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "permlevel": 0, - "print_hide": 1, + "fieldname": "supplier", + "fieldtype": "Link", + "hidden": 0, + "label": "Supplier", + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "depends_on": "supplier", - "fieldname": "supplier_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Name", - "oldfieldname": "supplier_name", - "oldfieldtype": "Data", - "permlevel": 0, + "depends_on": "supplier", + "fieldname": "supplier_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Name", + "oldfieldname": "supplier_name", + "oldfieldtype": "Data", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "permlevel": 0, + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "permlevel": 0, + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "contact_mobile", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Mobile No", - "permlevel": 0, + "fieldname": "contact_mobile", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "contact_email", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact Email", - "permlevel": 0, - "print_hide": 1, + "fieldname": "contact_email", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, - "reqd": 0, + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "reqd": 0, "width": "50%" - }, + }, { - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Date", - "no_copy": 0, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 1, + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Date", + "no_copy": 0, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, "search_index": 1 - }, + }, { - "description": "", - "fieldname": "bill_no", - "fieldtype": "Data", - "in_filter": 1, - "label": "Supplier Invoice No", - "oldfieldname": "bill_no", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 0, + "description": "", + "fieldname": "bill_no", + "fieldtype": "Data", + "in_filter": 1, + "label": "Supplier Invoice No", + "oldfieldname": "bill_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, "search_index": 1 - }, + }, { - "fieldname": "bill_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Supplier Invoice Date", - "oldfieldname": "bill_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 0, + "fieldname": "bill_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Supplier Invoice Date", + "oldfieldname": "bill_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, "search_index": 1 - }, + }, { "allow_on_submit": 1, "description": "Start date of current invoice's period", @@ -173,698 +172,808 @@ "permlevel": 0, "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "search_index": 1 - }, + }, { - "fieldname": "currency_price_list", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag", - "permlevel": 0, + "fieldname": "currency_price_list", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "description": "The rate at which Bill Currency is converted into company's base currency", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, + "description": "The rate at which Bill Currency is converted into company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "column_break2", - "fieldtype": "Column Break", - "permlevel": 0, + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "permlevel": 0, - "print_hide": 1, + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "permlevel": 0, - "print_hide": 1, + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "ignore_pricing_rule", - "fieldtype": "Check", - "label": "Ignore Pricing Rule", - "no_copy": 1, - "permlevel": 1, + "fieldname": "ignore_pricing_rule", + "fieldtype": "Check", + "label": "Ignore Pricing Rule", + "no_copy": 1, + "permlevel": 1, "print_hide": 1 - }, + }, { - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "permlevel": 0, + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, "read_only": 0 - }, + }, { - "allow_on_submit": 1, - "fieldname": "entries", - "fieldtype": "Table", - "label": "Entries", - "oldfieldname": "entries", - "oldfieldtype": "Table", - "options": "Purchase Invoice Item", - "permlevel": 0, + "allow_on_submit": 1, + "fieldname": "entries", + "fieldtype": "Table", + "label": "Entries", + "oldfieldname": "entries", + "oldfieldtype": "Table", + "options": "Purchase Invoice Item", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "section_break_26", - "fieldtype": "Section Break", + "fieldname": "section_break_26", + "fieldtype": "Section Break", "permlevel": 0 - }, + }, { - "description": "Will be calculated automatically when you enter the details", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, + "description": "Will be calculated automatically when you enter the details", + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "column_break_28", - "fieldtype": "Column Break", + "fieldname": "column_break_28", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, "read_only": 1 - }, + }, { - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "purchase_other_charges", - "oldfieldtype": "Link", - "options": "Purchase Taxes and Charges Master", - "permlevel": 0, - "print_hide": 1, + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "purchase_other_charges", + "oldfieldtype": "Link", + "options": "Purchase Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges", - "permlevel": 0, + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "permlevel": 0, - "print_hide": 1, + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "other_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "other_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "other_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "other_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "description": "In Words will be visible once you save the Purchase Invoice.", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, + "description": "In Words will be visible once you save the Purchase Invoice.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "column_break8", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "fieldname": "column_break8", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "width": "50%" - }, + }, { - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, "read_only": 1 - }, + }, { - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, "read_only": 1 - }, + }, { - "fieldname": "total_amount_to_pay", - "fieldtype": "Currency", - "hidden": 0, - "label": "Total Amount To Pay", - "no_copy": 1, - "oldfieldname": "total_amount_to_pay", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "total_amount_to_pay", + "fieldtype": "Currency", + "hidden": 0, + "label": "Total Amount To Pay", + "no_copy": 1, + "oldfieldname": "total_amount_to_pay", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "total_advance", - "fieldtype": "Currency", - "label": "Total Advance", - "no_copy": 1, - "oldfieldname": "total_advance", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "total_advance", + "fieldtype": "Currency", + "label": "Total Advance", + "no_copy": 1, + "oldfieldname": "total_advance", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "total_tax", - "fieldtype": "Currency", - "label": "Total Tax (Company Currency)", - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "total_tax", + "fieldtype": "Currency", + "label": "Total Tax (Company Currency)", + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "outstanding_amount", - "fieldtype": "Currency", - "in_filter": 1, - "in_list_view": 1, - "label": "Outstanding Amount", - "no_copy": 1, - "oldfieldname": "outstanding_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "fieldname": "outstanding_amount", + "fieldtype": "Currency", + "in_filter": 1, + "in_list_view": 1, + "label": "Outstanding Amount", + "no_copy": 1, + "oldfieldname": "outstanding_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "search_index": 1 - }, + }, { - "fieldname": "write_off_amount", - "fieldtype": "Currency", - "label": "Write Off Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "write_off_amount", + "fieldtype": "Currency", + "label": "Write Off Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "depends_on": "eval:flt(doc.write_off_amount)!=0", - "fieldname": "write_off_account", - "fieldtype": "Link", - "label": "Write Off Account", - "no_copy": 1, - "options": "Account", - "permlevel": 0, - "print_hide": 1, + "depends_on": "eval:flt(doc.write_off_amount)!=0", + "fieldname": "write_off_account", + "fieldtype": "Link", + "label": "Write Off Account", + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "depends_on": "eval:flt(doc.write_off_amount)!=0", - "fieldname": "write_off_cost_center", - "fieldtype": "Link", - "label": "Write Off Cost Center", - "no_copy": 1, - "options": "Cost Center", - "permlevel": 0, - "print_hide": 1, + "depends_on": "eval:flt(doc.write_off_amount)!=0", + "fieldname": "write_off_cost_center", + "fieldtype": "Link", + "label": "Write Off Cost Center", + "no_copy": 1, + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "against_expense_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Expense Account", - "no_copy": 1, - "oldfieldname": "against_expense_account", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "fieldname": "against_expense_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Expense Account", + "no_copy": 1, + "oldfieldname": "against_expense_account", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "report_hide": 0 - }, + }, { - "fieldname": "fold", - "fieldtype": "Fold", + "fieldname": "fold", + "fieldtype": "Fold", "permlevel": 0 - }, + }, { - "fieldname": "advances", - "fieldtype": "Section Break", - "label": "Advances", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, - "print_hide": 1, + "fieldname": "advances", + "fieldtype": "Section Break", + "label": "Advances", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "get_advances_paid", - "fieldtype": "Button", - "label": "Get Advances Paid", - "oldfieldtype": "Button", - "options": "get_advances", - "permlevel": 0, - "print_hide": 1, + "fieldname": "get_advances_paid", + "fieldtype": "Button", + "label": "Get Advances Paid", + "oldfieldtype": "Button", + "options": "get_advances", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "advance_allocation_details", - "fieldtype": "Table", - "label": "Purchase Invoice Advances", - "no_copy": 1, - "oldfieldname": "advance_allocation_details", - "oldfieldtype": "Table", - "options": "Purchase Invoice Advance", - "permlevel": 0, - "print_hide": 1, + "fieldname": "advance_allocation_details", + "fieldtype": "Table", + "label": "Purchase Invoice Advances", + "no_copy": 1, + "oldfieldname": "advance_allocation_details", + "oldfieldtype": "Table", + "options": "Purchase Invoice Advance", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "options": "icon-legal", + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "options": "icon-legal", "permlevel": 0 - }, + }, { - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "options": "Terms and Conditions", - "permlevel": 0, + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "options": "Terms and Conditions", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions1", + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions1", "permlevel": 0 - }, + }, { - "depends_on": "supplier", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn", - "permlevel": 0, + "depends_on": "supplier", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "supplier_address", - "fieldtype": "Link", - "label": "Supplier Address", - "options": "Address", - "permlevel": 0, - "print_hide": 1, + "fieldname": "supplier_address", + "fieldtype": "Link", + "label": "Supplier Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "col_break23", - "fieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, + "fieldname": "col_break23", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, "width": "50%" - }, + }, { - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "permlevel": 0, - "print_hide": 1, + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "permlevel": 0, - "print_hide": 1, + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "description": "Supplier (Payable) Account", - "fieldname": "credit_to", - "fieldtype": "Link", - "in_filter": 1, - "label": "Credit To", - "oldfieldname": "credit_to", - "oldfieldtype": "Link", - "options": "Account", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 1, + "description": "Supplier (Payable) Account", + "fieldname": "credit_to", + "fieldtype": "Link", + "in_filter": 1, + "label": "Credit To", + "oldfieldname": "credit_to", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, "search_index": 1 - }, + }, { - "default": "No", - "description": "Considered as Opening Balance", - "fieldname": "is_opening", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Opening", - "oldfieldname": "is_opening", - "oldfieldtype": "Select", - "options": "No\nYes", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "default": "No", + "description": "Considered as Opening Balance", + "fieldname": "is_opening", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Opening", + "oldfieldname": "is_opening", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "search_index": 1 - }, + }, { - "description": "Actual Invoice Date", - "fieldname": "aging_date", - "fieldtype": "Date", - "label": "Aging Date", - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "description": "Actual Invoice Date", + "fieldname": "aging_date", + "fieldtype": "Date", + "label": "Aging Date", + "oldfieldname": "aging_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "search_index": 0 - }, + }, { - "allow_on_submit": 1, - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "report_hide": 1 - }, + }, { - "fieldname": "due_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Due Date", - "no_copy": 0, - "oldfieldname": "due_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "fieldname": "due_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Due Date", + "no_copy": 0, + "oldfieldname": "due_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "search_index": 1 - }, + }, { - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "label": "Mode of Payment", - "oldfieldname": "mode_of_payment", - "oldfieldtype": "Select", - "options": "Mode of Payment", - "permlevel": 0, + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "oldfieldname": "mode_of_payment", + "oldfieldtype": "Select", + "options": "Mode of Payment", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "column_break_63", - "fieldtype": "Column Break", - "permlevel": 0, + "fieldname": "column_break_63", + "fieldtype": "Column Break", + "permlevel": 0, "read_only": 0 - }, + }, { - "allow_on_submit": 1, - "fieldname": "letter_head", - "fieldtype": "Link", - "label": "Letter Head", - "options": "Letter Head", - "permlevel": 0, + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "options": "Letter Head", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "fiscal_year", - "fieldtype": "Link", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "Fiscal Year", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "fieldname": "fiscal_year", + "fieldtype": "Link", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "search_index": 1 - }, + }, { - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "reqd": 0 + }, + { + "depends_on": "eval:doc.docstatus<2", + "fieldname": "recurring_invoice", + "fieldtype": "Section Break", + "label": "Recurring Invoice", + "options": "icon-time", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break_77", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.docstatus<2", + "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date", + "fieldname": "is_recurring", + "fieldtype": "Check", + "label": "Is Recurring", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "description": "Select the period when the invoice will be generated automatically", + "fieldname": "recurring_type", + "fieldtype": "Select", + "label": "Recurring Type", + "no_copy": 1, + "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc", + "fieldname": "repeat_on_day_of_month", + "fieldtype": "Int", + "label": "Repeat on Day of Month", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which next invoice will be generated. It is generated on submit.", + "fieldname": "next_date", + "fieldtype": "Date", + "label": "Next Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_82", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which recurring invoice will be stop", + "fieldname": "end_date", + "fieldtype": "Date", + "label": "End Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:doc.is_recurring==1", + "description": "The unique id for tracking all recurring invoices. It is generated on submit.", + "fieldname": "recurring_id", + "fieldtype": "Data", + "label": "Recurring Id", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date", + "fieldname": "notification_email_address", + "fieldtype": "Small Text", + "label": "Notification Email Address", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "against_income_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Income Account", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 } - ], - "icon": "icon-file-text", - "idx": 1, - "is_submittable": 1, - "modified": "2014-08-19 12:01:12.133942", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Purchase Invoice", - "owner": "Administrator", + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-09-10 12:26:59.555710", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Invoice", + "owner": "Administrator", "permissions": [ { - "amend": 1, - "apply_user_permissions": 1, - "cancel": 1, - "create": 1, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts User", - "submit": 1, + "amend": 1, + "apply_user_permissions": 1, + "cancel": 1, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 1, "write": 1 - }, + }, { - "amend": 0, - "apply_user_permissions": 1, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Purchase User", - "submit": 0, + "amend": 0, + "apply_user_permissions": 1, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0, "write": 0 - }, + }, { - "amend": 0, - "apply_user_permissions": 1, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Supplier", - "submit": 0, + "amend": 0, + "apply_user_permissions": 1, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Supplier", + "submit": 0, "write": 0 - }, + }, { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "submit": 1, + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 1, "write": 1 - }, + }, { - "amend": 0, - "apply_user_permissions": 1, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Auditor", - "submit": 0, + "amend": 0, + "apply_user_permissions": 1, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Auditor", + "submit": 0, "write": 0 - }, + }, { - "permlevel": 1, - "read": 1, - "role": "Accounts Manager", + "permlevel": 1, + "read": 1, + "role": "Accounts Manager", "write": 1 } - ], - "read_only_onload": 1, - "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount", - "sort_field": "modified", + ], + "read_only_onload": 1, + "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount", + "sort_field": "modified", "sort_order": "DESC" } diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 289567f34c..5d36c5cb40 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -1,6 +1,5 @@ { - "allow_attach": 1, - "allow_import": 1, + "allow_import": 1, "autoname": "naming_series:", "creation": "2013-05-21 16:16:39", "docstatus": 0, @@ -663,12 +662,117 @@ "permlevel": 0, "print_hide": 1, "read_only": 1 + }, + { + "fieldname": "recurring_order", + "fieldtype": "Section Break", + "label": "Recurring Order", + "options": "icon-time", + "permlevel": 0 + }, + { + "fieldname": "column_break", + "fieldtype": "Column Break", + "label": "Column Break", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.docstatus<2", + "description": "Check if recurring order, uncheck to stop recurring or put proper End Date", + "fieldname": "is_recurring", + "fieldtype": "Check", + "label": "Is Recurring", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "fieldname": "recurring_type", + "fieldtype": "Select", + "label": "Recurring Type", + "no_copy": 1, + "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The day of the month on which auto order will be generated e.g. 05, 28 etc", + "fieldname": "repeat_on_day_of_month", + "fieldtype": "Int", + "label": "Repeat on Day of Month", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which next invoice will be generated. It is generated on submit.", + "fieldname": "next_date", + "fieldtype": "Date", + "label": "Next Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which recurring order will be stop", + "fieldname": "end_date", + "fieldtype": "Date", + "label": "End Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break83", + "fieldtype": "Column Break", + "label": "Column Break", + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:doc.is_recurring==1", + "fieldname": "recurring_id", + "fieldtype": "Data", + "label": "Recurring Id", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "Enter email id separated by commas, order will be mailed automatically on particular date", + "fieldname": "notification_email_address", + "fieldtype": "Small Text", + "label": "Notification Email Address", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "against_income_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Income Account", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 } ], "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-08-12 05:22:53.496614", + "modified": "2014-09-10 13:23:02.825233", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", @@ -740,4 +844,4 @@ "search_fields": "status, transaction_date, supplier,grand_total", "sort_field": "modified", "sort_order": "DESC" -} \ No newline at end of file +} From b2a3f2d386b6f8b679612269762adb8f0b3e8f83 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Wed, 10 Sep 2014 17:40:48 +0530 Subject: [PATCH 3/9] some minor changes get fixed for PO/PI --- .../doctype/purchase_invoice/purchase_invoice.js | 3 +-- .../doctype/purchase_invoice/purchase_invoice.json | 1 + .../doctype/purchase_invoice/purchase_invoice.py | 4 ++-- .../doctype/purchase_order/purchase_order.js | 4 ++-- .../doctype/purchase_order/purchase_order.py | 6 +++--- .../controllers/tests/test_recurring_document.py | 14 ++++++++++++++ 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 680c6a0bbd..90f463a38d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -232,7 +232,6 @@ cur_frm.fields_dict['entries'].grid.get_field('project_name').get_query = functi } } -//added by sambhaji cur_frm.cscript.is_recurring = function(doc, dt, dn) { @@ -267,7 +266,7 @@ cur_frm.cscript.from_date = function(doc, dt, dn) { } } -//end of added by sambhajii + cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){ if(doc.select_print_heading){ diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index ea3eb8a0a5..e29d3d91d7 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -800,6 +800,7 @@ }, { "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", "description": "Select the period when the invoice will be generated automatically", "fieldname": "recurring_type", "fieldtype": "Select", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 7d35f41c96..77c7ea97d1 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -265,11 +265,11 @@ class PurchaseInvoice(BuyingController): self.update_against_document_in_jv() self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") - convert_to_recurring(self, "RECINV.#####", self.posting_date) + convert_to_recurring(self, "RECPI.#####", self.posting_date) def on_update_after_submit(self): validate_recurring_document(self) - convert_to_recurring(self, "RECINV.#####", self.posting_date) + convert_to_recurring(self, "RECPI.#####", self.posting_date) def make_gl_entries(self): auto_accounting_for_stock = \ diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 071d622cdd..549584500f 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -205,7 +205,7 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) { cur_frm.email_doc(frappe.boot.notification_settings.purchase_order_message); } } -//added by sambhaji + cur_frm.cscript.is_recurring = function(doc, dt, dn) { // set default values for recurring orders @@ -238,7 +238,7 @@ cur_frm.cscript.from_date = function(doc, dt, dn) { } } -//end of added by sambhaji + cur_frm.cscript.send_sms = function() { frappe.require("assets/erpnext/js/sms_manager.js"); var sms_man = new SMSManager(cur_frm.doc); diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index beebf0b1fb..66083be53b 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -179,7 +179,7 @@ class PurchaseOrder(BuyingController): frappe.db.set(self,'status','Submitted') - convert_to_recurring(self, "SO/REC/.#####", self.transaction_date) + convert_to_recurring(self, "SO/REP/.#####", self.transaction_date) def on_cancel(self): pc_obj = frappe.get_doc('Purchase Common') @@ -204,9 +204,9 @@ class PurchaseOrder(BuyingController): def on_update(self): pass -def on_update_after_submit(self): + def on_update_after_submit(self): validate_recurring_document(self) - convert_to_recurring(self, "SO/REC/.#####", self.transaction_date) + convert_to_recurring(self, "SO/REP/.#####", self.transaction_date) def set_missing_values(source, target): target.ignore_pricing_rule = 1 diff --git a/erpnext/controllers/tests/test_recurring_document.py b/erpnext/controllers/tests/test_recurring_document.py index 0e7cb1bc5e..1051082488 100644 --- a/erpnext/controllers/tests/test_recurring_document.py +++ b/erpnext/controllers/tests/test_recurring_document.py @@ -41,6 +41,20 @@ def test_recurring_document(obj, test_records): date_field = "transaction_date" elif base_doc.doctype == "Sales Invoice": date_field = "posting_date" + #for Purchase order/purchase invoice + if base_doc.doctype == "Purchase Order": + base_doc.update({ + "transaction_date": today + }) + elif base_doc.doctype == "Purchase Invoice": + base_doc.update({ + "posting_date": today + }) + + if base_doc.doctype == "Purchase Order": + date_field = "transaction_date" + elif base_doc.doctype == "Purchase Invoice": + date_field = "posting_date" # monthly doc1 = frappe.copy_doc(base_doc) From b14401c320503f1e8273f29a53b80ac618e6a107 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Thu, 11 Sep 2014 16:09:05 +0530 Subject: [PATCH 4/9] change convert_to_recurring() to take recurring_id dynamicaly --- .../purchase_invoice/purchase_invoice.py | 4 +-- .../doctype/sales_invoice/sales_invoice.py | 4 +-- .../doctype/purchase_order/purchase_order.py | 4 +-- erpnext/controllers/recurring_document.py | 29 +++++++++++-------- .../doctype/sales_order/sales_order.py | 4 +-- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 77c7ea97d1..6a41bbab39 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -265,11 +265,11 @@ class PurchaseInvoice(BuyingController): self.update_against_document_in_jv() self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") - convert_to_recurring(self, "RECPI.#####", self.posting_date) + convert_to_recurring(self, self.posting_date) def on_update_after_submit(self): validate_recurring_document(self) - convert_to_recurring(self, "RECPI.#####", self.posting_date) + convert_to_recurring(self, self.posting_date) def make_gl_entries(self): auto_accounting_for_stock = \ diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index a20d906b8c..dc38c9a8d8 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -103,7 +103,7 @@ class SalesInvoice(SellingController): self.update_c_form() self.update_time_log_batch(self.name) - convert_to_recurring(self, "RECINV.#####", self.posting_date) + convert_to_recurring(self, self.posting_date) def before_cancel(self): self.update_time_log_batch(None) @@ -145,7 +145,7 @@ class SalesInvoice(SellingController): def on_update_after_submit(self): validate_recurring_document(self) - convert_to_recurring(self, "RECINV.#####", self.posting_date) + convert_to_recurring(self, self.posting_date) def get_portal_page(self): return "invoice" if self.docstatus==1 else None diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 66083be53b..a8a9d0da2f 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -179,7 +179,7 @@ class PurchaseOrder(BuyingController): frappe.db.set(self,'status','Submitted') - convert_to_recurring(self, "SO/REP/.#####", self.transaction_date) + convert_to_recurring(self, self.transaction_date) def on_cancel(self): pc_obj = frappe.get_doc('Purchase Common') @@ -206,7 +206,7 @@ class PurchaseOrder(BuyingController): def on_update_after_submit(self): validate_recurring_document(self) - convert_to_recurring(self, "SO/REP/.#####", self.transaction_date) + convert_to_recurring(self, self.transaction_date) def set_missing_values(source, target): target.ignore_pricing_rule = 1 diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py index c7163ae3f8..7b4310bada 100644 --- a/erpnext/controllers/recurring_document.py +++ b/erpnext/controllers/recurring_document.py @@ -2,9 +2,14 @@ from __future__ import unicode_literals import frappe import frappe.utils import frappe.defaults -from frappe.utils import cint, cstr, getdate, nowdate, get_first_day, get_last_day + +from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, \ + get_first_day, get_last_day, comma_and from frappe.model.naming import make_autoname + from frappe import _, msgprint, throw +from erpnext.accounts.party import get_party_account, get_due_date, get_party_details +from frappe.model.mapper import get_mapped_doc month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} @@ -46,7 +51,7 @@ def manage_recurring_documents(doctype, next_date=None, commit=True): frappe.db.begin() frappe.db.sql("update `tab%s` \ - set is_recurring = 0 where name = %s" % (doctype, '%s'), + set is_recurring = 0 where name = %s" % (doctype, '%s'), (ref_document)) notify_errors(ref_document, doctype, ref_wrapper.customer, ref_wrapper.owner) frappe.db.commit() @@ -152,18 +157,18 @@ def validate_recurring_document(doc): elif not (doc.from_date and doc.to_date): throw(_("Period From and Period To dates mandatory for recurring %s") % doc.doctype) -def convert_to_recurring(doc, autoname, posting_date): - if doc.is_recurring: - if not doc.recurring_id: - frappe.db.set(doc, "recurring_id", - make_autoname(autoname)) +# +def convert_to_recurring(doc, posting_date): + if doc.is_recurring: + if not doc.recurring_id: + frappe.db.set(doc, "recurring_id", doc.name) - set_next_date(doc, posting_date) + set_next_date(doc, posting_date) - elif doc.recurring_id: - frappe.db.sql("""update `tab%s` - set is_recurring = 0 - where recurring_id = %s""" % (doc.doctype, '%s'), (doc.recurring_id)) + elif doc.recurring_id: + frappe.db.sql("""update `tab%s` set is_recurring = 0 + where recurring_id = %s""" % (doc.doctype, '%s'), (doc.recurring_id)) +# def validate_notification_email_id(doc): if doc.notification_email_address: diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index ff14f9d0c1..b1852f115c 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -166,7 +166,7 @@ class SalesOrder(SellingController): self.update_prevdoc_status('submit') frappe.db.set(self, 'status', 'Submitted') - convert_to_recurring(self, "SO/REC/.#####", self.transaction_date) + convert_to_recurring(self, self.transaction_date) def on_cancel(self): # Cannot cancel stopped SO @@ -257,7 +257,7 @@ class SalesOrder(SellingController): def on_update_after_submit(self): validate_recurring_document(self) - convert_to_recurring(self, "SO/REC/.#####", self.transaction_date) + convert_to_recurring(self, self.transaction_date) @frappe.whitelist() From 4d3a18890ba395f4eceb81f314ca781b05e37a98 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Mon, 15 Sep 2014 12:20:11 +0530 Subject: [PATCH 5/9] fix conflict --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json | 2 +- erpnext/buying/doctype/purchase_order/purchase_order.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index e29d3d91d7..bb393a54df 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -886,7 +886,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-09-10 12:26:59.555710", + "modified": "2014-09-09 05:35:32.156763", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 5d36c5cb40..f16a548793 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -772,7 +772,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-09-10 13:23:02.825233", + "modified": "2014-09-10 05:35:32.583024", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", From d14e15d4328f06669e2415cf78e11463d81574d6 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Mon, 15 Sep 2014 12:31:44 +0530 Subject: [PATCH 6/9] fix conflict --- .../purchase_invoice/purchase_invoice.json | 1827 ++++++++--------- .../purchase_order/purchase_order.json | 1576 +++++++------- 2 files changed, 1580 insertions(+), 1823 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index bb393a54df..43cb633cee 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -1,980 +1,851 @@ { - "allow_import": 1, - "autoname": "naming_series:", - "creation": "2013-05-21 16:16:39", - "docstatus": 0, - "doctype": "DocType", - "fields": [ - { - "fieldname": "supplier_section", - "fieldtype": "Section Break", - "label": "Supplier", - "options": "icon-user", - "permlevel": 0 - }, - { - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, - "width": "50%" - }, - { - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "PINV-", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1 - }, - { - "fieldname": "supplier", - "fieldtype": "Link", - "hidden": 0, - "label": "Supplier", - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "supplier", - "fieldname": "supplier_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Name", - "oldfieldname": "supplier_name", - "oldfieldtype": "Data", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "contact_mobile", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Mobile No", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "contact_email", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact Email", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, - "reqd": 0, - "width": "50%" - }, - { - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Date", - "no_copy": 0, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "description": "", - "fieldname": "bill_no", - "fieldtype": "Data", - "in_filter": 1, - "label": "Supplier Invoice No", - "oldfieldname": "bill_no", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "fieldname": "bill_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Supplier Invoice Date", - "oldfieldname": "bill_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "allow_on_submit": 1, - "description": "Start date of current invoice's period", - "fieldname": "from_date", - "fieldtype": "Date", - "label": "From", - "no_copy": 1, - "permlevel": 0 - }, - { - "allow_on_submit": 1, - "description": "End date of current invoice's period", - "fieldname": "to_date", - "fieldtype": "Date", - "label": "To", - "no_copy": 1, - "permlevel": 0 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Link", - "options": "Purchase Invoice", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "fieldname": "currency_price_list", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag", - "permlevel": 0, - "read_only": 0 - }, - { - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "description": "The rate at which Bill Currency is converted into company's base currency", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "column_break2", - "fieldtype": "Column Break", - "permlevel": 0, - "read_only": 0 - }, - { - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "ignore_pricing_rule", - "fieldtype": "Check", - "label": "Ignore Pricing Rule", - "no_copy": 1, - "permlevel": 1, - "print_hide": 1 - }, - { - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "permlevel": 0, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "fieldname": "entries", - "fieldtype": "Table", - "label": "Entries", - "oldfieldname": "entries", - "oldfieldtype": "Table", - "options": "Purchase Invoice Item", - "permlevel": 0, - "read_only": 0 - }, - { - "fieldname": "section_break_26", - "fieldtype": "Section Break", - "permlevel": 0 - }, - { - "description": "Will be calculated automatically when you enter the details", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break_28", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, - "read_only": 0 - }, - { - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "purchase_other_charges", - "oldfieldtype": "Link", - "options": "Purchase Taxes and Charges Master", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges", - "permlevel": 0, - "read_only": 0 - }, - { - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, - "read_only": 0 - }, - { - "fieldname": "other_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "other_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "description": "In Words will be visible once you save the Purchase Invoice.", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break8", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "total_amount_to_pay", - "fieldtype": "Currency", - "hidden": 0, - "label": "Total Amount To Pay", - "no_copy": 1, - "oldfieldname": "total_amount_to_pay", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "total_advance", - "fieldtype": "Currency", - "label": "Total Advance", - "no_copy": 1, - "oldfieldname": "total_advance", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "total_tax", - "fieldtype": "Currency", - "label": "Total Tax (Company Currency)", - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "outstanding_amount", - "fieldtype": "Currency", - "in_filter": 1, - "in_list_view": 1, - "label": "Outstanding Amount", - "no_copy": 1, - "oldfieldname": "outstanding_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "fieldname": "write_off_amount", - "fieldtype": "Currency", - "label": "Write Off Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "eval:flt(doc.write_off_amount)!=0", - "fieldname": "write_off_account", - "fieldtype": "Link", - "label": "Write Off Account", - "no_copy": 1, - "options": "Account", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "eval:flt(doc.write_off_amount)!=0", - "fieldname": "write_off_cost_center", - "fieldtype": "Link", - "label": "Write Off Cost Center", - "no_copy": 1, - "options": "Cost Center", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "against_expense_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Expense Account", - "no_copy": 1, - "oldfieldname": "against_expense_account", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0 - }, - { - "fieldname": "fold", - "fieldtype": "Fold", - "permlevel": 0 - }, - { - "fieldname": "advances", - "fieldtype": "Section Break", - "label": "Advances", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "get_advances_paid", - "fieldtype": "Button", - "label": "Get Advances Paid", - "oldfieldtype": "Button", - "options": "get_advances", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "advance_allocation_details", - "fieldtype": "Table", - "label": "Purchase Invoice Advances", - "no_copy": 1, - "oldfieldname": "advance_allocation_details", - "oldfieldtype": "Table", - "options": "Purchase Invoice Advance", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "options": "icon-legal", - "permlevel": 0 - }, - { - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "options": "Terms and Conditions", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions1", - "permlevel": 0 - }, - { - "depends_on": "supplier", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn", - "permlevel": 0, - "read_only": 0 - }, - { - "fieldname": "supplier_address", - "fieldtype": "Link", - "label": "Supplier Address", - "options": "Address", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "col_break23", - "fieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, - "width": "50%" - }, - { - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "description": "Supplier (Payable) Account", - "fieldname": "credit_to", - "fieldtype": "Link", - "in_filter": 1, - "label": "Credit To", - "oldfieldname": "credit_to", - "oldfieldtype": "Link", - "options": "Account", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "default": "No", - "description": "Considered as Opening Balance", - "fieldname": "is_opening", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Opening", - "oldfieldname": "is_opening", - "oldfieldtype": "Select", - "options": "No\nYes", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "description": "Actual Invoice Date", - "fieldname": "aging_date", - "fieldtype": "Date", - "label": "Aging Date", - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "search_index": 0 - }, - { - "allow_on_submit": 1, - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "fieldname": "due_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Due Date", - "no_copy": 0, - "oldfieldname": "due_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "label": "Mode of Payment", - "oldfieldname": "mode_of_payment", - "oldfieldtype": "Select", - "options": "Mode of Payment", - "permlevel": 0, - "read_only": 0 - }, - { - "fieldname": "column_break_63", - "fieldtype": "Column Break", - "permlevel": 0, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "fieldname": "letter_head", - "fieldtype": "Link", - "label": "Letter Head", - "options": "Letter Head", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "fiscal_year", - "fieldtype": "Link", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "Fiscal Year", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "depends_on": "eval:doc.docstatus<2", - "fieldname": "recurring_invoice", - "fieldtype": "Section Break", - "label": "Recurring Invoice", - "options": "icon-time", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "column_break_77", - "fieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "width": "50%" - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.docstatus<2", - "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date", - "fieldname": "is_recurring", - "fieldtype": "Check", - "label": "Is Recurring", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "Select the period when the invoice will be generated automatically", - "fieldname": "recurring_type", - "fieldtype": "Select", - "label": "Recurring Type", - "no_copy": 1, - "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", - "permlevel": 0, - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc", - "fieldname": "repeat_on_day_of_month", - "fieldtype": "Int", - "label": "Repeat on Day of Month", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1 - }, - { - "depends_on": "eval:doc.is_recurring==1", - "description": "The date on which next invoice will be generated. It is generated on submit.", - "fieldname": "next_date", - "fieldtype": "Date", - "label": "Next Date", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break_82", - "fieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "width": "50%" - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "The date on which recurring invoice will be stop", - "fieldname": "end_date", - "fieldtype": "Date", - "label": "End Date", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1 - }, - { - "depends_on": "eval:doc.is_recurring==1", - "description": "The unique id for tracking all recurring invoices. It is generated on submit.", - "fieldname": "recurring_id", - "fieldtype": "Data", - "label": "Recurring Id", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date", - "fieldname": "notification_email_address", - "fieldtype": "Small Text", - "label": "Notification Email Address", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "against_income_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Income Account", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "report_hide": 1 - } - ], - "icon": "icon-file-text", - "idx": 1, - "is_submittable": 1, - "modified": "2014-09-09 05:35:32.156763", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Purchase Invoice", - "owner": "Administrator", - "permissions": [ - { - "amend": 1, - "apply_user_permissions": 1, - "cancel": 1, - "create": 1, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts User", - "submit": 1, - "write": 1 - }, - { - "amend": 0, - "apply_user_permissions": 1, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Purchase User", - "submit": 0, - "write": 0 - }, - { - "amend": 0, - "apply_user_permissions": 1, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Supplier", - "submit": 0, - "write": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 0, - "apply_user_permissions": 1, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Auditor", - "submit": 0, - "write": 0 - }, - { - "permlevel": 1, - "read": 1, - "role": "Accounts Manager", - "write": 1 - } - ], - "read_only_onload": 1, - "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount", - "sort_field": "modified", - "sort_order": "DESC" +"allow_import": 1, +"autoname": "naming_series:", +"creation": "2013-05-21 16:16:39", +"docstatus": 0, +"doctype": "DocType", +"fields": [ +{ +"fieldname": "supplier_section", +"fieldtype": "Section Break", +"label": "Supplier", +"options": "icon-user", +"permlevel": 0 +}, +{ +"fieldname": "column_break0", +"fieldtype": "Column Break", +"oldfieldtype": "Column Break", +"permlevel": 0, +"read_only": 0, +"width": "50%" +}, +{ +"fieldname": "naming_series", +"fieldtype": "Select", +"label": "Series", +"no_copy": 1, +"oldfieldname": "naming_series", +"oldfieldtype": "Select", +"options": "PINV-", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"report_hide": 0, +"reqd": 1 +}, +{ +"fieldname": "supplier", +"fieldtype": "Link", +"hidden": 0, +"label": "Supplier", +"oldfieldname": "supplier", +"oldfieldtype": "Link", +"options": "Supplier", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"depends_on": "supplier", +"fieldname": "supplier_name", +"fieldtype": "Data", +"hidden": 0, +"in_list_view": 1, +"label": "Name", +"oldfieldname": "supplier_name", +"oldfieldtype": "Data", +"permlevel": 0, +"read_only": 1 +}, +{ +"fieldname": "address_display", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Address", +"permlevel": 0, +"read_only": 1 +}, +{ +"fieldname": "contact_display", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Contact", +"permlevel": 0, +"read_only": 1 +}, +{ +"fieldname": "contact_mobile", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Mobile No", +"permlevel": 0, +"read_only": 1 +}, +{ +"fieldname": "contact_email", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Contact Email", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "column_break1", +"fieldtype": "Column Break", +"oldfieldtype": "Column Break", +"permlevel": 0, +"read_only": 0, +"reqd": 0, +"width": "50%" +}, +{ +"default": "Today", +"fieldname": "posting_date", +"fieldtype": "Date", +"in_filter": 1, +"label": "Date", +"no_copy": 0, +"oldfieldname": "posting_date", +"oldfieldtype": "Date", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"reqd": 1, +"search_index": 1 +}, +{ +"description": "", +"fieldname": "bill_no", +"fieldtype": "Data", +"in_filter": 1, +"label": "Supplier Invoice No", +"oldfieldname": "bill_no", +"oldfieldtype": "Data", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"reqd": 0, +"search_index": 1 +}, +{ +"fieldname": "bill_date", +"fieldtype": "Date", +"in_filter": 1, +"label": "Supplier Invoice Date", +"oldfieldname": "bill_date", +"oldfieldtype": "Date", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"reqd": 0, +"search_index": 1 +}, +{ +"fieldname": "amended_from", +"fieldtype": "Link", +"ignore_user_permissions": 1, +"label": "Amended From", +"no_copy": 1, +"oldfieldname": "amended_from", +"oldfieldtype": "Link", +"options": "Purchase Invoice", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "company", +"fieldtype": "Link", +"in_filter": 1, +"label": "Company", +"oldfieldname": "company", +"oldfieldtype": "Link", +"options": "Company", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"search_index": 1 +}, +{ +"fieldname": "currency_price_list", +"fieldtype": "Section Break", +"label": "Currency and Price List", +"options": "icon-tag", +"permlevel": 0, +"read_only": 0 +}, +{ +"fieldname": "currency", +"fieldtype": "Link", +"label": "Currency", +"oldfieldname": "currency", +"oldfieldtype": "Select", +"options": "Currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"description": "The rate at which Bill Currency is converted into company's base currency", +"fieldname": "conversion_rate", +"fieldtype": "Float", +"label": "Exchange Rate", +"oldfieldname": "conversion_rate", +"oldfieldtype": "Currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "column_break2", +"fieldtype": "Column Break", +"permlevel": 0, +"read_only": 0 +}, +{ +"fieldname": "buying_price_list", +"fieldtype": "Link", +"label": "Price List", +"options": "Price List", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "price_list_currency", +"fieldtype": "Link", +"label": "Price List Currency", +"options": "Currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "plc_conversion_rate", +"fieldtype": "Float", +"label": "Price List Exchange Rate", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "ignore_pricing_rule", +"fieldtype": "Check", +"label": "Ignore Pricing Rule", +"no_copy": 1, +"permlevel": 1, +"print_hide": 1 +}, +{ +"fieldname": "items", +"fieldtype": "Section Break", +"label": "Items", +"oldfieldtype": "Section Break", +"options": "icon-shopping-cart", +"permlevel": 0, +"read_only": 0 +}, +{ +"allow_on_submit": 1, +"fieldname": "entries", +"fieldtype": "Table", +"label": "Entries", +"oldfieldname": "entries", +"oldfieldtype": "Table", +"options": "Purchase Invoice Item", +"permlevel": 0, +"read_only": 0 +}, +{ +"fieldname": "section_break_26", +"fieldtype": "Section Break", +"permlevel": 0 +}, +{ +"description": "Will be calculated automatically when you enter the details", +"fieldname": "net_total", +"fieldtype": "Currency", +"label": "Net Total (Company Currency)", +"oldfieldname": "net_total", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "column_break_28", +"fieldtype": "Column Break", +"permlevel": 0 +}, +{ +"fieldname": "net_total_import", +"fieldtype": "Currency", +"label": "Net Total", +"oldfieldname": "net_total_import", +"oldfieldtype": "Currency", +"options": "currency", +"permlevel": 0, +"print_hide": 0, +"read_only": 1 +}, +{ +"fieldname": "taxes", +"fieldtype": "Section Break", +"label": "Taxes and Charges", +"oldfieldtype": "Section Break", +"options": "icon-money", +"permlevel": 0, +"read_only": 0 +}, +{ +"fieldname": "taxes_and_charges", +"fieldtype": "Link", +"label": "Taxes and Charges", +"oldfieldname": "purchase_other_charges", +"oldfieldtype": "Link", +"options": "Purchase Taxes and Charges Master", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "other_charges", +"fieldtype": "Table", +"label": "Purchase Taxes and Charges", +"oldfieldname": "purchase_tax_details", +"oldfieldtype": "Table", +"options": "Purchase Taxes and Charges", +"permlevel": 0, +"read_only": 0 +}, +{ +"fieldname": "other_charges_calculation", +"fieldtype": "HTML", +"label": "Taxes and Charges Calculation", +"oldfieldtype": "HTML", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "totals", +"fieldtype": "Section Break", +"label": "Totals", +"oldfieldtype": "Section Break", +"options": "icon-money", +"permlevel": 0, +"read_only": 0 +}, +{ +"fieldname": "other_charges_added", +"fieldtype": "Currency", +"label": "Taxes and Charges Added (Company Currency)", +"oldfieldname": "other_charges_added", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "other_charges_deducted", +"fieldtype": "Currency", +"label": "Taxes and Charges Deducted (Company Currency)", +"oldfieldname": "other_charges_deducted", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "grand_total", +"fieldtype": "Currency", +"label": "Grand Total (Company Currency)", +"oldfieldname": "grand_total", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"description": "In Words will be visible once you save the Purchase Invoice.", +"fieldname": "in_words", +"fieldtype": "Data", +"label": "In Words (Company Currency)", +"oldfieldname": "in_words", +"oldfieldtype": "Data", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "column_break8", +"fieldtype": "Column Break", +"oldfieldtype": "Column Break", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"width": "50%" +}, +{ +"fieldname": "other_charges_added_import", +"fieldtype": "Currency", +"label": "Taxes and Charges Added", +"oldfieldname": "other_charges_added_import", +"oldfieldtype": "Currency", +"options": "currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "other_charges_deducted_import", +"fieldtype": "Currency", +"label": "Taxes and Charges Deducted", +"oldfieldname": "other_charges_deducted_import", +"oldfieldtype": "Currency", +"options": "currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "grand_total_import", +"fieldtype": "Currency", +"in_list_view": 1, +"label": "Grand Total", +"oldfieldname": "grand_total_import", +"oldfieldtype": "Currency", +"options": "currency", +"permlevel": 0, +"print_hide": 0, +"read_only": 1 +}, +{ +"fieldname": "in_words_import", +"fieldtype": "Data", +"label": "In Words", +"oldfieldname": "in_words_import", +"oldfieldtype": "Data", +"permlevel": 0, +"print_hide": 0, +"read_only": 1 +}, +{ +"fieldname": "total_amount_to_pay", +"fieldtype": "Currency", +"hidden": 0, +"label": "Total Amount To Pay", +"no_copy": 1, +"oldfieldname": "total_amount_to_pay", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "total_advance", +"fieldtype": "Currency", +"label": "Total Advance", +"no_copy": 1, +"oldfieldname": "total_advance", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "total_tax", +"fieldtype": "Currency", +"label": "Total Tax (Company Currency)", +"oldfieldname": "total_tax", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "outstanding_amount", +"fieldtype": "Currency", +"in_filter": 1, +"in_list_view": 1, +"label": "Outstanding Amount", +"no_copy": 1, +"oldfieldname": "outstanding_amount", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1, +"search_index": 1 +}, +{ +"fieldname": "write_off_amount", +"fieldtype": "Currency", +"label": "Write Off Amount", +"no_copy": 1, +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"depends_on": "eval:flt(doc.write_off_amount)!=0", +"fieldname": "write_off_account", +"fieldtype": "Link", +"label": "Write Off Account", +"no_copy": 1, +"options": "Account", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"depends_on": "eval:flt(doc.write_off_amount)!=0", +"fieldname": "write_off_cost_center", +"fieldtype": "Link", +"label": "Write Off Cost Center", +"no_copy": 1, +"options": "Cost Center", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "against_expense_account", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Against Expense Account", +"no_copy": 1, +"oldfieldname": "against_expense_account", +"oldfieldtype": "Small Text", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"report_hide": 0 +}, +{ +"fieldname": "fold", +"fieldtype": "Fold", +"permlevel": 0 +}, +{ +"fieldname": "advances", +"fieldtype": "Section Break", +"label": "Advances", +"oldfieldtype": "Section Break", +"options": "icon-money", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "get_advances_paid", +"fieldtype": "Button", +"label": "Get Advances Paid", +"oldfieldtype": "Button", +"options": "get_advances", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "advance_allocation_details", +"fieldtype": "Table", +"label": "Purchase Invoice Advances", +"no_copy": 1, +"oldfieldname": "advance_allocation_details", +"oldfieldtype": "Table", +"options": "Purchase Invoice Advance", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "terms_section_break", +"fieldtype": "Section Break", +"label": "Terms and Conditions", +"options": "icon-legal", +"permlevel": 0 +}, +{ +"fieldname": "tc_name", +"fieldtype": "Link", +"label": "Terms", +"options": "Terms and Conditions", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "terms", +"fieldtype": "Text Editor", +"label": "Terms and Conditions1", +"permlevel": 0 +}, +{ +"depends_on": "supplier", +"fieldname": "contact_section", +"fieldtype": "Section Break", +"label": "Contact Info", +"options": "icon-bullhorn", +"permlevel": 0, +"read_only": 0 +}, +{ +"fieldname": "supplier_address", +"fieldtype": "Link", +"label": "Supplier Address", +"options": "Address", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "col_break23", +"fieldtype": "Column Break", +"permlevel": 0, +"read_only": 0, +"width": "50%" +}, +{ +"fieldname": "contact_person", +"fieldtype": "Link", +"label": "Contact Person", +"options": "Contact", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"fieldname": "more_info", +"fieldtype": "Section Break", +"label": "More Info", +"oldfieldtype": "Section Break", +"options": "icon-file-text", +"permlevel": 0, +"print_hide": 1, +"read_only": 0 +}, +{ +"description": "Supplier (Payable) Account", +"fieldname": "credit_to", +"fieldtype": "Link", +"in_filter": 1, +"label": "Credit To", +"oldfieldname": "credit_to", +"oldfieldtype": "Link", +"options": "Account", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"reqd": 1, +"search_index": 1 +}, +{ +"default": "No", +"description": "Considered as Opening Balance", +"fieldname": "is_opening", +"fieldtype": "Select", +"in_filter": 1, +"label": "Is Opening", +"oldfieldname": "is_opening", +"oldfieldtype": "Select", +"options": "No\nYes", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"search_index": 1 +}, +{ +"description": "Actual Invoice Date", +"fieldname": "aging_date", +"fieldtype": "Date", +"label": "Aging Date", +"oldfieldname": "aging_date", +"oldfieldtype": "Date", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"search_index": 0 +}, +{ +"allow_on_submit": 1, +"fieldname": "select_print_heading", +"fieldtype": "Link", +"label": "Print Heading", +"no_copy": 1, +"oldfieldname": "select_print_heading", +"oldfieldtype": "Link", +"options": "Print Heading", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"report_hide": 1 +}, +{ +"fieldname": "due_date", +"fieldtype": "Date", +"in_filter": 1, +"label": "Due Date", +"no_copy": 0, +"oldfieldname": "due_date", +"oldfieldtype": "Date", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"search_index": 1 +}, +{ +"fieldname": "mode_of_payment", +"fieldtype": "Link", +"label": "Mode of Payment", +"oldfieldname": "mode_of_payment", +"oldfieldtype": "Select", +"options": "Mode of Payment", +"permlevel": 0, +"read_only": 0 +}, +{ +"fieldname": "column_break_63", +"fieldtype": "Column Break", +"permlevel": 0, +"read_only": 0 +}, +{ +"allow_on_submit": 1, +"fieldname": "letter_head", +"fieldtype": "Link", +"label": "Letter Head", +"options": "Letter Head", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "fiscal_year", +"fieldtype": "Link", +"in_filter": 1, +"label": "Fiscal Year", +"oldfieldname": "fiscal_year", +"oldfieldtype": "Select", +"options": "Fiscal Year", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"search_index": 1 +}, +{ +"fieldname": "remarks", +"fieldtype": "Small Text", +"label": "Remarks", +"no_copy": 1, +"oldfieldname": "remarks", +"oldfieldtype": "Text", +"permlevel": 0, +"print_hide": 1, +"read_only": 0, +"reqd": 0 +} +], +"icon": "icon-file-text", +"idx": 1, +"is_submittable": 1, +"modified": "2014-09-09 05:35:32.156763", +"modified_by": "Administrator", +"module": "Accounts", +"name": "Purchase Invoice", +"owner": "Administrator", +"permissions": [ +{ +"amend": 1, +"apply_user_permissions": 1, +"cancel": 1, +"create": 1, +"delete": 0, +"email": 1, +"permlevel": 0, +"print": 1, +"read": 1, +"report": 1, +"role": "Accounts User", +"submit": 1, +"write": 1 +}, +{ +"amend": 0, +"apply_user_permissions": 1, +"cancel": 0, +"create": 0, +"delete": 0, +"email": 1, +"permlevel": 0, +"print": 1, +"read": 1, +"report": 1, +"role": "Purchase User", +"submit": 0, +"write": 0 +}, +{ +"amend": 0, +"apply_user_permissions": 1, +"cancel": 0, +"create": 0, +"delete": 0, +"email": 1, +"permlevel": 0, +"print": 1, +"read": 1, +"report": 1, +"role": "Supplier", +"submit": 0, +"write": 0 +}, +{ +"amend": 1, +"cancel": 1, +"create": 1, +"delete": 1, +"email": 1, +"permlevel": 0, +"print": 1, +"read": 1, +"report": 1, +"role": "Accounts Manager", +"submit": 1, +"write": 1 +}, +{ +"amend": 0, +"apply_user_permissions": 1, +"cancel": 0, +"create": 0, +"delete": 0, +"email": 1, +"permlevel": 0, +"print": 1, +"read": 1, +"report": 1, +"role": "Auditor", +"submit": 0, +"write": 0 +}, +{ +"permlevel": 1, +"read": 1, +"role": "Accounts Manager", +"write": 1 +} +], +"read_only_onload": 1, +"search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount", +"sort_field": "modified", +"sort_order": "DESC" } diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index f16a548793..7dcdd45640 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -1,847 +1,733 @@ { - "allow_import": 1, - "autoname": "naming_series:", - "creation": "2013-05-21 16:16:39", - "docstatus": 0, - "doctype": "DocType", - "document_type": "Transaction", - "fields": [ - { - "fieldname": "supplier_section", - "fieldtype": "Section Break", - "label": "Supplier", - "options": "icon-user", - "permlevel": 0 - }, - { - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "PO-", - "permlevel": 0, - "print_hide": 1, - "reqd": 1 - }, - { - "description": "Supplier (vendor) name as entered in supplier master", - "fieldname": "supplier", - "fieldtype": "Link", - "in_filter": 1, - "label": "Supplier", - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "fieldname": "supplier_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Name", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "contact_mobile", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Mobile No", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "contact_email", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact Email", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0, - "print_width": "50%", - "width": "50%" - }, - { - "fieldname": "transaction_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "permlevel": 0, - "reqd": 1, - "search_index": 1 - }, - { - "allow_on_submit": 1, - "description": "Start date of current order's period", - "fieldname": "from_date", - "fieldtype": "Date", - "label": "From", - "no_copy": 1, - "permlevel": 0 - }, - { - "allow_on_submit": 1, - "description": "End date of current order's period", - "fieldname": "to_date", - "fieldtype": "Date", - "label": "To", - "no_copy": 1, - "permlevel": 0 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "options": "Purchase Order", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "description": "Select the relevant company name if you have multiple companies", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "no_copy": 0, - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "fieldname": "price_list_and_currency", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag", - "permlevel": 0 - }, - { - "fieldname": "cb_currency", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "no_copy": 0, - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "permlevel": 0, - "print_hide": 1, - "reqd": 1 - }, - { - "description": "Rate at which supplier's currency is converted to company's base currency", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "hidden": 0, - "label": "Exchange Rate", - "no_copy": 0, - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "reqd": 1 - }, - { - "fieldname": "cb_price_list", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "ignore_pricing_rule", - "fieldtype": "Check", - "label": "Ignore Pricing Rule", - "no_copy": 1, - "permlevel": 1, - "print_hide": 1 - }, - { - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "permlevel": 0 - }, - { - "allow_on_submit": 1, - "fieldname": "po_details", - "fieldtype": "Table", - "label": "Purchase Order Items", - "no_copy": 0, - "oldfieldname": "po_details", - "oldfieldtype": "Table", - "options": "Purchase Order Item", - "permlevel": 0 - }, - { - "fieldname": "sb_last_purchase", - "fieldtype": "Section Break", - "permlevel": 0 - }, - { - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "no_copy": 1, - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "reqd": 0 - }, - { - "fieldname": "column_break_26", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "no_copy": 0, - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "get_last_purchase_rate", - "fieldtype": "Button", - "label": "Get Last Purchase Rate", - "oldfieldtype": "Button", - "permlevel": 0, - "print_hide": 0 - }, - { - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, - "print_hide": 0 - }, - { - "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "no_copy": 0, - "oldfieldname": "purchase_other_charges", - "oldfieldtype": "Link", - "options": "Purchase Taxes and Charges Master", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "no_copy": 0, - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges", - "permlevel": 0 - }, - { - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "no_copy": 1, - "oldfieldtype": "HTML", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0 - }, - { - "fieldname": "other_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "no_copy": 0, - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "other_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "no_copy": 0, - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "total_tax", - "fieldtype": "Currency", - "label": "Total Tax (Company Currency)", - "no_copy": 1, - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "no_copy": 1, - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "description": "In Words will be visible once you save the Purchase Order.", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0 - }, - { - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "no_copy": 0, - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "no_copy": 0, - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "no_copy": 0, - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "fold", - "fieldtype": "Fold", - "permlevel": 0 - }, - { - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal", - "permlevel": 0 - }, - { - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor", - "permlevel": 0 - }, - { - "depends_on": "supplier", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn", - "permlevel": 0 - }, - { - "fieldname": "supplier_address", - "fieldtype": "Link", - "in_filter": 1, - "label": "Supplier Address", - "options": "Address", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "cb_contact", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "fieldname": "contact_person", - "fieldtype": "Link", - "in_filter": 1, - "label": "Contact Person", - "options": "Contact", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "permlevel": 0 - }, - { - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nStopped\nCancelled", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "default": "No", - "fieldname": "is_subcontracted", - "fieldtype": "Select", - "label": "Is Subcontracted", - "options": "\nYes\nNo", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "ref_sq", - "fieldtype": "Data", - "hidden": 1, - "label": "Ref SQ", - "no_copy": 1, - "oldfieldname": "ref_sq", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "fieldname": "letter_head", - "fieldtype": "Link", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "Letter Head", - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "fiscal_year", - "fieldtype": "Link", - "in_filter": 1, - "label": "Fiscal Year", - "no_copy": 0, - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "Fiscal Year", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "allow_on_submit": 1, - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "permlevel": 0, - "print_hide": 1, - "report_hide": 1 - }, - { - "fieldname": "column_break5", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "print_width": "50%", - "width": "50%" - }, - { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials received against this Purchase Order", - "fieldname": "per_received", - "fieldtype": "Percent", - "in_list_view": 1, - "label": "% Received", - "no_copy": 1, - "oldfieldname": "per_received", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials billed against this Purchase Order.", - "fieldname": "per_billed", - "fieldtype": "Percent", - "in_list_view": 1, - "label": "% Billed", - "no_copy": 1, - "oldfieldname": "per_billed", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "description": "Required raw materials issued to the supplier for producing a sub - contracted item.", - "fieldname": "raw_material_details", - "fieldtype": "Section Break", - "label": "Raw Materials Supplied", - "oldfieldtype": "Section Break", - "options": "icon-truck", - "permlevel": 0, - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "fieldname": "po_raw_material_details", - "fieldtype": "Table", - "label": "Purchase Order Items Supplied", - "no_copy": 0, - "oldfieldname": "po_raw_material_details", - "oldfieldtype": "Table", - "options": "Purchase Order Item Supplied", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "recurring_order", - "fieldtype": "Section Break", - "label": "Recurring Order", - "options": "icon-time", - "permlevel": 0 - }, - { - "fieldname": "column_break", - "fieldtype": "Column Break", - "label": "Column Break", - "permlevel": 0 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.docstatus<2", - "description": "Check if recurring order, uncheck to stop recurring or put proper End Date", - "fieldname": "is_recurring", - "fieldtype": "Check", - "label": "Is Recurring", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "fieldname": "recurring_type", - "fieldtype": "Select", - "label": "Recurring Type", - "no_copy": 1, - "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", - "permlevel": 0 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "The day of the month on which auto order will be generated e.g. 05, 28 etc", - "fieldname": "repeat_on_day_of_month", - "fieldtype": "Int", - "label": "Repeat on Day of Month", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1 - }, - { - "depends_on": "eval:doc.is_recurring==1", - "description": "The date on which next invoice will be generated. It is generated on submit.", - "fieldname": "next_date", - "fieldtype": "Date", - "label": "Next Date", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "The date on which recurring order will be stop", - "fieldname": "end_date", - "fieldtype": "Date", - "label": "End Date", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "column_break83", - "fieldtype": "Column Break", - "label": "Column Break", - "permlevel": 0, - "print_hide": 1 - }, - { - "depends_on": "eval:doc.is_recurring==1", - "fieldname": "recurring_id", - "fieldtype": "Data", - "label": "Recurring Id", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "Enter email id separated by commas, order will be mailed automatically on particular date", - "fieldname": "notification_email_address", - "fieldtype": "Small Text", - "label": "Notification Email Address", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1 - }, - { - "fieldname": "against_income_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Income Account", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "report_hide": 1 - } - ], - "icon": "icon-file-text", - "idx": 1, - "is_submittable": 1, - "modified": "2014-09-10 05:35:32.583024", - "modified_by": "Administrator", - "module": "Buying", - "name": "Purchase Order", - "owner": "Administrator", - "permissions": [ - { - "amend": 0, - "apply_user_permissions": 1, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "permlevel": 0, - "print": 0, - "read": 1, - "report": 1, - "role": "Material User", - "submit": 0, - "write": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Purchase Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "apply_user_permissions": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Purchase User", - "submit": 1, - "write": 1 - }, - { - "apply_user_permissions": 1, - "cancel": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Supplier" - }, - { - "permlevel": 1, - "read": 1, - "role": "Purchase Manager", - "write": 1 - } - ], - "read_only_onload": 1, - "search_fields": "status, transaction_date, supplier,grand_total", - "sort_field": "modified", - "sort_order": "DESC" +"allow_import": 1, +"autoname": "naming_series:", +"creation": "2013-05-21 16:16:39", +"docstatus": 0, +"doctype": "DocType", +"document_type": "Transaction", +"fields": [ +{ +"fieldname": "supplier_section", +"fieldtype": "Section Break", +"label": "Supplier", +"options": "icon-user", +"permlevel": 0 +}, +{ +"fieldname": "naming_series", +"fieldtype": "Select", +"label": "Series", +"no_copy": 1, +"oldfieldname": "naming_series", +"oldfieldtype": "Select", +"options": "PO-", +"permlevel": 0, +"print_hide": 1, +"reqd": 1 +}, +{ +"description": "Supplier (vendor) name as entered in supplier master", +"fieldname": "supplier", +"fieldtype": "Link", +"in_filter": 1, +"label": "Supplier", +"oldfieldname": "supplier", +"oldfieldtype": "Link", +"options": "Supplier", +"permlevel": 0, +"print_hide": 1, +"reqd": 1, +"search_index": 1 +}, +{ +"fieldname": "supplier_name", +"fieldtype": "Data", +"hidden": 0, +"in_list_view": 1, +"label": "Name", +"permlevel": 0, +"read_only": 1 +}, +{ +"fieldname": "address_display", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Address", +"permlevel": 0, +"read_only": 1 +}, +{ +"fieldname": "contact_display", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Contact", +"permlevel": 0, +"read_only": 1 +}, +{ +"fieldname": "contact_mobile", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Mobile No", +"permlevel": 0, +"read_only": 1 +}, +{ +"fieldname": "contact_email", +"fieldtype": "Small Text", +"hidden": 1, +"label": "Contact Email", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "column_break1", +"fieldtype": "Column Break", +"oldfieldtype": "Column Break", +"permlevel": 0, +"print_hide": 0, +"print_width": "50%", +"width": "50%" +}, +{ +"fieldname": "transaction_date", +"fieldtype": "Date", +"in_filter": 1, +"label": "Date", +"oldfieldname": "transaction_date", +"oldfieldtype": "Date", +"permlevel": 0, +"reqd": 1, +"search_index": 1 +}, +{ +"fieldname": "amended_from", +"fieldtype": "Link", +"hidden": 0, +"ignore_user_permissions": 1, +"label": "Amended From", +"no_copy": 1, +"oldfieldname": "amended_from", +"oldfieldtype": "Data", +"options": "Purchase Order", +"permlevel": 0, +"print_hide": 1, +"read_only": 1, +"report_hide": 0 +}, +{ +"description": "Select the relevant company name if you have multiple companies", +"fieldname": "company", +"fieldtype": "Link", +"in_filter": 1, +"label": "Company", +"no_copy": 0, +"oldfieldname": "company", +"oldfieldtype": "Link", +"options": "Company", +"permlevel": 0, +"print_hide": 1, +"reqd": 1, +"search_index": 1 +}, +{ +"fieldname": "price_list_and_currency", +"fieldtype": "Section Break", +"label": "Currency and Price List", +"options": "icon-tag", +"permlevel": 0 +}, +{ +"fieldname": "cb_currency", +"fieldtype": "Column Break", +"permlevel": 0 +}, +{ +"fieldname": "currency", +"fieldtype": "Link", +"label": "Currency", +"no_copy": 0, +"oldfieldname": "currency", +"oldfieldtype": "Select", +"options": "Currency", +"permlevel": 0, +"print_hide": 1, +"reqd": 1 +}, +{ +"description": "Rate at which supplier's currency is converted to company's base currency", +"fieldname": "conversion_rate", +"fieldtype": "Float", +"hidden": 0, +"label": "Exchange Rate", +"no_copy": 0, +"oldfieldname": "conversion_rate", +"oldfieldtype": "Currency", +"permlevel": 0, +"print_hide": 1, +"reqd": 1 +}, +{ +"fieldname": "cb_price_list", +"fieldtype": "Column Break", +"permlevel": 0 +}, +{ +"fieldname": "buying_price_list", +"fieldtype": "Link", +"label": "Price List", +"options": "Price List", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "price_list_currency", +"fieldtype": "Link", +"label": "Price List Currency", +"options": "Currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "plc_conversion_rate", +"fieldtype": "Float", +"label": "Price List Exchange Rate", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "ignore_pricing_rule", +"fieldtype": "Check", +"label": "Ignore Pricing Rule", +"no_copy": 1, +"permlevel": 1, +"print_hide": 1 +}, +{ +"fieldname": "items", +"fieldtype": "Section Break", +"label": "Items", +"oldfieldtype": "Section Break", +"options": "icon-shopping-cart", +"permlevel": 0 +}, +{ +"allow_on_submit": 1, +"fieldname": "po_details", +"fieldtype": "Table", +"label": "Purchase Order Items", +"no_copy": 0, +"oldfieldname": "po_details", +"oldfieldtype": "Table", +"options": "Purchase Order Item", +"permlevel": 0 +}, +{ +"fieldname": "sb_last_purchase", +"fieldtype": "Section Break", +"permlevel": 0 +}, +{ +"fieldname": "net_total", +"fieldtype": "Currency", +"label": "Net Total (Company Currency)", +"no_copy": 1, +"oldfieldname": "net_total", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1, +"reqd": 0 +}, +{ +"fieldname": "column_break_26", +"fieldtype": "Column Break", +"permlevel": 0 +}, +{ +"fieldname": "net_total_import", +"fieldtype": "Currency", +"label": "Net Total", +"no_copy": 0, +"oldfieldname": "net_total_import", +"oldfieldtype": "Currency", +"options": "currency", +"permlevel": 0, +"print_hide": 0, +"read_only": 1 +}, +{ +"fieldname": "get_last_purchase_rate", +"fieldtype": "Button", +"label": "Get Last Purchase Rate", +"oldfieldtype": "Button", +"permlevel": 0, +"print_hide": 0 +}, +{ +"fieldname": "taxes", +"fieldtype": "Section Break", +"label": "Taxes and Charges", +"oldfieldtype": "Section Break", +"options": "icon-money", +"permlevel": 0, +"print_hide": 0 +}, +{ +"description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", +"fieldname": "taxes_and_charges", +"fieldtype": "Link", +"label": "Taxes and Charges", +"no_copy": 0, +"oldfieldname": "purchase_other_charges", +"oldfieldtype": "Link", +"options": "Purchase Taxes and Charges Master", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "other_charges", +"fieldtype": "Table", +"label": "Purchase Taxes and Charges", +"no_copy": 0, +"oldfieldname": "purchase_tax_details", +"oldfieldtype": "Table", +"options": "Purchase Taxes and Charges", +"permlevel": 0 +}, +{ +"fieldname": "other_charges_calculation", +"fieldtype": "HTML", +"label": "Taxes and Charges Calculation", +"no_copy": 1, +"oldfieldtype": "HTML", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "totals", +"fieldtype": "Section Break", +"label": "Totals", +"oldfieldtype": "Section Break", +"options": "icon-money", +"permlevel": 0 +}, +{ +"fieldname": "other_charges_added", +"fieldtype": "Currency", +"label": "Taxes and Charges Added (Company Currency)", +"no_copy": 0, +"oldfieldname": "other_charges_added", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "other_charges_deducted", +"fieldtype": "Currency", +"label": "Taxes and Charges Deducted (Company Currency)", +"no_copy": 0, +"oldfieldname": "other_charges_deducted", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "total_tax", +"fieldtype": "Currency", +"label": "Total Tax (Company Currency)", +"no_copy": 1, +"oldfieldname": "total_tax", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "grand_total", +"fieldtype": "Currency", +"label": "Grand Total (Company Currency)", +"no_copy": 1, +"oldfieldname": "grand_total", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"description": "In Words will be visible once you save the Purchase Order.", +"fieldname": "in_words", +"fieldtype": "Data", +"label": "In Words (Company Currency)", +"oldfieldname": "in_words", +"oldfieldtype": "Data", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "rounded_total", +"fieldtype": "Currency", +"label": "Rounded Total (Company Currency)", +"oldfieldname": "rounded_total", +"oldfieldtype": "Currency", +"options": "Company:company:default_currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "advance_paid", +"fieldtype": "Currency", +"label": "Advance Paid", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"fieldname": "column_break4", +"fieldtype": "Column Break", +"oldfieldtype": "Column Break", +"permlevel": 0, +"print_hide": 0 +}, +{ +"fieldname": "other_charges_added_import", +"fieldtype": "Currency", +"label": "Taxes and Charges Added", +"no_copy": 0, +"oldfieldname": "other_charges_added_import", +"oldfieldtype": "Currency", +"options": "currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1, +"report_hide": 0 +}, +{ +"fieldname": "other_charges_deducted_import", +"fieldtype": "Currency", +"label": "Taxes and Charges Deducted", +"no_copy": 0, +"oldfieldname": "other_charges_deducted_import", +"oldfieldtype": "Currency", +"options": "currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1, +"report_hide": 0 +}, +{ +"fieldname": "grand_total_import", +"fieldtype": "Currency", +"in_list_view": 1, +"label": "Grand Total", +"no_copy": 0, +"oldfieldname": "grand_total_import", +"oldfieldtype": "Currency", +"options": "currency", +"permlevel": 0, +"print_hide": 0, +"read_only": 1, +"report_hide": 0 +}, +{ +"fieldname": "in_words_import", +"fieldtype": "Data", +"label": "In Words", +"oldfieldname": "in_words_import", +"oldfieldtype": "Data", +"permlevel": 0, +"print_hide": 0, +"read_only": 1 +}, +{ +"fieldname": "fold", +"fieldtype": "Fold", +"permlevel": 0 +}, +{ +"fieldname": "terms_section_break", +"fieldtype": "Section Break", +"label": "Terms and Conditions", +"oldfieldtype": "Section Break", +"options": "icon-legal", +"permlevel": 0 +}, +{ +"fieldname": "tc_name", +"fieldtype": "Link", +"label": "Terms", +"oldfieldname": "tc_name", +"oldfieldtype": "Link", +"options": "Terms and Conditions", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "terms", +"fieldtype": "Text Editor", +"label": "Terms and Conditions", +"oldfieldname": "terms", +"oldfieldtype": "Text Editor", +"permlevel": 0 +}, +{ +"depends_on": "supplier", +"fieldname": "contact_section", +"fieldtype": "Section Break", +"label": "Contact Info", +"options": "icon-bullhorn", +"permlevel": 0 +}, +{ +"fieldname": "supplier_address", +"fieldtype": "Link", +"in_filter": 1, +"label": "Supplier Address", +"options": "Address", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "cb_contact", +"fieldtype": "Column Break", +"permlevel": 0 +}, +{ +"fieldname": "contact_person", +"fieldtype": "Link", +"in_filter": 1, +"label": "Contact Person", +"options": "Contact", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "more_info", +"fieldtype": "Section Break", +"label": "More Info", +"oldfieldtype": "Section Break", +"permlevel": 0 +}, +{ +"fieldname": "status", +"fieldtype": "Select", +"in_filter": 1, +"label": "Status", +"no_copy": 1, +"oldfieldname": "status", +"oldfieldtype": "Select", +"options": "\nDraft\nSubmitted\nStopped\nCancelled", +"permlevel": 0, +"print_hide": 1, +"read_only": 1, +"reqd": 1, +"search_index": 1 +}, +{ +"default": "No", +"fieldname": "is_subcontracted", +"fieldtype": "Select", +"label": "Is Subcontracted", +"options": "\nYes\nNo", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "ref_sq", +"fieldtype": "Data", +"hidden": 1, +"label": "Ref SQ", +"no_copy": 1, +"oldfieldname": "ref_sq", +"oldfieldtype": "Data", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"allow_on_submit": 1, +"fieldname": "letter_head", +"fieldtype": "Link", +"label": "Letter Head", +"oldfieldname": "letter_head", +"oldfieldtype": "Select", +"options": "Letter Head", +"permlevel": 0, +"print_hide": 1 +}, +{ +"fieldname": "fiscal_year", +"fieldtype": "Link", +"in_filter": 1, +"label": "Fiscal Year", +"no_copy": 0, +"oldfieldname": "fiscal_year", +"oldfieldtype": "Select", +"options": "Fiscal Year", +"permlevel": 0, +"print_hide": 1, +"reqd": 1, +"search_index": 1 +}, +{ +"allow_on_submit": 1, +"fieldname": "select_print_heading", +"fieldtype": "Link", +"label": "Print Heading", +"no_copy": 1, +"oldfieldname": "select_print_heading", +"oldfieldtype": "Link", +"options": "Print Heading", +"permlevel": 0, +"print_hide": 1, +"report_hide": 1 +}, +{ +"fieldname": "column_break5", +"fieldtype": "Column Break", +"oldfieldtype": "Column Break", +"permlevel": 0, +"print_hide": 1, +"print_width": "50%", +"width": "50%" +}, +{ +"depends_on": "eval:!doc.__islocal", +"description": "% of materials received against this Purchase Order", +"fieldname": "per_received", +"fieldtype": "Percent", +"in_list_view": 1, +"label": "% Received", +"no_copy": 1, +"oldfieldname": "per_received", +"oldfieldtype": "Currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"depends_on": "eval:!doc.__islocal", +"description": "% of materials billed against this Purchase Order.", +"fieldname": "per_billed", +"fieldtype": "Percent", +"in_list_view": 1, +"label": "% Billed", +"no_copy": 1, +"oldfieldname": "per_billed", +"oldfieldtype": "Currency", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 +}, +{ +"description": "Required raw materials issued to the supplier for producing a sub - contracted item.", +"fieldname": "raw_material_details", +"fieldtype": "Section Break", +"label": "Raw Materials Supplied", +"oldfieldtype": "Section Break", +"options": "icon-truck", +"permlevel": 0, +"print_hide": 1 +}, +{ +"allow_on_submit": 1, +"fieldname": "po_raw_material_details", +"fieldtype": "Table", +"label": "Purchase Order Items Supplied", +"no_copy": 0, +"oldfieldname": "po_raw_material_details", +"oldfieldtype": "Table", +"options": "Purchase Order Item Supplied", +"permlevel": 0, +"print_hide": 1, +"read_only": 1 } +], +"icon": "icon-file-text", +"idx": 1, +"is_submittable": 1, +"modified": "2014-09-10 05:35:32.583024", +"modified_by": "Administrator", +"module": "Buying", +"name": "Purchase Order", +"owner": "Administrator", +"permissions": [ +{ +"amend": 0, +"apply_user_permissions": 1, +"cancel": 0, +"create": 0, +"delete": 0, +"email": 0, +"permlevel": 0, +"print": 0, +"read": 1, +"report": 1, +"role": "Material User", +"submit": 0, +"write": 0 +}, +{ +"amend": 1, +"cancel": 1, +"create": 1, +"delete": 1, +"email": 1, +"permlevel": 0, +"print": 1, +"read": 1, +"report": 1, +"role": "Purchase Manager", +"submit": 1, +"write": 1 +}, +{ +"amend": 1, +"apply_user_permissions": 1, +"cancel": 1, +"create": 1, +"delete": 1, +"email": 1, +"permlevel": 0, +"print": 1, +"read": 1, +"report": 1, +"role": "Purchase User", +"submit": 1, +"write": 1 +}, +{ +"apply_user_permissions": 1, +"cancel": 0, +"delete": 0, +"email": 1, +"permlevel": 0, +"print": 1, +"read": 1, +"report": 1, +"role": "Supplier" +}, +{ +"permlevel": 1, +"read": 1, +"role": "Purchase Manager", +"write": 1 +} +], +"read_only_onload": 1, +"search_fields": "status, transaction_date, supplier,grand_total", +"sort_field": "modified", +"sort_order": "DESC" +} + From 525ab0a925b35847a5317e1397dea2bcde63aa38 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Mon, 15 Sep 2014 12:57:58 +0530 Subject: [PATCH 7/9] fix build --- .../purchase_invoice/purchase_invoice.json | 129 ++++++++++++++++++ .../purchase_order/purchase_order.json | 123 +++++++++++++++++ 2 files changed, 252 insertions(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 43cb633cee..3a45136789 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -143,6 +143,24 @@ "search_index": 1 }, { + "allow_on_submit": 1, + "description": "Start date of current invoice's period", + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From", + "no_copy": 1, + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "description": "End date of current invoice's period", + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To", + "no_copy": 1, + "permlevel": 0 + }, + { "fieldname": "amended_from", "fieldtype": "Link", "ignore_user_permissions": 1, @@ -752,6 +770,117 @@ "print_hide": 1, "read_only": 0, "reqd": 0 + }, + { + "depends_on": "eval:doc.docstatus<2", + "fieldname": "recurring_invoice", + "fieldtype": "Section Break", + "label": "Recurring Invoice", + "options": "icon-time", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break_77", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.docstatus<2", + "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date", + "fieldname": "is_recurring", + "fieldtype": "Check", + "label": "Is Recurring", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "Select the period when the invoice will be generated automatically", + "fieldname": "recurring_type", + "fieldtype": "Select", + "label": "Recurring Type", + "no_copy": 1, + "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc", + "fieldname": "repeat_on_day_of_month", + "fieldtype": "Int", + "label": "Repeat on Day of Month", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which next invoice will be generated. It is generated on submit.", + "fieldname": "next_date", + "fieldtype": "Date", + "label": "Next Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_82", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which recurring invoice will be stop", + "fieldname": "end_date", + "fieldtype": "Date", + "label": "End Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:doc.is_recurring==1", + "description": "The unique id for tracking all recurring invoices. It is generated on submit.", + "fieldname": "recurring_id", + "fieldtype": "Data", + "label": "Recurring Id", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date", + "fieldname": "notification_email_address", + "fieldtype": "Small Text", + "label": "Notification Email Address", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "against_income_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Income Account", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 } ], "icon": "icon-file-text", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 7dcdd45640..7843fb7f57 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -102,6 +102,24 @@ "search_index": 1 }, { +"allow_on_submit": 1, + "description": "Start date of current order's period", + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From", + "no_copy": 1, + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "description": "End date of current order's period", + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To", + "no_copy": 1, + "permlevel": 0 + }, + { "fieldname": "amended_from", "fieldtype": "Link", "hidden": 0, @@ -652,6 +670,111 @@ "permlevel": 0, "print_hide": 1, "read_only": 1 + }, + { + "fieldname": "recurring_order", + "fieldtype": "Section Break", + "label": "Recurring Order", + "options": "icon-time", + "permlevel": 0 + }, + { + "fieldname": "column_break", + "fieldtype": "Column Break", + "label": "Column Break", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.docstatus<2", + "description": "Check if recurring order, uncheck to stop recurring or put proper End Date", + "fieldname": "is_recurring", + "fieldtype": "Check", + "label": "Is Recurring", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "fieldname": "recurring_type", + "fieldtype": "Select", + "label": "Recurring Type", + "no_copy": 1, + "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The day of the month on which auto order will be generated e.g. 05, 28 etc", + "fieldname": "repeat_on_day_of_month", + "fieldtype": "Int", + "label": "Repeat on Day of Month", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which next invoice will be generated. It is generated on submit.", + "fieldname": "next_date", + "fieldtype": "Date", + "label": "Next Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which recurring order will be stop", + "fieldname": "end_date", + "fieldtype": "Date", + "label": "End Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break83", + "fieldtype": "Column Break", + "label": "Column Break", + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:doc.is_recurring==1", + "fieldname": "recurring_id", + "fieldtype": "Data", + "label": "Recurring Id", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "Enter email id separated by commas, order will be mailed automatically on particular date", + "fieldname": "notification_email_address", + "fieldtype": "Small Text", + "label": "Notification Email Address", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "against_income_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Income Account", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 } ], "icon": "icon-file-text", From f37d4337a486c6bc8ee7976d627f1a039f66ac19 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Mon, 15 Sep 2014 13:37:46 +0530 Subject: [PATCH 8/9] fix test for purchase order --- erpnext/controllers/recurring_document.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py index 7b4310bada..32b1cebd03 100644 --- a/erpnext/controllers/recurring_document.py +++ b/erpnext/controllers/recurring_document.py @@ -16,6 +16,8 @@ month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} def create_recurring_documents(): manage_recurring_documents("Sales Order") manage_recurring_documents("Sales Invoice") + manage_recurring_documents("Purchase Order") + manage_recurring_documents("Purchase Invoice") def manage_recurring_documents(doctype, next_date=None, commit=True): """ @@ -28,6 +30,10 @@ def manage_recurring_documents(doctype, next_date=None, commit=True): date_field = "transaction_date" elif doctype == "Sales Invoice": date_field = "posting_date" + elif doctype == "Purchase Order": + date_field = "transaction_date" + elif doctype == "Purchase Invoice": + date_field = "posting_date" recurring_documents = frappe.db.sql("""select name, recurring_id from `tab{}` where ifnull(is_recurring, 0)=1 From 1394509343f60185cd38493f0bda7a1db282d13d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Sun, 21 Sep 2014 19:45:49 +0530 Subject: [PATCH 9/9] Fixes for recurring document --- .../purchase_invoice/purchase_invoice.js | 36 - .../purchase_invoice/purchase_invoice.json | 1722 ++++++++-------- .../purchase_invoice/purchase_invoice.py | 16 +- .../purchase_invoice/test_purchase_invoice.py | 4 + .../doctype/sales_invoice/sales_invoice.js | 31 - .../doctype/sales_invoice/sales_invoice.json | 6 +- .../doctype/sales_invoice/sales_invoice.py | 20 +- .../doctype/purchase_order/purchase_order.js | 33 - .../purchase_order/purchase_order.json | 1475 +++++++------- .../doctype/purchase_order/purchase_order.py | 13 +- .../purchase_order/test_purchase_order.py | 1 - erpnext/controllers/accounts_controller.py | 24 +- erpnext/controllers/buying_controller.py | 5 +- erpnext/controllers/recurring_document.py | 24 +- .../tests/test_recurring_document.py | 37 +- erpnext/public/js/transaction.js | 33 +- .../doctype/sales_order/sales_order.js | 31 - .../doctype/sales_order/sales_order.json | 1786 ++++++++--------- .../doctype/sales_order/sales_order.py | 15 +- .../emails/recurring_document_failed.html | 2 +- 20 files changed, 2564 insertions(+), 2750 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 90f463a38d..b56351e583 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -232,42 +232,6 @@ cur_frm.fields_dict['entries'].grid.get_field('project_name').get_query = functi } } - - -cur_frm.cscript.is_recurring = function(doc, dt, dn) { - // set default values for recurring invoices - if(doc.is_recurring) { - var owner_email = doc.owner=="Administrator" - ? frappe.user_info("Administrator").email - : doc.owner; - - doc.notification_email_address = $.map([cstr(owner_email), - cstr(doc.contact_email)], function(v) { return v || null; }).join(", "); - doc.repeat_on_day_of_month = frappe.datetime.str_to_obj(doc.posting_date).getDate(); - } - - refresh_many(["notification_email_address", "repeat_on_day_of_month"]); -} - - -cur_frm.cscript.from_date = function(doc, dt, dn) { - // set to_date - if(doc.from_date) { - var recurring_type_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, - 'Yearly': 12}; - - var months = recurring_type_map[doc.recurring_type]; - if(months) { - var to_date = frappe.datetime.add_months(doc.from_date, - months); - doc.to_date = frappe.datetime.add_days(to_date, -1); - refresh_field('to_date'); - } - } -} - - - cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){ if(doc.select_print_heading){ // print heading diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 3a45136789..d91c53ceaa 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -1,153 +1,153 @@ { -"allow_import": 1, -"autoname": "naming_series:", -"creation": "2013-05-21 16:16:39", -"docstatus": 0, -"doctype": "DocType", -"fields": [ -{ -"fieldname": "supplier_section", -"fieldtype": "Section Break", -"label": "Supplier", -"options": "icon-user", -"permlevel": 0 -}, -{ -"fieldname": "column_break0", -"fieldtype": "Column Break", -"oldfieldtype": "Column Break", -"permlevel": 0, -"read_only": 0, -"width": "50%" -}, -{ -"fieldname": "naming_series", -"fieldtype": "Select", -"label": "Series", -"no_copy": 1, -"oldfieldname": "naming_series", -"oldfieldtype": "Select", -"options": "PINV-", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"report_hide": 0, -"reqd": 1 -}, -{ -"fieldname": "supplier", -"fieldtype": "Link", -"hidden": 0, -"label": "Supplier", -"oldfieldname": "supplier", -"oldfieldtype": "Link", -"options": "Supplier", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"depends_on": "supplier", -"fieldname": "supplier_name", -"fieldtype": "Data", -"hidden": 0, -"in_list_view": 1, -"label": "Name", -"oldfieldname": "supplier_name", -"oldfieldtype": "Data", -"permlevel": 0, -"read_only": 1 -}, -{ -"fieldname": "address_display", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Address", -"permlevel": 0, -"read_only": 1 -}, -{ -"fieldname": "contact_display", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Contact", -"permlevel": 0, -"read_only": 1 -}, -{ -"fieldname": "contact_mobile", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Mobile No", -"permlevel": 0, -"read_only": 1 -}, -{ -"fieldname": "contact_email", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Contact Email", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "column_break1", -"fieldtype": "Column Break", -"oldfieldtype": "Column Break", -"permlevel": 0, -"read_only": 0, -"reqd": 0, -"width": "50%" -}, -{ -"default": "Today", -"fieldname": "posting_date", -"fieldtype": "Date", -"in_filter": 1, -"label": "Date", -"no_copy": 0, -"oldfieldname": "posting_date", -"oldfieldtype": "Date", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"reqd": 1, -"search_index": 1 -}, -{ -"description": "", -"fieldname": "bill_no", -"fieldtype": "Data", -"in_filter": 1, -"label": "Supplier Invoice No", -"oldfieldname": "bill_no", -"oldfieldtype": "Data", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"reqd": 0, -"search_index": 1 -}, -{ -"fieldname": "bill_date", -"fieldtype": "Date", -"in_filter": 1, -"label": "Supplier Invoice Date", -"oldfieldname": "bill_date", -"oldfieldtype": "Date", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"reqd": 0, -"search_index": 1 -}, -{ + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-21 16:16:39", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "supplier_section", + "fieldtype": "Section Break", + "label": "Supplier", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "PINV-", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 1 + }, + { + "fieldname": "supplier", + "fieldtype": "Link", + "hidden": 0, + "label": "Supplier", + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "supplier", + "fieldname": "supplier_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Name", + "oldfieldname": "supplier_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "reqd": 0, + "width": "50%" + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Date", + "no_copy": 0, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "description": "", + "fieldname": "bill_no", + "fieldtype": "Data", + "in_filter": 1, + "label": "Supplier Invoice No", + "oldfieldname": "bill_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "bill_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Supplier Invoice Date", + "oldfieldname": "bill_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { "allow_on_submit": 1, "description": "Start date of current invoice's period", "fieldname": "from_date", "fieldtype": "Date", - "label": "From", + "label": "From Date", "no_copy": 1, "permlevel": 0 }, @@ -156,620 +156,620 @@ "description": "End date of current invoice's period", "fieldname": "to_date", "fieldtype": "Date", - "label": "To", + "label": "To Date", "no_copy": 1, "permlevel": 0 }, { -"fieldname": "amended_from", -"fieldtype": "Link", -"ignore_user_permissions": 1, -"label": "Amended From", -"no_copy": 1, -"oldfieldname": "amended_from", -"oldfieldtype": "Link", -"options": "Purchase Invoice", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "company", -"fieldtype": "Link", -"in_filter": 1, -"label": "Company", -"oldfieldname": "company", -"oldfieldtype": "Link", -"options": "Company", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"search_index": 1 -}, -{ -"fieldname": "currency_price_list", -"fieldtype": "Section Break", -"label": "Currency and Price List", -"options": "icon-tag", -"permlevel": 0, -"read_only": 0 -}, -{ -"fieldname": "currency", -"fieldtype": "Link", -"label": "Currency", -"oldfieldname": "currency", -"oldfieldtype": "Select", -"options": "Currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"description": "The rate at which Bill Currency is converted into company's base currency", -"fieldname": "conversion_rate", -"fieldtype": "Float", -"label": "Exchange Rate", -"oldfieldname": "conversion_rate", -"oldfieldtype": "Currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "column_break2", -"fieldtype": "Column Break", -"permlevel": 0, -"read_only": 0 -}, -{ -"fieldname": "buying_price_list", -"fieldtype": "Link", -"label": "Price List", -"options": "Price List", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "price_list_currency", -"fieldtype": "Link", -"label": "Price List Currency", -"options": "Currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "plc_conversion_rate", -"fieldtype": "Float", -"label": "Price List Exchange Rate", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "ignore_pricing_rule", -"fieldtype": "Check", -"label": "Ignore Pricing Rule", -"no_copy": 1, -"permlevel": 1, -"print_hide": 1 -}, -{ -"fieldname": "items", -"fieldtype": "Section Break", -"label": "Items", -"oldfieldtype": "Section Break", -"options": "icon-shopping-cart", -"permlevel": 0, -"read_only": 0 -}, -{ -"allow_on_submit": 1, -"fieldname": "entries", -"fieldtype": "Table", -"label": "Entries", -"oldfieldname": "entries", -"oldfieldtype": "Table", -"options": "Purchase Invoice Item", -"permlevel": 0, -"read_only": 0 -}, -{ -"fieldname": "section_break_26", -"fieldtype": "Section Break", -"permlevel": 0 -}, -{ -"description": "Will be calculated automatically when you enter the details", -"fieldname": "net_total", -"fieldtype": "Currency", -"label": "Net Total (Company Currency)", -"oldfieldname": "net_total", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "column_break_28", -"fieldtype": "Column Break", -"permlevel": 0 -}, -{ -"fieldname": "net_total_import", -"fieldtype": "Currency", -"label": "Net Total", -"oldfieldname": "net_total_import", -"oldfieldtype": "Currency", -"options": "currency", -"permlevel": 0, -"print_hide": 0, -"read_only": 1 -}, -{ -"fieldname": "taxes", -"fieldtype": "Section Break", -"label": "Taxes and Charges", -"oldfieldtype": "Section Break", -"options": "icon-money", -"permlevel": 0, -"read_only": 0 -}, -{ -"fieldname": "taxes_and_charges", -"fieldtype": "Link", -"label": "Taxes and Charges", -"oldfieldname": "purchase_other_charges", -"oldfieldtype": "Link", -"options": "Purchase Taxes and Charges Master", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "other_charges", -"fieldtype": "Table", -"label": "Purchase Taxes and Charges", -"oldfieldname": "purchase_tax_details", -"oldfieldtype": "Table", -"options": "Purchase Taxes and Charges", -"permlevel": 0, -"read_only": 0 -}, -{ -"fieldname": "other_charges_calculation", -"fieldtype": "HTML", -"label": "Taxes and Charges Calculation", -"oldfieldtype": "HTML", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "totals", -"fieldtype": "Section Break", -"label": "Totals", -"oldfieldtype": "Section Break", -"options": "icon-money", -"permlevel": 0, -"read_only": 0 -}, -{ -"fieldname": "other_charges_added", -"fieldtype": "Currency", -"label": "Taxes and Charges Added (Company Currency)", -"oldfieldname": "other_charges_added", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "other_charges_deducted", -"fieldtype": "Currency", -"label": "Taxes and Charges Deducted (Company Currency)", -"oldfieldname": "other_charges_deducted", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "grand_total", -"fieldtype": "Currency", -"label": "Grand Total (Company Currency)", -"oldfieldname": "grand_total", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"description": "In Words will be visible once you save the Purchase Invoice.", -"fieldname": "in_words", -"fieldtype": "Data", -"label": "In Words (Company Currency)", -"oldfieldname": "in_words", -"oldfieldtype": "Data", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "column_break8", -"fieldtype": "Column Break", -"oldfieldtype": "Column Break", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"width": "50%" -}, -{ -"fieldname": "other_charges_added_import", -"fieldtype": "Currency", -"label": "Taxes and Charges Added", -"oldfieldname": "other_charges_added_import", -"oldfieldtype": "Currency", -"options": "currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "other_charges_deducted_import", -"fieldtype": "Currency", -"label": "Taxes and Charges Deducted", -"oldfieldname": "other_charges_deducted_import", -"oldfieldtype": "Currency", -"options": "currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "grand_total_import", -"fieldtype": "Currency", -"in_list_view": 1, -"label": "Grand Total", -"oldfieldname": "grand_total_import", -"oldfieldtype": "Currency", -"options": "currency", -"permlevel": 0, -"print_hide": 0, -"read_only": 1 -}, -{ -"fieldname": "in_words_import", -"fieldtype": "Data", -"label": "In Words", -"oldfieldname": "in_words_import", -"oldfieldtype": "Data", -"permlevel": 0, -"print_hide": 0, -"read_only": 1 -}, -{ -"fieldname": "total_amount_to_pay", -"fieldtype": "Currency", -"hidden": 0, -"label": "Total Amount To Pay", -"no_copy": 1, -"oldfieldname": "total_amount_to_pay", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "total_advance", -"fieldtype": "Currency", -"label": "Total Advance", -"no_copy": 1, -"oldfieldname": "total_advance", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "total_tax", -"fieldtype": "Currency", -"label": "Total Tax (Company Currency)", -"oldfieldname": "total_tax", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "outstanding_amount", -"fieldtype": "Currency", -"in_filter": 1, -"in_list_view": 1, -"label": "Outstanding Amount", -"no_copy": 1, -"oldfieldname": "outstanding_amount", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1, -"search_index": 1 -}, -{ -"fieldname": "write_off_amount", -"fieldtype": "Currency", -"label": "Write Off Amount", -"no_copy": 1, -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"depends_on": "eval:flt(doc.write_off_amount)!=0", -"fieldname": "write_off_account", -"fieldtype": "Link", -"label": "Write Off Account", -"no_copy": 1, -"options": "Account", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"depends_on": "eval:flt(doc.write_off_amount)!=0", -"fieldname": "write_off_cost_center", -"fieldtype": "Link", -"label": "Write Off Cost Center", -"no_copy": 1, -"options": "Cost Center", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "against_expense_account", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Against Expense Account", -"no_copy": 1, -"oldfieldname": "against_expense_account", -"oldfieldtype": "Small Text", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"report_hide": 0 -}, -{ -"fieldname": "fold", -"fieldtype": "Fold", -"permlevel": 0 -}, -{ -"fieldname": "advances", -"fieldtype": "Section Break", -"label": "Advances", -"oldfieldtype": "Section Break", -"options": "icon-money", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "get_advances_paid", -"fieldtype": "Button", -"label": "Get Advances Paid", -"oldfieldtype": "Button", -"options": "get_advances", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "advance_allocation_details", -"fieldtype": "Table", -"label": "Purchase Invoice Advances", -"no_copy": 1, -"oldfieldname": "advance_allocation_details", -"oldfieldtype": "Table", -"options": "Purchase Invoice Advance", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "terms_section_break", -"fieldtype": "Section Break", -"label": "Terms and Conditions", -"options": "icon-legal", -"permlevel": 0 -}, -{ -"fieldname": "tc_name", -"fieldtype": "Link", -"label": "Terms", -"options": "Terms and Conditions", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "terms", -"fieldtype": "Text Editor", -"label": "Terms and Conditions1", -"permlevel": 0 -}, -{ -"depends_on": "supplier", -"fieldname": "contact_section", -"fieldtype": "Section Break", -"label": "Contact Info", -"options": "icon-bullhorn", -"permlevel": 0, -"read_only": 0 -}, -{ -"fieldname": "supplier_address", -"fieldtype": "Link", -"label": "Supplier Address", -"options": "Address", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "col_break23", -"fieldtype": "Column Break", -"permlevel": 0, -"read_only": 0, -"width": "50%" -}, -{ -"fieldname": "contact_person", -"fieldtype": "Link", -"label": "Contact Person", -"options": "Contact", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"fieldname": "more_info", -"fieldtype": "Section Break", -"label": "More Info", -"oldfieldtype": "Section Break", -"options": "icon-file-text", -"permlevel": 0, -"print_hide": 1, -"read_only": 0 -}, -{ -"description": "Supplier (Payable) Account", -"fieldname": "credit_to", -"fieldtype": "Link", -"in_filter": 1, -"label": "Credit To", -"oldfieldname": "credit_to", -"oldfieldtype": "Link", -"options": "Account", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"reqd": 1, -"search_index": 1 -}, -{ -"default": "No", -"description": "Considered as Opening Balance", -"fieldname": "is_opening", -"fieldtype": "Select", -"in_filter": 1, -"label": "Is Opening", -"oldfieldname": "is_opening", -"oldfieldtype": "Select", -"options": "No\nYes", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"search_index": 1 -}, -{ -"description": "Actual Invoice Date", -"fieldname": "aging_date", -"fieldtype": "Date", -"label": "Aging Date", -"oldfieldname": "aging_date", -"oldfieldtype": "Date", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"search_index": 0 -}, -{ -"allow_on_submit": 1, -"fieldname": "select_print_heading", -"fieldtype": "Link", -"label": "Print Heading", -"no_copy": 1, -"oldfieldname": "select_print_heading", -"oldfieldtype": "Link", -"options": "Print Heading", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"report_hide": 1 -}, -{ -"fieldname": "due_date", -"fieldtype": "Date", -"in_filter": 1, -"label": "Due Date", -"no_copy": 0, -"oldfieldname": "due_date", -"oldfieldtype": "Date", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"search_index": 1 -}, -{ -"fieldname": "mode_of_payment", -"fieldtype": "Link", -"label": "Mode of Payment", -"oldfieldname": "mode_of_payment", -"oldfieldtype": "Select", -"options": "Mode of Payment", -"permlevel": 0, -"read_only": 0 -}, -{ -"fieldname": "column_break_63", -"fieldtype": "Column Break", -"permlevel": 0, -"read_only": 0 -}, -{ -"allow_on_submit": 1, -"fieldname": "letter_head", -"fieldtype": "Link", -"label": "Letter Head", -"options": "Letter Head", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "fiscal_year", -"fieldtype": "Link", -"in_filter": 1, -"label": "Fiscal Year", -"oldfieldname": "fiscal_year", -"oldfieldtype": "Select", -"options": "Fiscal Year", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"search_index": 1 -}, -{ -"fieldname": "remarks", -"fieldtype": "Small Text", -"label": "Remarks", -"no_copy": 1, -"oldfieldname": "remarks", -"oldfieldtype": "Text", -"permlevel": 0, -"print_hide": 1, -"read_only": 0, -"reqd": 0 + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Link", + "options": "Purchase Invoice", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "currency_price_list", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "The rate at which Bill Currency is converted into company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "ignore_pricing_rule", + "fieldtype": "Check", + "label": "Ignore Pricing Rule", + "no_copy": 1, + "permlevel": 1, + "print_hide": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "entries", + "fieldtype": "Table", + "label": "Entries", + "oldfieldname": "entries", + "oldfieldtype": "Table", + "options": "Purchase Invoice Item", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "section_break_26", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "Will be calculated automatically when you enter the details", + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_28", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "purchase_other_charges", + "oldfieldtype": "Link", + "options": "Purchase Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "other_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "In Words will be visible once you save the Purchase Invoice.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break8", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "total_amount_to_pay", + "fieldtype": "Currency", + "hidden": 0, + "label": "Total Amount To Pay", + "no_copy": 1, + "oldfieldname": "total_amount_to_pay", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_advance", + "fieldtype": "Currency", + "label": "Total Advance", + "no_copy": 1, + "oldfieldname": "total_advance", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_tax", + "fieldtype": "Currency", + "label": "Total Tax (Company Currency)", + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "outstanding_amount", + "fieldtype": "Currency", + "in_filter": 1, + "in_list_view": 1, + "label": "Outstanding Amount", + "no_copy": 1, + "oldfieldname": "outstanding_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "write_off_amount", + "fieldtype": "Currency", + "label": "Write Off Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "eval:flt(doc.write_off_amount)!=0", + "fieldname": "write_off_account", + "fieldtype": "Link", + "label": "Write Off Account", + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "eval:flt(doc.write_off_amount)!=0", + "fieldname": "write_off_cost_center", + "fieldtype": "Link", + "label": "Write Off Cost Center", + "no_copy": 1, + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "against_expense_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Expense Account", + "no_copy": 1, + "oldfieldname": "against_expense_account", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0 + }, + { + "fieldname": "fold", + "fieldtype": "Fold", + "permlevel": 0 + }, + { + "fieldname": "advances", + "fieldtype": "Section Break", + "label": "Advances", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "get_advances_paid", + "fieldtype": "Button", + "label": "Get Advances Paid", + "oldfieldtype": "Button", + "options": "get_advances", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "advance_allocation_details", + "fieldtype": "Table", + "label": "Purchase Invoice Advances", + "no_copy": 1, + "oldfieldname": "advance_allocation_details", + "oldfieldtype": "Table", + "options": "Purchase Invoice Advance", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "options": "icon-legal", + "permlevel": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions1", + "permlevel": 0 + }, + { + "depends_on": "supplier", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "supplier_address", + "fieldtype": "Link", + "label": "Supplier Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "col_break23", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "Supplier (Payable) Account", + "fieldname": "credit_to", + "fieldtype": "Link", + "in_filter": 1, + "label": "Credit To", + "oldfieldname": "credit_to", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "default": "No", + "description": "Considered as Opening Balance", + "fieldname": "is_opening", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Opening", + "oldfieldname": "is_opening", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "description": "Actual Invoice Date", + "fieldname": "aging_date", + "fieldtype": "Date", + "label": "Aging Date", + "oldfieldname": "aging_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "due_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Due Date", + "no_copy": 0, + "oldfieldname": "due_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "oldfieldname": "mode_of_payment", + "oldfieldtype": "Select", + "options": "Mode of Payment", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break_63", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "options": "Letter Head", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Link", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 }, { "depends_on": "eval:doc.docstatus<2", @@ -832,13 +832,6 @@ "print_hide": 1, "read_only": 1 }, - { - "fieldname": "column_break_82", - "fieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "width": "50%" - }, { "allow_on_submit": 1, "depends_on": "eval:doc.is_recurring==1", @@ -850,6 +843,13 @@ "permlevel": 0, "print_hide": 1 }, + { + "fieldname": "column_break_82", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, { "depends_on": "eval:doc.is_recurring==1", "description": "The unique id for tracking all recurring invoices. It is generated on submit.", @@ -871,110 +871,100 @@ "no_copy": 1, "permlevel": 0, "print_hide": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-09-18 03:12:51.994059", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Invoice", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "apply_user_permissions": 1, + "cancel": 1, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 1, + "write": 1 }, { - "fieldname": "against_income_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Income Account", - "no_copy": 1, + "amend": 0, + "apply_user_permissions": 1, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, "permlevel": 0, - "print_hide": 1, - "report_hide": 1 -} -], -"icon": "icon-file-text", -"idx": 1, -"is_submittable": 1, -"modified": "2014-09-09 05:35:32.156763", -"modified_by": "Administrator", -"module": "Accounts", -"name": "Purchase Invoice", -"owner": "Administrator", -"permissions": [ -{ -"amend": 1, -"apply_user_permissions": 1, -"cancel": 1, -"create": 1, -"delete": 0, -"email": 1, -"permlevel": 0, -"print": 1, -"read": 1, -"report": 1, -"role": "Accounts User", -"submit": 1, -"write": 1 -}, -{ -"amend": 0, -"apply_user_permissions": 1, -"cancel": 0, -"create": 0, -"delete": 0, -"email": 1, -"permlevel": 0, -"print": 1, -"read": 1, -"report": 1, -"role": "Purchase User", -"submit": 0, -"write": 0 -}, -{ -"amend": 0, -"apply_user_permissions": 1, -"cancel": 0, -"create": 0, -"delete": 0, -"email": 1, -"permlevel": 0, -"print": 1, -"read": 1, -"report": 1, -"role": "Supplier", -"submit": 0, -"write": 0 -}, -{ -"amend": 1, -"cancel": 1, -"create": 1, -"delete": 1, -"email": 1, -"permlevel": 0, -"print": 1, -"read": 1, -"report": 1, -"role": "Accounts Manager", -"submit": 1, -"write": 1 -}, -{ -"amend": 0, -"apply_user_permissions": 1, -"cancel": 0, -"create": 0, -"delete": 0, -"email": 1, -"permlevel": 0, -"print": 1, -"read": 1, -"report": 1, -"role": "Auditor", -"submit": 0, -"write": 0 -}, -{ -"permlevel": 1, -"read": 1, -"role": "Accounts Manager", -"write": 1 -} -], -"read_only_onload": 1, -"search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount", -"sort_field": "modified", -"sort_order": "DESC" -} + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "apply_user_permissions": 1, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Supplier", + "submit": 0, + "write": 0 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "apply_user_permissions": 1, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Auditor", + "submit": 0, + "write": 0 + }, + { + "permlevel": 1, + "read": 1, + "role": "Accounts Manager", + "write": 1 + } + ], + "read_only_onload": 1, + "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount", + "sort_field": "modified", + "sort_order": "DESC" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 6a41bbab39..b5b3f1dd5e 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -5,20 +5,14 @@ from __future__ import unicode_literals import frappe -from frappe.utils import add_days, cint, cstr, date_diff, formatdate, flt, getdate, nowdate, \ - get_first_day, get_last_day -from frappe.model.naming import make_autoname - +from frappe.utils import cint, cstr, formatdate, flt from frappe import msgprint, _, throw from erpnext.setup.utils import get_company_currency - import frappe.defaults from erpnext.controllers.buying_controller import BuyingController from erpnext.accounts.party import get_party_account, get_due_date -from erpnext.controllers.recurring_document import * - form_grid_templates = { "entries": "templates/form_grid/item_grid.html" } @@ -66,7 +60,6 @@ class PurchaseInvoice(BuyingController): self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", "purchase_receipt_details") self.create_remarks() - validate_recurring_document(self) def create_remarks(self): if not self.remarks: @@ -255,6 +248,8 @@ class PurchaseInvoice(BuyingController): reconcile_against_document(lst) def on_submit(self): + super(PurchaseInvoice, self).on_submit() + self.check_prev_docstatus() frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, @@ -265,11 +260,6 @@ class PurchaseInvoice(BuyingController): self.update_against_document_in_jv() self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") - convert_to_recurring(self, self.posting_date) - - def on_update_after_submit(self): - validate_recurring_document(self) - convert_to_recurring(self, self.posting_date) def make_gl_entries(self): auto_accounting_for_stock = \ diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index bc97b91d30..d4fcfc72be 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -231,4 +231,8 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_voucher=%s""", pi.name)) + def test_recurring_invoice(self): + from erpnext.controllers.tests.test_recurring_document import test_recurring_document + test_recurring_document(self, test_records) + test_records = frappe.get_test_records('Purchase Invoice') diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 73832cec65..cc841e2ffc 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -399,37 +399,6 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) { }) } -cur_frm.cscript.is_recurring = function(doc, dt, dn) { - // set default values for recurring invoices - if(doc.is_recurring) { - var owner_email = doc.owner=="Administrator" - ? frappe.user_info("Administrator").email - : doc.owner; - - doc.notification_email_address = $.map([cstr(owner_email), - cstr(doc.contact_email)], function(v) { return v || null; }).join(", "); - doc.repeat_on_day_of_month = frappe.datetime.str_to_obj(doc.posting_date).getDate(); - } - - refresh_many(["notification_email_address", "repeat_on_day_of_month"]); -} - -cur_frm.cscript.from_date = function(doc, dt, dn) { - // set to_date - if(doc.from_date) { - var recurring_type_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, - 'Yearly': 12}; - - var months = recurring_type_map[doc.recurring_type]; - if(months) { - var to_date = frappe.datetime.add_months(doc.from_date, - months); - doc.to_date = frappe.datetime.add_days(to_date, -1); - refresh_field('to_date'); - } - } -} - cur_frm.cscript.send_sms = function() { frappe.require("assets/erpnext/js/sms_manager.js"); var sms_man = new SMSManager(cur_frm.doc); diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 234d048ad5..4462ac6566 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -174,7 +174,7 @@ "description": "Start date of current invoice's period", "fieldname": "from_date", "fieldtype": "Date", - "label": "From", + "label": "From Date", "no_copy": 1, "permlevel": 0, "print_hide": 0, @@ -186,7 +186,7 @@ "description": "End date of current invoice's period", "fieldname": "to_date", "fieldtype": "Date", - "label": "To", + "label": "To Date", "no_copy": 1, "permlevel": 0, "print_hide": 0, @@ -1192,7 +1192,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-09-09 05:35:34.121045", + "modified": "2014-09-18 03:17:54.976732", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 6c5f951caf..25a0cc8601 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -4,18 +4,12 @@ from __future__ import unicode_literals import frappe import frappe.defaults - -from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, \ - get_first_day, get_last_day -from frappe.model.naming import make_autoname +from frappe.utils import cint, cstr, flt from frappe import _, msgprint, throw from erpnext.accounts.party import get_party_account, get_due_date from erpnext.controllers.stock_controller import update_gl_entries_after from frappe.model.mapper import get_mapped_doc - -from erpnext.controllers.recurring_document import * - from erpnext.controllers.selling_controller import SellingController form_grid_templates = { @@ -77,11 +71,12 @@ class SalesInvoice(SellingController): self.set_against_income_account() self.validate_c_form() self.validate_time_logs_are_submitted() - validate_recurring_document(self) self.validate_multiple_billing("Delivery Note", "dn_detail", "amount", "delivery_note_details") def on_submit(self): + super(SalesInvoice, self).on_submit() + if cint(self.update_stock) == 1: self.update_stock_ledger() else: @@ -104,7 +99,6 @@ class SalesInvoice(SellingController): self.update_against_document_in_jv() self.update_time_log_batch(self.name) - convert_to_recurring(self, self.posting_date) def before_cancel(self): self.update_time_log_batch(None) @@ -145,14 +139,6 @@ class SalesInvoice(SellingController): 'overflow_type': 'delivery' }) - def on_update_after_submit(self): - validate_recurring_document(self) - convert_to_recurring(self, self.posting_date) - - def before_recurring(self): - self.aging_date = None - self.due_date = None - def get_portal_page(self): return "invoice" if self.docstatus==1 else None diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 549584500f..9433ebe20c 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -206,39 +206,6 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) { } } - -cur_frm.cscript.is_recurring = function(doc, dt, dn) { - // set default values for recurring orders - if(doc.is_recurring) { - var owner_email = doc.owner=="Administrator" - ? frappe.user_info("Administrator").email - : doc.owner; - - doc.notification_email_address = $.map([cstr(owner_email), - cstr(doc.contact_email)], function(v) { return v || null; }).join(", "); - doc.repeat_on_day_of_month = frappe.datetime.str_to_obj(doc.posting_date).getDate(); - } - - refresh_many(["notification_email_address", "repeat_on_day_of_month"]); -} - -cur_frm.cscript.from_date = function(doc, dt, dn) { - // set to_date - if(doc.from_date) { - var recurring_type_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, - 'Yearly': 12}; - - var months = recurring_type_map[doc.recurring_type]; - if(months) { - var to_date = frappe.datetime.add_months(doc.from_date, - months); - doc.to_date = frappe.datetime.add_days(to_date, -1); - refresh_field('to_date'); - } - } -} - - cur_frm.cscript.send_sms = function() { frappe.require("assets/erpnext/js/sms_manager.js"); var sms_man = new SMSManager(cur_frm.doc); diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 7843fb7f57..142781c2bd 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -1,112 +1,112 @@ { -"allow_import": 1, -"autoname": "naming_series:", -"creation": "2013-05-21 16:16:39", -"docstatus": 0, -"doctype": "DocType", -"document_type": "Transaction", -"fields": [ -{ -"fieldname": "supplier_section", -"fieldtype": "Section Break", -"label": "Supplier", -"options": "icon-user", -"permlevel": 0 -}, -{ -"fieldname": "naming_series", -"fieldtype": "Select", -"label": "Series", -"no_copy": 1, -"oldfieldname": "naming_series", -"oldfieldtype": "Select", -"options": "PO-", -"permlevel": 0, -"print_hide": 1, -"reqd": 1 -}, -{ -"description": "Supplier (vendor) name as entered in supplier master", -"fieldname": "supplier", -"fieldtype": "Link", -"in_filter": 1, -"label": "Supplier", -"oldfieldname": "supplier", -"oldfieldtype": "Link", -"options": "Supplier", -"permlevel": 0, -"print_hide": 1, -"reqd": 1, -"search_index": 1 -}, -{ -"fieldname": "supplier_name", -"fieldtype": "Data", -"hidden": 0, -"in_list_view": 1, -"label": "Name", -"permlevel": 0, -"read_only": 1 -}, -{ -"fieldname": "address_display", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Address", -"permlevel": 0, -"read_only": 1 -}, -{ -"fieldname": "contact_display", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Contact", -"permlevel": 0, -"read_only": 1 -}, -{ -"fieldname": "contact_mobile", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Mobile No", -"permlevel": 0, -"read_only": 1 -}, -{ -"fieldname": "contact_email", -"fieldtype": "Small Text", -"hidden": 1, -"label": "Contact Email", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "column_break1", -"fieldtype": "Column Break", -"oldfieldtype": "Column Break", -"permlevel": 0, -"print_hide": 0, -"print_width": "50%", -"width": "50%" -}, -{ -"fieldname": "transaction_date", -"fieldtype": "Date", -"in_filter": 1, -"label": "Date", -"oldfieldname": "transaction_date", -"oldfieldtype": "Date", -"permlevel": 0, -"reqd": 1, -"search_index": 1 -}, -{ -"allow_on_submit": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-21 16:16:39", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "supplier_section", + "fieldtype": "Section Break", + "label": "Supplier", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "PO-", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "description": "Supplier (vendor) name as entered in supplier master", + "fieldname": "supplier", + "fieldtype": "Link", + "in_filter": 1, + "label": "Supplier", + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "supplier_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "allow_on_submit": 1, "description": "Start date of current order's period", "fieldname": "from_date", "fieldtype": "Date", - "label": "From", + "label": "From Date", "no_copy": 1, "permlevel": 0 }, @@ -115,562 +115,562 @@ "description": "End date of current order's period", "fieldname": "to_date", "fieldtype": "Date", - "label": "To", + "label": "To Date", "no_copy": 1, "permlevel": 0 }, { -"fieldname": "amended_from", -"fieldtype": "Link", -"hidden": 0, -"ignore_user_permissions": 1, -"label": "Amended From", -"no_copy": 1, -"oldfieldname": "amended_from", -"oldfieldtype": "Data", -"options": "Purchase Order", -"permlevel": 0, -"print_hide": 1, -"read_only": 1, -"report_hide": 0 -}, -{ -"description": "Select the relevant company name if you have multiple companies", -"fieldname": "company", -"fieldtype": "Link", -"in_filter": 1, -"label": "Company", -"no_copy": 0, -"oldfieldname": "company", -"oldfieldtype": "Link", -"options": "Company", -"permlevel": 0, -"print_hide": 1, -"reqd": 1, -"search_index": 1 -}, -{ -"fieldname": "price_list_and_currency", -"fieldtype": "Section Break", -"label": "Currency and Price List", -"options": "icon-tag", -"permlevel": 0 -}, -{ -"fieldname": "cb_currency", -"fieldtype": "Column Break", -"permlevel": 0 -}, -{ -"fieldname": "currency", -"fieldtype": "Link", -"label": "Currency", -"no_copy": 0, -"oldfieldname": "currency", -"oldfieldtype": "Select", -"options": "Currency", -"permlevel": 0, -"print_hide": 1, -"reqd": 1 -}, -{ -"description": "Rate at which supplier's currency is converted to company's base currency", -"fieldname": "conversion_rate", -"fieldtype": "Float", -"hidden": 0, -"label": "Exchange Rate", -"no_copy": 0, -"oldfieldname": "conversion_rate", -"oldfieldtype": "Currency", -"permlevel": 0, -"print_hide": 1, -"reqd": 1 -}, -{ -"fieldname": "cb_price_list", -"fieldtype": "Column Break", -"permlevel": 0 -}, -{ -"fieldname": "buying_price_list", -"fieldtype": "Link", -"label": "Price List", -"options": "Price List", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "price_list_currency", -"fieldtype": "Link", -"label": "Price List Currency", -"options": "Currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "plc_conversion_rate", -"fieldtype": "Float", -"label": "Price List Exchange Rate", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "ignore_pricing_rule", -"fieldtype": "Check", -"label": "Ignore Pricing Rule", -"no_copy": 1, -"permlevel": 1, -"print_hide": 1 -}, -{ -"fieldname": "items", -"fieldtype": "Section Break", -"label": "Items", -"oldfieldtype": "Section Break", -"options": "icon-shopping-cart", -"permlevel": 0 -}, -{ -"allow_on_submit": 1, -"fieldname": "po_details", -"fieldtype": "Table", -"label": "Purchase Order Items", -"no_copy": 0, -"oldfieldname": "po_details", -"oldfieldtype": "Table", -"options": "Purchase Order Item", -"permlevel": 0 -}, -{ -"fieldname": "sb_last_purchase", -"fieldtype": "Section Break", -"permlevel": 0 -}, -{ -"fieldname": "net_total", -"fieldtype": "Currency", -"label": "Net Total (Company Currency)", -"no_copy": 1, -"oldfieldname": "net_total", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1, -"reqd": 0 -}, -{ -"fieldname": "column_break_26", -"fieldtype": "Column Break", -"permlevel": 0 -}, -{ -"fieldname": "net_total_import", -"fieldtype": "Currency", -"label": "Net Total", -"no_copy": 0, -"oldfieldname": "net_total_import", -"oldfieldtype": "Currency", -"options": "currency", -"permlevel": 0, -"print_hide": 0, -"read_only": 1 -}, -{ -"fieldname": "get_last_purchase_rate", -"fieldtype": "Button", -"label": "Get Last Purchase Rate", -"oldfieldtype": "Button", -"permlevel": 0, -"print_hide": 0 -}, -{ -"fieldname": "taxes", -"fieldtype": "Section Break", -"label": "Taxes and Charges", -"oldfieldtype": "Section Break", -"options": "icon-money", -"permlevel": 0, -"print_hide": 0 -}, -{ -"description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", -"fieldname": "taxes_and_charges", -"fieldtype": "Link", -"label": "Taxes and Charges", -"no_copy": 0, -"oldfieldname": "purchase_other_charges", -"oldfieldtype": "Link", -"options": "Purchase Taxes and Charges Master", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "other_charges", -"fieldtype": "Table", -"label": "Purchase Taxes and Charges", -"no_copy": 0, -"oldfieldname": "purchase_tax_details", -"oldfieldtype": "Table", -"options": "Purchase Taxes and Charges", -"permlevel": 0 -}, -{ -"fieldname": "other_charges_calculation", -"fieldtype": "HTML", -"label": "Taxes and Charges Calculation", -"no_copy": 1, -"oldfieldtype": "HTML", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "totals", -"fieldtype": "Section Break", -"label": "Totals", -"oldfieldtype": "Section Break", -"options": "icon-money", -"permlevel": 0 -}, -{ -"fieldname": "other_charges_added", -"fieldtype": "Currency", -"label": "Taxes and Charges Added (Company Currency)", -"no_copy": 0, -"oldfieldname": "other_charges_added", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "other_charges_deducted", -"fieldtype": "Currency", -"label": "Taxes and Charges Deducted (Company Currency)", -"no_copy": 0, -"oldfieldname": "other_charges_deducted", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "total_tax", -"fieldtype": "Currency", -"label": "Total Tax (Company Currency)", -"no_copy": 1, -"oldfieldname": "total_tax", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "grand_total", -"fieldtype": "Currency", -"label": "Grand Total (Company Currency)", -"no_copy": 1, -"oldfieldname": "grand_total", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"description": "In Words will be visible once you save the Purchase Order.", -"fieldname": "in_words", -"fieldtype": "Data", -"label": "In Words (Company Currency)", -"oldfieldname": "in_words", -"oldfieldtype": "Data", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "rounded_total", -"fieldtype": "Currency", -"label": "Rounded Total (Company Currency)", -"oldfieldname": "rounded_total", -"oldfieldtype": "Currency", -"options": "Company:company:default_currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "advance_paid", -"fieldtype": "Currency", -"label": "Advance Paid", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"fieldname": "column_break4", -"fieldtype": "Column Break", -"oldfieldtype": "Column Break", -"permlevel": 0, -"print_hide": 0 -}, -{ -"fieldname": "other_charges_added_import", -"fieldtype": "Currency", -"label": "Taxes and Charges Added", -"no_copy": 0, -"oldfieldname": "other_charges_added_import", -"oldfieldtype": "Currency", -"options": "currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1, -"report_hide": 0 -}, -{ -"fieldname": "other_charges_deducted_import", -"fieldtype": "Currency", -"label": "Taxes and Charges Deducted", -"no_copy": 0, -"oldfieldname": "other_charges_deducted_import", -"oldfieldtype": "Currency", -"options": "currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1, -"report_hide": 0 -}, -{ -"fieldname": "grand_total_import", -"fieldtype": "Currency", -"in_list_view": 1, -"label": "Grand Total", -"no_copy": 0, -"oldfieldname": "grand_total_import", -"oldfieldtype": "Currency", -"options": "currency", -"permlevel": 0, -"print_hide": 0, -"read_only": 1, -"report_hide": 0 -}, -{ -"fieldname": "in_words_import", -"fieldtype": "Data", -"label": "In Words", -"oldfieldname": "in_words_import", -"oldfieldtype": "Data", -"permlevel": 0, -"print_hide": 0, -"read_only": 1 -}, -{ -"fieldname": "fold", -"fieldtype": "Fold", -"permlevel": 0 -}, -{ -"fieldname": "terms_section_break", -"fieldtype": "Section Break", -"label": "Terms and Conditions", -"oldfieldtype": "Section Break", -"options": "icon-legal", -"permlevel": 0 -}, -{ -"fieldname": "tc_name", -"fieldtype": "Link", -"label": "Terms", -"oldfieldname": "tc_name", -"oldfieldtype": "Link", -"options": "Terms and Conditions", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "terms", -"fieldtype": "Text Editor", -"label": "Terms and Conditions", -"oldfieldname": "terms", -"oldfieldtype": "Text Editor", -"permlevel": 0 -}, -{ -"depends_on": "supplier", -"fieldname": "contact_section", -"fieldtype": "Section Break", -"label": "Contact Info", -"options": "icon-bullhorn", -"permlevel": 0 -}, -{ -"fieldname": "supplier_address", -"fieldtype": "Link", -"in_filter": 1, -"label": "Supplier Address", -"options": "Address", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "cb_contact", -"fieldtype": "Column Break", -"permlevel": 0 -}, -{ -"fieldname": "contact_person", -"fieldtype": "Link", -"in_filter": 1, -"label": "Contact Person", -"options": "Contact", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "more_info", -"fieldtype": "Section Break", -"label": "More Info", -"oldfieldtype": "Section Break", -"permlevel": 0 -}, -{ -"fieldname": "status", -"fieldtype": "Select", -"in_filter": 1, -"label": "Status", -"no_copy": 1, -"oldfieldname": "status", -"oldfieldtype": "Select", -"options": "\nDraft\nSubmitted\nStopped\nCancelled", -"permlevel": 0, -"print_hide": 1, -"read_only": 1, -"reqd": 1, -"search_index": 1 -}, -{ -"default": "No", -"fieldname": "is_subcontracted", -"fieldtype": "Select", -"label": "Is Subcontracted", -"options": "\nYes\nNo", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "ref_sq", -"fieldtype": "Data", -"hidden": 1, -"label": "Ref SQ", -"no_copy": 1, -"oldfieldname": "ref_sq", -"oldfieldtype": "Data", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"allow_on_submit": 1, -"fieldname": "letter_head", -"fieldtype": "Link", -"label": "Letter Head", -"oldfieldname": "letter_head", -"oldfieldtype": "Select", -"options": "Letter Head", -"permlevel": 0, -"print_hide": 1 -}, -{ -"fieldname": "fiscal_year", -"fieldtype": "Link", -"in_filter": 1, -"label": "Fiscal Year", -"no_copy": 0, -"oldfieldname": "fiscal_year", -"oldfieldtype": "Select", -"options": "Fiscal Year", -"permlevel": 0, -"print_hide": 1, -"reqd": 1, -"search_index": 1 -}, -{ -"allow_on_submit": 1, -"fieldname": "select_print_heading", -"fieldtype": "Link", -"label": "Print Heading", -"no_copy": 1, -"oldfieldname": "select_print_heading", -"oldfieldtype": "Link", -"options": "Print Heading", -"permlevel": 0, -"print_hide": 1, -"report_hide": 1 -}, -{ -"fieldname": "column_break5", -"fieldtype": "Column Break", -"oldfieldtype": "Column Break", -"permlevel": 0, -"print_hide": 1, -"print_width": "50%", -"width": "50%" -}, -{ -"depends_on": "eval:!doc.__islocal", -"description": "% of materials received against this Purchase Order", -"fieldname": "per_received", -"fieldtype": "Percent", -"in_list_view": 1, -"label": "% Received", -"no_copy": 1, -"oldfieldname": "per_received", -"oldfieldtype": "Currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"depends_on": "eval:!doc.__islocal", -"description": "% of materials billed against this Purchase Order.", -"fieldname": "per_billed", -"fieldtype": "Percent", -"in_list_view": 1, -"label": "% Billed", -"no_copy": 1, -"oldfieldname": "per_billed", -"oldfieldtype": "Currency", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 -}, -{ -"description": "Required raw materials issued to the supplier for producing a sub - contracted item.", -"fieldname": "raw_material_details", -"fieldtype": "Section Break", -"label": "Raw Materials Supplied", -"oldfieldtype": "Section Break", -"options": "icon-truck", -"permlevel": 0, -"print_hide": 1 -}, -{ -"allow_on_submit": 1, -"fieldname": "po_raw_material_details", -"fieldtype": "Table", -"label": "Purchase Order Items Supplied", -"no_copy": 0, -"oldfieldname": "po_raw_material_details", -"oldfieldtype": "Table", -"options": "Purchase Order Item Supplied", -"permlevel": 0, -"print_hide": 1, -"read_only": 1 - }, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "options": "Purchase Order", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "description": "Select the relevant company name if you have multiple companies", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "no_copy": 0, + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "price_list_and_currency", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0 + }, + { + "fieldname": "cb_currency", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "no_copy": 0, + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "description": "Rate at which supplier's currency is converted to company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "hidden": 0, + "label": "Exchange Rate", + "no_copy": 0, + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "cb_price_list", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "ignore_pricing_rule", + "fieldtype": "Check", + "label": "Ignore Pricing Rule", + "no_copy": 1, + "permlevel": 1, + "print_hide": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "po_details", + "fieldtype": "Table", + "label": "Purchase Order Items", + "no_copy": 0, + "oldfieldname": "po_details", + "oldfieldtype": "Table", + "options": "Purchase Order Item", + "permlevel": 0 + }, + { + "fieldname": "sb_last_purchase", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "no_copy": 1, + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "column_break_26", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "no_copy": 0, + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "get_last_purchase_rate", + "fieldtype": "Button", + "label": "Get Last Purchase Rate", + "oldfieldtype": "Button", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 0 + }, + { + "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "no_copy": 0, + "oldfieldname": "purchase_other_charges", + "oldfieldtype": "Link", + "options": "Purchase Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "no_copy": 0, + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges", + "permlevel": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "no_copy": 1, + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0 + }, + { + "fieldname": "other_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "no_copy": 0, + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "no_copy": 0, + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_tax", + "fieldtype": "Currency", + "label": "Total Tax (Company Currency)", + "no_copy": 1, + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "no_copy": 1, + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "In Words will be visible once you save the Purchase Order.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "advance_paid", + "fieldtype": "Currency", + "label": "Advance Paid", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "no_copy": 0, + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "no_copy": 0, + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "no_copy": 0, + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "fold", + "fieldtype": "Fold", + "permlevel": 0 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0 + }, + { + "depends_on": "supplier", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0 + }, + { + "fieldname": "supplier_address", + "fieldtype": "Link", + "in_filter": 1, + "label": "Supplier Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "cb_contact", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "in_filter": 1, + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nStopped\nCancelled", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 1 + }, + { + "default": "No", + "fieldname": "is_subcontracted", + "fieldtype": "Select", + "label": "Is Subcontracted", + "options": "\nYes\nNo", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "ref_sq", + "fieldtype": "Data", + "hidden": 1, + "label": "Ref SQ", + "no_copy": 1, + "oldfieldname": "ref_sq", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "Letter Head", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Link", + "in_filter": 1, + "label": "Fiscal Year", + "no_copy": 0, + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "column_break5", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "print_width": "50%", + "width": "50%" + }, + { + "depends_on": "eval:!doc.__islocal", + "description": "% of materials received against this Purchase Order", + "fieldname": "per_received", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "% Received", + "no_copy": 1, + "oldfieldname": "per_received", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "description": "% of materials billed against this Purchase Order.", + "fieldname": "per_billed", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "% Billed", + "no_copy": 1, + "oldfieldname": "per_billed", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "Required raw materials issued to the supplier for producing a sub - contracted item.", + "fieldname": "raw_material_details", + "fieldtype": "Section Break", + "label": "Raw Materials Supplied", + "oldfieldtype": "Section Break", + "options": "icon-truck", + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "po_raw_material_details", + "fieldtype": "Table", + "label": "Purchase Order Items Supplied", + "no_copy": 0, + "oldfieldname": "po_raw_material_details", + "oldfieldtype": "Table", + "options": "Purchase Order Item Supplied", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, { "fieldname": "recurring_order", "fieldtype": "Section Break", @@ -765,92 +765,81 @@ "no_copy": 1, "permlevel": 0, "print_hide": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-09-18 03:16:06.299317", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Order", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 1, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 }, { - "fieldname": "against_income_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Income Account", - "no_copy": 1, + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, "permlevel": 0, - "print_hide": 1, - "report_hide": 1 -} -], -"icon": "icon-file-text", -"idx": 1, -"is_submittable": 1, -"modified": "2014-09-10 05:35:32.583024", -"modified_by": "Administrator", -"module": "Buying", -"name": "Purchase Order", -"owner": "Administrator", -"permissions": [ -{ -"amend": 0, -"apply_user_permissions": 1, -"cancel": 0, -"create": 0, -"delete": 0, -"email": 0, -"permlevel": 0, -"print": 0, -"read": 1, -"report": 1, -"role": "Material User", -"submit": 0, -"write": 0 -}, -{ -"amend": 1, -"cancel": 1, -"create": 1, -"delete": 1, -"email": 1, -"permlevel": 0, -"print": 1, -"read": 1, -"report": 1, -"role": "Purchase Manager", -"submit": 1, -"write": 1 -}, -{ -"amend": 1, -"apply_user_permissions": 1, -"cancel": 1, -"create": 1, -"delete": 1, -"email": 1, -"permlevel": 0, -"print": 1, -"read": 1, -"report": 1, -"role": "Purchase User", -"submit": 1, -"write": 1 -}, -{ -"apply_user_permissions": 1, -"cancel": 0, -"delete": 0, -"email": 1, -"permlevel": 0, -"print": 1, -"read": 1, -"report": 1, -"role": "Supplier" -}, -{ -"permlevel": 1, -"read": 1, -"role": "Purchase Manager", -"write": 1 -} -], -"read_only_onload": 1, -"search_fields": "status, transaction_date, supplier,grand_total", -"sort_field": "modified", -"sort_order": "DESC" -} - + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "apply_user_permissions": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 1, + "write": 1 + }, + { + "apply_user_permissions": 1, + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Supplier" + }, + { + "permlevel": 1, + "read": 1, + "role": "Purchase Manager", + "write": 1 + } + ], + "read_only_onload": 1, + "search_fields": "status, transaction_date, supplier,grand_total", + "sort_field": "modified", + "sort_order": "DESC" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 5ad874718a..0bfd3e558b 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -6,9 +6,6 @@ import frappe from frappe.utils import cstr, flt from frappe import msgprint, _, throw from frappe.model.mapper import get_mapped_doc - -from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document - from erpnext.controllers.buying_controller import BuyingController form_grid_templates = { @@ -55,8 +52,6 @@ class PurchaseOrder(BuyingController): self.validate_for_subcontracting() self.validate_minimum_order_qty() self.create_raw_materials_supplied("po_raw_material_details") - - validate_recurring_document(self) def validate_with_previous_doc(self): super(PurchaseOrder, self).validate_with_previous_doc(self.tname, { @@ -167,6 +162,8 @@ class PurchaseOrder(BuyingController): msgprint(_("Status of {0} {1} is now {2}").format(self.doctype, self.name, status)) def on_submit(self): + super(PurchaseOrder, self).on_submit() + purchase_controller = frappe.get_doc("Purchase Common") self.update_prevdoc_status() @@ -178,8 +175,6 @@ class PurchaseOrder(BuyingController): purchase_controller.update_last_purchase_rate(self, is_submit = 1) frappe.db.set(self,'status','Submitted') - - convert_to_recurring(self, self.transaction_date) def on_cancel(self): pc_obj = frappe.get_doc('Purchase Common') @@ -204,10 +199,6 @@ class PurchaseOrder(BuyingController): def on_update(self): pass - def on_update_after_submit(self): - validate_recurring_document(self) - convert_to_recurring(self, self.transaction_date) - def set_missing_values(source, target): target.ignore_pricing_rule = 1 target.run_method("set_missing_values") diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 0c9f912dbb..83853dd7f3 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -109,7 +109,6 @@ class TestPurchaseOrder(unittest.TestCase): def test_recurring_order(self): from erpnext.controllers.tests.test_recurring_document import test_recurring_document - test_recurring_document(self, test_records) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 7fa81c9926..4c6c332d37 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -4,12 +4,11 @@ from __future__ import unicode_literals import frappe from frappe import _, throw -from frappe.utils import add_days, cint, cstr, today, date_diff, flt, getdate, nowdate, \ - get_first_day, get_last_day -from frappe.model.naming import make_autoname +from frappe.utils import cint, today, flt from erpnext.setup.utils import get_company_currency, get_exchange_rate from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year from erpnext.utilities.transaction_base import TransactionBase +from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document import json class AccountsController(TransactionBase): @@ -24,6 +23,24 @@ class AccountsController(TransactionBase): self.validate_for_freezed_account() + if self.meta.get_field("is_recurring"): + validate_recurring_document(self) + + def on_submit(self): + if self.meta.get_field("is_recurring"): + convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date")) + + def on_update_after_submit(self): + if self.meta.get_field("is_recurring"): + validate_recurring_document(self) + convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date")) + + def before_recurring(self): + self.fiscal_year = None + for fieldname in ("due_date", "aging_date"): + if self.meta.get_field(fieldname): + self.set(fieldname, None) + def set_missing_values(self, for_validate=False): for fieldname in ["posting_date", "transaction_date"]: if not self.get(fieldname) and self.meta.get_field(fieldname): @@ -421,7 +438,6 @@ class AccountsController(TransactionBase): max_allowed_amt = flt(ref_amt * (100 + tolerance) / 100) if total_billed_amt - max_allowed_amt > 0.01: - reduce_by = total_billed_amt - max_allowed_amt frappe.throw(_("Cannot overbill for Item {0} in row {0} more than {1}. To allow overbilling, please set in Stock Settings").format(item.item_code, item.idx, max_allowed_amt)) def get_company_default(self, fieldname): diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index a3f59082f6..69ab661616 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -4,10 +4,7 @@ from __future__ import unicode_literals import frappe from frappe import _, msgprint - -from frappe.utils import add_days, cint, cstr, today, date_diff, flt, rounded, getdate, nowdate, \ - get_first_day, get_last_day -from frappe.model.naming import make_autoname +from frappe.utils import flt, rounded from erpnext.setup.utils import get_company_currency from erpnext.accounts.party import get_party_details diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py index 7c8321493b..fa7f275309 100644 --- a/erpnext/controllers/recurring_document.py +++ b/erpnext/controllers/recurring_document.py @@ -12,6 +12,12 @@ from erpnext.accounts.party import get_party_account, get_due_date, get_party_de from frappe.model.mapper import get_mapped_doc month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} +date_field_map = { + "Sales Order": "transaction_date", + "Sales Invoice": "posting_date", + "Purchase Order": "transaction_date", + "Purchase Invoice": "posting_date" +} def create_recurring_documents(): manage_recurring_documents("Sales Order") @@ -26,14 +32,7 @@ def manage_recurring_documents(doctype, next_date=None, commit=True): """ next_date = next_date or nowdate() - if doctype == "Sales Order": - date_field = "transaction_date" - elif doctype == "Sales Invoice": - date_field = "posting_date" - elif doctype == "Purchase Order": - date_field = "transaction_date" - elif doctype == "Purchase Invoice": - date_field = "posting_date" + date_field = date_field_map[doctype] recurring_documents = frappe.db.sql("""select name, recurring_id from `tab{}` where ifnull(is_recurring, 0)=1 @@ -60,9 +59,10 @@ def manage_recurring_documents(doctype, next_date=None, commit=True): frappe.db.begin() frappe.db.sql("update `tab%s` \ - set is_recurring = 0 where name = %s" % (doctype, '%s'), + set is_recurring = 0 where name = %s" % (doctype, '%s'), (ref_document)) - notify_errors(ref_document, doctype, ref_wrapper.customer, ref_wrapper.owner) + notify_errors(ref_document, doctype, ref_wrapper.get("customer") or ref_wrapper.get("supplier"), + ref_wrapper.owner) frappe.db.commit() exception_list.append(frappe.get_traceback()) @@ -129,7 +129,7 @@ def send_notification(new_rv): "fcontent": frappe.get_print_format(new_rv.doctype, new_rv.name, as_pdf=True) }]) -def notify_errors(doc, doctype, customer, owner): +def notify_errors(doc, doctype, party, owner): from frappe.utils.user import get_system_managers recipients = get_system_managers(only_name=True) @@ -138,7 +138,7 @@ def notify_errors(doc, doctype, customer, owner): message = frappe.get_template("templates/emails/recurring_document_failed.html").render({ "type": doctype, "name": doc, - "customer": customer + "party": party })) assign_task_to_owner(doc, doctype, "Recurring Invoice Failed", recipients) diff --git a/erpnext/controllers/tests/test_recurring_document.py b/erpnext/controllers/tests/test_recurring_document.py index 1051082488..e5c6513147 100644 --- a/erpnext/controllers/tests/test_recurring_document.py +++ b/erpnext/controllers/tests/test_recurring_document.py @@ -2,12 +2,8 @@ # License: GNU General Public License v3. See license.txt import frappe -import unittest, json, copy -from frappe.utils import flt import frappe.permissions -from erpnext.accounts.utils import get_stock_and_account_difference -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory -from erpnext.projects.doctype.time_log_batch.test_time_log_batch import * +from erpnext.controllers.recurring_document import date_field_map def test_recurring_document(obj, test_records): from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate, add_days @@ -27,34 +23,11 @@ def test_recurring_document(obj, test_records): "to_date": get_last_day(today) }) - if base_doc.doctype == "Sales Order": - base_doc.update({ - "transaction_date": today, - "delivery_date": add_days(today, 15) - }) - elif base_doc.doctype == "Sales Invoice": - base_doc.update({ - "posting_date": today - }) + date_field = date_field_map[base_doc.doctype] + base_doc.set(date_field, today) if base_doc.doctype == "Sales Order": - date_field = "transaction_date" - elif base_doc.doctype == "Sales Invoice": - date_field = "posting_date" - #for Purchase order/purchase invoice - if base_doc.doctype == "Purchase Order": - base_doc.update({ - "transaction_date": today - }) - elif base_doc.doctype == "Purchase Invoice": - base_doc.update({ - "posting_date": today - }) - - if base_doc.doctype == "Purchase Order": - date_field = "transaction_date" - elif base_doc.doctype == "Purchase Invoice": - date_field = "posting_date" + base_doc.set("delivery_date", add_days(today, 15)) # monthly doc1 = frappe.copy_doc(base_doc) @@ -142,7 +115,7 @@ def _test_recurring_document(obj, base_doc, date_field, first_and_last_day): next_date = get_next_date(base_doc.get(date_field), no_of_months, base_doc.repeat_on_day_of_month) - + manage_recurring_documents(base_doc.doctype, next_date=next_date, commit=False) recurred_documents = frappe.db.sql("""select name from `tab%s` diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index d5209c1874..3a12485019 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -155,7 +155,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ project_name: item.project_name || me.frm.doc.project_name } }, - + callback: function(r) { if(!r.exc) { me.frm.script_manager.trigger("price_list_rate", cdt, cdn); @@ -827,4 +827,35 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ .appendTo($(this.frm.fields_dict.other_charges_calculation.wrapper).empty()); } }, + + is_recurring: function() { + // set default values for recurring documents + if(this.frm.doc.is_recurring) { + var owner_email = this.frm.doc.owner=="Administrator" + ? frappe.user_info("Administrator").email + : this.frm.doc.owner; + + this.frm.doc.notification_email_address = $.map([cstr(owner_email), + cstr(this.frm.doc.contact_email)], function(v) { return v || null; }).join(", "); + this.frm.doc.repeat_on_day_of_month = frappe.datetime.str_to_obj(this.frm.doc.posting_date).getDate(); + } + + refresh_many(["notification_email_address", "repeat_on_day_of_month"]); + }, + + from_date: function() { + // set to_date + if(this.frm.doc.from_date) { + var recurring_type_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, + 'Yearly': 12}; + + var months = recurring_type_map[this.frm.doc.recurring_type]; + if(months) { + var to_date = frappe.datetime.add_months(this.frm.doc.from_date, + months); + this.frm.doc.to_date = frappe.datetime.add_days(to_date, -1); + refresh_field('to_date'); + } + } + } }); diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 4797230ad0..628e43e1df 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -195,37 +195,6 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) { } }; -cur_frm.cscript.is_recurring = function(doc, dt, dn) { - // set default values for recurring orders - if(doc.is_recurring) { - var owner_email = doc.owner=="Administrator" - ? frappe.user_info("Administrator").email - : doc.owner; - - doc.notification_email_address = $.map([cstr(owner_email), - cstr(doc.contact_email)], function(v) { return v || null; }).join(", "); - doc.repeat_on_day_of_month = frappe.datetime.str_to_obj(doc.posting_date).getDate(); - } - - refresh_many(["notification_email_address", "repeat_on_day_of_month"]); -} - -cur_frm.cscript.from_date = function(doc, dt, dn) { - // set to_date - if(doc.from_date) { - var recurring_type_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, - 'Yearly': 12}; - - var months = recurring_type_map[doc.recurring_type]; - if(months) { - var to_date = frappe.datetime.add_months(doc.from_date, - months); - doc.to_date = frappe.datetime.add_days(to_date, -1); - refresh_field('to_date'); - } - } -} - cur_frm.cscript.send_sms = function() { frappe.require("assets/erpnext/js/sms_manager.js"); var sms_man = new SMSManager(cur_frm.doc); diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index 844e8cd2e0..c22ed3f48d 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -1,1122 +1,1112 @@ { - "allow_import": 1, - "autoname": "naming_series:", - "creation": "2013-06-18 12:39:59", - "docstatus": 0, - "doctype": "DocType", - "document_type": "Transaction", + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-06-18 12:39:59", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", "fields": [ { - "fieldname": "customer_section", - "fieldtype": "Section Break", - "label": "Customer", - "options": "icon-user", + "fieldname": "customer_section", + "fieldtype": "Section Break", + "label": "Customer", + "options": "icon-user", "permlevel": 0 - }, + }, { - "fieldname": "column_break0", - "fieldtype": "Column Break", - "in_filter": 0, - "oldfieldtype": "Column Break", - "permlevel": 0, - "search_index": 0, + "fieldname": "column_break0", + "fieldtype": "Column Break", + "in_filter": 0, + "oldfieldtype": "Column Break", + "permlevel": 0, + "search_index": 0, "width": "50%" - }, + }, { - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "SO-", - "permlevel": 0, - "print_hide": 1, + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "SO-", + "permlevel": 0, + "print_hide": 1, "reqd": 1 - }, + }, { - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, "search_index": 1 - }, + }, { - "fieldname": "customer_name", - "fieldtype": "Data", - "hidden": 0, - "label": "Name", - "permlevel": 0, + "fieldname": "customer_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Name", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "permlevel": 0, + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "permlevel": 0, + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "contact_mobile", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Mobile No", - "permlevel": 0, + "fieldname": "contact_mobile", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "contact_email", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact Email", - "permlevel": 0, - "print_hide": 1, + "fieldname": "contact_email", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "default": "Sales", - "fieldname": "order_type", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Order Type", - "oldfieldname": "order_type", - "oldfieldtype": "Select", - "options": "\nSales\nMaintenance\nShopping Cart", - "permlevel": 0, - "print_hide": 1, + "default": "Sales", + "fieldname": "order_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Order Type", + "oldfieldname": "order_type", + "oldfieldtype": "Select", + "options": "\nSales\nMaintenance\nShopping Cart", + "permlevel": 0, + "print_hide": 1, "reqd": 1 - }, + }, { - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, "width": "50%" - }, + }, { - "fieldname": "amended_from", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "options": "Sales Order", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "options": "Sales Order", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "width": "150px" - }, + }, { - "description": "Select the relevant company name if you have multiple companies.", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, - "search_index": 1, + "description": "Select the relevant company name if you have multiple companies.", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1, "width": "150px" - }, + }, { - "default": "Today", - "fieldname": "transaction_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Date", - "no_copy": 1, - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 0, - "reqd": 1, - "search_index": 1, + "default": "Today", + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Date", + "no_copy": 1, + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "reqd": 1, + "search_index": 1, "width": "160px" - }, + }, { - "depends_on": "eval:doc.order_type == 'Sales'", - "fieldname": "delivery_date", - "fieldtype": "Date", - "hidden": 0, - "in_filter": 1, - "label": "Delivery Date", - "oldfieldname": "delivery_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "reqd": 0, - "search_index": 1, + "depends_on": "eval:doc.order_type == 'Sales'", + "fieldname": "delivery_date", + "fieldtype": "Date", + "hidden": 0, + "in_filter": 1, + "label": "Delivery Date", + "oldfieldname": "delivery_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "reqd": 0, + "search_index": 1, "width": "160px" - }, + }, { - "allow_on_submit": 1, - "description": "Start date of current order's period", - "fieldname": "from_date", - "fieldtype": "Date", - "label": "From", - "no_copy": 1, + "allow_on_submit": 1, + "description": "Start date of current order's period", + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From Date", + "no_copy": 1, "permlevel": 0 - }, + }, { - "allow_on_submit": 1, - "description": "End date of current order's period", - "fieldname": "to_date", - "fieldtype": "Date", - "label": "To", - "no_copy": 1, + "allow_on_submit": 1, + "description": "End date of current order's period", + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To Date", + "no_copy": 1, "permlevel": 0 - }, + }, { - "description": "Customer's Purchase Order Number", - "fieldname": "po_no", - "fieldtype": "Data", - "hidden": 0, - "label": "PO No", - "oldfieldname": "po_no", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "reqd": 0, + "description": "Customer's Purchase Order Number", + "fieldname": "po_no", + "fieldtype": "Data", + "hidden": 0, + "label": "PO No", + "oldfieldname": "po_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "reqd": 0, "width": "100px" - }, + }, { - "depends_on": "eval:doc.po_no", - "description": "Customer's Purchase Order Date", - "fieldname": "po_date", - "fieldtype": "Date", - "hidden": 0, - "label": "PO Date", - "oldfieldname": "po_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 0, - "reqd": 0, + "depends_on": "eval:doc.po_no", + "description": "Customer's Purchase Order Date", + "fieldname": "po_date", + "fieldtype": "Date", + "hidden": 0, + "label": "PO Date", + "oldfieldname": "po_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "reqd": 0, "width": "100px" - }, + }, { - "fieldname": "shipping_address_name", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "label": "Shipping Address", - "options": "Address", - "permlevel": 0, - "print_hide": 1, + "fieldname": "shipping_address_name", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "label": "Shipping Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "shipping_address", - "fieldtype": "Small Text", - "hidden": 1, - "in_filter": 0, - "label": "Shipping Address", - "permlevel": 0, - "print_hide": 1, + "fieldname": "shipping_address", + "fieldtype": "Small Text", + "hidden": 1, + "in_filter": 0, + "label": "Shipping Address", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "sec_break45", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag", - "permlevel": 0, + "fieldname": "sec_break45", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, "width": "100px" - }, + }, { - "description": "Rate at which customer's currency is converted to company's base currency", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, + "description": "Rate at which customer's currency is converted to company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, "width": "100px" - }, + }, { - "fieldname": "column_break2", - "fieldtype": "Column Break", - "permlevel": 0, + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, "width": "50%" - }, + }, { - "fieldname": "selling_price_list", - "fieldtype": "Link", - "label": "Price List", - "oldfieldname": "price_list_name", - "oldfieldtype": "Select", - "options": "Price List", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, + "fieldname": "selling_price_list", + "fieldtype": "Link", + "label": "Price List", + "oldfieldname": "price_list_name", + "oldfieldtype": "Select", + "options": "Price List", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, "width": "100px" - }, + }, { - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "reqd": 1 - }, + }, { - "description": "Rate at which Price list currency is converted to company's base currency", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "permlevel": 0, - "print_hide": 1, + "description": "Rate at which Price list currency is converted to company's base currency", + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1, "reqd": 1 - }, + }, { - "fieldname": "ignore_pricing_rule", - "fieldtype": "Check", - "label": "Ignore Pricing Rule", - "no_copy": 1, - "permlevel": 1, + "fieldname": "ignore_pricing_rule", + "fieldtype": "Check", + "label": "Ignore Pricing Rule", + "no_copy": 1, + "permlevel": 1, "print_hide": 1 - }, + }, { - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", "permlevel": 0 - }, + }, { - "allow_on_submit": 1, - "fieldname": "sales_order_details", - "fieldtype": "Table", - "label": "Sales Order Items", - "oldfieldname": "sales_order_details", - "oldfieldtype": "Table", - "options": "Sales Order Item", - "permlevel": 0, - "print_hide": 0, + "allow_on_submit": 1, + "fieldname": "sales_order_details", + "fieldtype": "Table", + "label": "Sales Order Items", + "oldfieldname": "sales_order_details", + "oldfieldtype": "Table", + "options": "Sales Order Item", + "permlevel": 0, + "print_hide": 0, "reqd": 1 - }, + }, { - "fieldname": "section_break_31", - "fieldtype": "Section Break", + "fieldname": "section_break_31", + "fieldtype": "Section Break", "permlevel": 0 - }, + }, { - "fieldname": "column_break_33a", - "fieldtype": "Column Break", + "fieldname": "column_break_33a", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "column_break_33", - "fieldtype": "Column Break", + "fieldname": "column_break_33", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "net_total_export", - "fieldtype": "Currency", - "label": "Net Total", - "options": "currency", - "permlevel": 0, + "fieldname": "net_total_export", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "reqd": 0, + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, "width": "150px" - }, + }, { - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, "print_hide": 0 - }, + }, { - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "charge", - "oldfieldtype": "Link", - "options": "Sales Taxes and Charges Master", - "permlevel": 0, + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "charge", + "oldfieldtype": "Link", + "options": "Sales Taxes and Charges Master", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "column_break_38", - "fieldtype": "Column Break", + "fieldname": "column_break_38", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "shipping_rule", - "fieldtype": "Link", - "label": "Shipping Rule", - "oldfieldtype": "Button", - "options": "Shipping Rule", - "permlevel": 0, + "fieldname": "shipping_rule", + "fieldtype": "Link", + "label": "Shipping Rule", + "oldfieldtype": "Button", + "options": "Shipping Rule", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "section_break_40", - "fieldtype": "Section Break", + "fieldname": "section_break_40", + "fieldtype": "Section Break", "permlevel": 0 - }, + }, { - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Sales Taxes and Charges", - "oldfieldname": "other_charges", - "oldfieldtype": "Table", - "options": "Sales Taxes and Charges", + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Sales Taxes and Charges", + "oldfieldname": "other_charges", + "oldfieldtype": "Table", + "options": "Sales Taxes and Charges", "permlevel": 0 - }, + }, { - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "permlevel": 0, + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "section_break_43", - "fieldtype": "Section Break", + "fieldname": "section_break_43", + "fieldtype": "Section Break", "permlevel": 0 - }, + }, { - "fieldname": "other_charges_total_export", - "fieldtype": "Currency", - "label": "Taxes and Charges Total", - "options": "currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "other_charges_total_export", + "fieldtype": "Currency", + "label": "Taxes and Charges Total", + "options": "currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "column_break_46", - "fieldtype": "Column Break", + "fieldname": "column_break_46", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "other_charges_total", - "fieldtype": "Currency", - "label": "Taxes and Charges Total (Company Currency)", - "oldfieldname": "other_charges_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "fieldname": "other_charges_total", + "fieldtype": "Currency", + "label": "Taxes and Charges Total (Company Currency)", + "oldfieldname": "other_charges_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "width": "150px" - }, + }, { - "fieldname": "discount_amount", - "fieldtype": "Currency", - "label": "Discount Amount", - "options": "Company:company:default_currency", + "fieldname": "discount_amount", + "fieldtype": "Currency", + "label": "Discount Amount", + "options": "Company:company:default_currency", "permlevel": 0 - }, + }, { - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "reqd": 0, + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, "width": "150px" - }, + }, { - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "width": "150px" - }, + }, { - "description": "In Words will be visible once you save the Sales Order.", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "description": "In Words will be visible once you save the Sales Order.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "width": "200px" - }, + }, { - "fieldname": "advance_paid", - "fieldtype": "Currency", - "label": "Advance Paid", - "permlevel": 0, - "print_hide": 1, + "fieldname": "advance_paid", + "fieldtype": "Currency", + "label": "Advance Paid", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, "width": "50%" - }, + }, { - "fieldname": "grand_total_export", - "fieldtype": "Currency", - "label": "Grand Total", - "oldfieldname": "grand_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "reqd": 0, + "fieldname": "grand_total_export", + "fieldtype": "Currency", + "label": "Grand Total", + "oldfieldname": "grand_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "reqd": 0, "width": "150px" - }, + }, { - "fieldname": "rounded_total_export", - "fieldtype": "Currency", - "label": "Rounded Total", - "oldfieldname": "rounded_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, + "fieldname": "rounded_total_export", + "fieldtype": "Currency", + "label": "Rounded Total", + "oldfieldname": "rounded_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, "width": "150px" - }, + }, { - "fieldname": "in_words_export", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_export", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, + "fieldname": "in_words_export", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_export", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, "width": "200px" - }, + }, { - "fieldname": "view_details", - "fieldtype": "Fold", - "label": "View Details", + "fieldname": "view_details", + "fieldtype": "Fold", + "label": "View Details", "permlevel": 0 - }, + }, { - "description": "Display all the individual items delivered with the main items", - "fieldname": "packing_list", - "fieldtype": "Section Break", - "hidden": 0, - "label": "Packing List", - "oldfieldtype": "Section Break", - "options": "icon-suitcase", - "permlevel": 0, + "description": "Display all the individual items delivered with the main items", + "fieldname": "packing_list", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Packing List", + "oldfieldtype": "Section Break", + "options": "icon-suitcase", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "packing_details", - "fieldtype": "Table", - "label": "Packing Details", - "oldfieldname": "packing_details", - "oldfieldtype": "Table", - "options": "Packed Item", - "permlevel": 0, - "print_hide": 1, + "fieldname": "packing_details", + "fieldtype": "Table", + "label": "Packing Details", + "oldfieldname": "packing_details", + "oldfieldtype": "Table", + "options": "Packed Item", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal", - "permlevel": 0, + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0, "print_hide": 0 - }, + }, { - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "permlevel": 0, - "print_hide": 1, + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1, "search_index": 0 - }, + }, { - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions Details", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor", - "permlevel": 0, + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions Details", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0, "print_hide": 0 - }, + }, { - "depends_on": "customer", - "fieldname": "contact_info", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn", + "depends_on": "customer", + "fieldname": "contact_info", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", "permlevel": 0 - }, + }, { - "fieldname": "col_break45", - "fieldtype": "Column Break", - "permlevel": 0, + "fieldname": "col_break45", + "fieldtype": "Column Break", + "permlevel": 0, "width": "50%" - }, + }, { - "description": "Add / Edit", - "fieldname": "territory", - "fieldtype": "Link", - "in_filter": 1, - "label": "Territory", - "options": "Territory", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_filter": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, "search_index": 1 - }, + }, { - "description": "Add / Edit", - "fieldname": "customer_group", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer Group", - "options": "Customer Group", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, "search_index": 1 - }, + }, { - "fieldname": "col_break46", - "fieldtype": "Column Break", - "permlevel": 0, + "fieldname": "col_break46", + "fieldtype": "Column Break", + "permlevel": 0, "width": "50%" - }, + }, { - "fieldname": "customer_address", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Customer Address", - "options": "Address", - "permlevel": 0, + "fieldname": "customer_address", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Customer Address", + "options": "Address", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "contact_person", - "fieldtype": "Link", - "in_filter": 1, - "label": "Contact Person", - "options": "Contact", - "permlevel": 0, + "fieldname": "contact_person", + "fieldtype": "Link", + "in_filter": 1, + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "permlevel": 0, + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, "print_hide": 1 - }, + }, { - "description": "Track this Sales Order against any Project", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "oldfieldname": "project_name", - "oldfieldtype": "Link", - "options": "Project", - "permlevel": 0, + "description": "Track this Sales Order against any Project", + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "oldfieldname": "project_name", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0, "search_index": 1 - }, + }, { - "depends_on": "eval:doc.source == 'Campaign'", - "fieldname": "campaign", - "fieldtype": "Link", - "label": "Campaign", - "oldfieldname": "campaign", - "oldfieldtype": "Link", - "options": "Campaign", - "permlevel": 0, + "depends_on": "eval:doc.source == 'Campaign'", + "fieldname": "campaign", + "fieldtype": "Link", + "label": "Campaign", + "oldfieldname": "campaign", + "oldfieldtype": "Link", + "options": "Campaign", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "source", - "fieldtype": "Select", - "label": "Source", - "oldfieldname": "source", - "oldfieldtype": "Select", - "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", - "permlevel": 0, + "fieldname": "source", + "fieldtype": "Select", + "label": "Source", + "oldfieldname": "source", + "oldfieldtype": "Select", + "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, "width": "50%" - }, + }, { - "allow_on_submit": 1, - "fieldname": "letter_head", - "fieldtype": "Link", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "Letter Head", - "permlevel": 0, + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "Letter Head", + "permlevel": 0, "print_hide": 1 - }, + }, { - "allow_on_submit": 1, - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "permlevel": 0, - "print_hide": 1, + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, "report_hide": 1 - }, + }, { - "fieldname": "fiscal_year", - "fieldtype": "Link", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "Fiscal Year", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, - "search_index": 1, + "fieldname": "fiscal_year", + "fieldtype": "Link", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1, "width": "150px" - }, + }, { - "fieldname": "section_break_78", - "fieldtype": "Section Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, + "fieldname": "section_break_78", + "fieldtype": "Section Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, "width": "50%" - }, + }, { - "default": "Draft", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nStopped\nCancelled", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 1, + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nStopped\nCancelled", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 1, "width": "100px" - }, + }, { - "fieldname": "delivery_status", - "fieldtype": "Select", - "hidden": 1, - "label": "Delivery Status", - "no_copy": 1, - "options": "Not Delivered\nFully Delivered\nPartly Delivered\nClosed\nNot Applicable", - "permlevel": 0, + "fieldname": "delivery_status", + "fieldtype": "Select", + "hidden": 1, + "label": "Delivery Status", + "no_copy": 1, + "options": "Not Delivered\nFully Delivered\nPartly Delivered\nClosed\nNot Applicable", + "permlevel": 0, "print_hide": 1 - }, + }, { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials delivered against this Sales Order", - "fieldname": "per_delivered", - "fieldtype": "Percent", - "in_filter": 1, - "in_list_view": 1, - "label": "% Delivered", - "no_copy": 1, - "oldfieldname": "per_delivered", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "depends_on": "eval:!doc.__islocal", + "description": "% of materials delivered against this Sales Order", + "fieldname": "per_delivered", + "fieldtype": "Percent", + "in_filter": 1, + "in_list_view": 1, + "label": "% Delivered", + "no_copy": 1, + "oldfieldname": "per_delivered", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "width": "100px" - }, + }, { - "fieldname": "column_break_81", - "fieldtype": "Column Break", + "fieldname": "column_break_81", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials billed against this Sales Order", - "fieldname": "per_billed", - "fieldtype": "Percent", - "in_filter": 1, - "in_list_view": 1, - "label": "% Amount Billed", - "no_copy": 1, - "oldfieldname": "per_billed", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "depends_on": "eval:!doc.__islocal", + "description": "% of materials billed against this Sales Order", + "fieldname": "per_billed", + "fieldtype": "Percent", + "in_filter": 1, + "in_list_view": 1, + "label": "% Amount Billed", + "no_copy": 1, + "oldfieldname": "per_billed", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "width": "100px" - }, + }, { - "fieldname": "billing_status", - "fieldtype": "Select", - "hidden": 1, - "label": "Billing Status", - "no_copy": 1, - "options": "Not Billed\nFully Billed\nPartly Billed\nClosed", - "permlevel": 0, + "fieldname": "billing_status", + "fieldtype": "Select", + "hidden": 1, + "label": "Billing Status", + "no_copy": 1, + "options": "Not Billed\nFully Billed\nPartly Billed\nClosed", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "sales_team_section_break", - "fieldtype": "Section Break", - "label": "Sales Team", - "oldfieldtype": "Section Break", - "options": "icon-group", - "permlevel": 0, + "fieldname": "sales_team_section_break", + "fieldtype": "Section Break", + "label": "Sales Team", + "oldfieldtype": "Section Break", + "options": "icon-group", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "sales_partner", - "fieldtype": "Link", - "in_filter": 1, - "label": "Sales Partner", - "oldfieldname": "sales_partner", - "oldfieldtype": "Link", - "options": "Sales Partner", - "permlevel": 0, - "print_hide": 1, - "search_index": 1, + "fieldname": "sales_partner", + "fieldtype": "Link", + "in_filter": 1, + "label": "Sales Partner", + "oldfieldname": "sales_partner", + "oldfieldtype": "Link", + "options": "Sales Partner", + "permlevel": 0, + "print_hide": 1, + "search_index": 1, "width": "150px" - }, + }, { - "fieldname": "column_break7", - "fieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, + "fieldname": "column_break7", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, "width": "50%" - }, + }, { - "fieldname": "commission_rate", - "fieldtype": "Float", - "label": "Commission Rate", - "oldfieldname": "commission_rate", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "commission_rate", + "fieldtype": "Float", + "label": "Commission Rate", + "oldfieldname": "commission_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, "width": "100px" - }, + }, { - "fieldname": "total_commission", - "fieldtype": "Currency", - "label": "Total Commission", - "oldfieldname": "total_commission", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, + "fieldname": "total_commission", + "fieldtype": "Currency", + "label": "Total Commission", + "oldfieldname": "total_commission", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "section_break1", - "fieldtype": "Section Break", - "permlevel": 0, + "fieldname": "section_break1", + "fieldtype": "Section Break", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "sales_team", - "fieldtype": "Table", - "label": "Sales Team1", - "oldfieldname": "sales_team", - "oldfieldtype": "Table", - "options": "Sales Team", - "permlevel": 0, + "fieldname": "sales_team", + "fieldtype": "Table", + "label": "Sales Team1", + "oldfieldname": "sales_team", + "oldfieldtype": "Table", + "options": "Sales Team", + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "recurring_order", - "fieldtype": "Section Break", - "label": "Recurring Order", - "options": "icon-time", + "fieldname": "recurring_order", + "fieldtype": "Section Break", + "label": "Recurring Order", + "options": "icon-time", "permlevel": 0 - }, + }, { - "fieldname": "column_break82", - "fieldtype": "Column Break", - "label": "Column Break", + "fieldname": "column_break82", + "fieldtype": "Column Break", + "label": "Column Break", "permlevel": 0 - }, + }, { - "allow_on_submit": 1, - "depends_on": "eval:doc.docstatus<2", - "description": "Check if recurring order, uncheck to stop recurring or put proper End Date", - "fieldname": "is_recurring", - "fieldtype": "Check", - "label": "Is Recurring", - "no_copy": 1, - "permlevel": 0, + "allow_on_submit": 1, + "depends_on": "eval:doc.docstatus<2", + "description": "Check if recurring order, uncheck to stop recurring or put proper End Date", + "fieldname": "is_recurring", + "fieldtype": "Check", + "label": "Is Recurring", + "no_copy": 1, + "permlevel": 0, "print_hide": 1 - }, + }, { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "Select the period when the invoice will be generated automatically", - "fieldname": "recurring_type", - "fieldtype": "Select", - "label": "Recurring Type", - "no_copy": 1, - "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly", - "permlevel": 0, + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "Select the period when the invoice will be generated automatically", + "fieldname": "recurring_type", + "fieldtype": "Select", + "label": "Recurring Type", + "no_copy": 1, + "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly", + "permlevel": 0, "print_hide": 1 - }, + }, { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "The day of the month on which auto order will be generated e.g. 05, 28 etc ", - "fieldname": "repeat_on_day_of_month", - "fieldtype": "Int", - "label": "Repeat on Day of Month", - "no_copy": 1, - "permlevel": 0, + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The day of the month on which auto order will be generated e.g. 05, 28 etc ", + "fieldname": "repeat_on_day_of_month", + "fieldtype": "Int", + "label": "Repeat on Day of Month", + "no_copy": 1, + "permlevel": 0, "print_hide": 1 - }, + }, { - "depends_on": "eval:doc.is_recurring==1", - "description": "The date on which next invoice will be generated. It is generated on submit.", - "fieldname": "next_date", - "fieldtype": "Date", - "label": "Next Date", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which next invoice will be generated. It is generated on submit.", + "fieldname": "next_date", + "fieldtype": "Date", + "label": "Next Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "The date on which recurring order will be stop", - "fieldname": "end_date", - "fieldtype": "Date", - "label": "End Date", - "no_copy": 1, - "permlevel": 0, + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "The date on which recurring order will be stop", + "fieldname": "end_date", + "fieldtype": "Date", + "label": "End Date", + "no_copy": 1, + "permlevel": 0, "print_hide": 1 - }, + }, { - "fieldname": "column_break83", - "fieldtype": "Column Break", - "label": "Column Break", - "permlevel": 0, + "fieldname": "column_break83", + "fieldtype": "Column Break", + "label": "Column Break", + "permlevel": 0, "print_hide": 1 - }, + }, { - "depends_on": "eval:doc.is_recurring==1", - "fieldname": "recurring_id", - "fieldtype": "Data", - "label": "Recurring Id", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, + "depends_on": "eval:doc.is_recurring==1", + "fieldname": "recurring_id", + "fieldtype": "Data", + "label": "Recurring Id", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "allow_on_submit": 1, - "depends_on": "eval:doc.is_recurring==1", - "description": "Enter email id separated by commas, order will be mailed automatically on particular date", - "fieldname": "notification_email_address", - "fieldtype": "Small Text", - "ignore_user_permissions": 0, - "label": "Notification Email Address", - "no_copy": 1, - "permlevel": 0, + "allow_on_submit": 1, + "depends_on": "eval:doc.is_recurring==1", + "description": "Enter email id separated by commas, order will be mailed automatically on particular date", + "fieldname": "notification_email_address", + "fieldtype": "Small Text", + "ignore_user_permissions": 0, + "label": "Notification Email Address", + "no_copy": 1, + "permlevel": 0, "print_hide": 1 - }, - { - "fieldname": "against_income_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Income Account", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "report_hide": 1 } - ], - "icon": "icon-file-text", - "idx": 1, - "is_submittable": 1, - "issingle": 0, - "modified": "2014-09-10 05:35:34.761247", - "modified_by": "Administrator", - "module": "Selling", - "name": "Sales Order", - "owner": "Administrator", + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "issingle": 0, + "modified": "2014-09-18 03:17:33.241162", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Order", + "owner": "Administrator", "permissions": [ { - "amend": 1, - "apply_user_permissions": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales User", - "submit": 1, + "amend": 1, + "apply_user_permissions": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 1, "write": 1 - }, + }, { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "import": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Manager", - "set_user_permissions": 1, - "submit": 1, + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "import": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "set_user_permissions": 1, + "submit": 1, "write": 1 - }, + }, { - "amend": 1, - "apply_user_permissions": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Maintenance User", - "submit": 1, + "amend": 1, + "apply_user_permissions": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance User", + "submit": 1, "write": 1 - }, + }, { - "apply_user_permissions": 1, - "cancel": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, + "apply_user_permissions": 1, + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, "role": "Accounts User" - }, + }, { - "apply_user_permissions": 1, - "cancel": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, + "apply_user_permissions": 1, + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, "role": "Customer" - }, + }, { - "apply_user_permissions": 1, - "permlevel": 0, - "read": 1, - "report": 1, + "apply_user_permissions": 1, + "permlevel": 0, + "read": 1, + "report": 1, "role": "Material User" - }, + }, { - "permlevel": 1, - "read": 1, - "role": "Sales Manager", + "permlevel": 1, + "read": 1, + "role": "Sales Manager", "write": 1 } - ], - "read_only_onload": 1, - "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company", - "sort_field": "modified", + ], + "read_only_onload": 1, + "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company", + "sort_field": "modified", "sort_order": "DESC" -} +} \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index c14d06d50c..bffa581639 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -4,14 +4,10 @@ from __future__ import unicode_literals import frappe import frappe.utils - from frappe.utils import cstr, flt, getdate, comma_and - from frappe import _ from frappe.model.mapper import get_mapped_doc -from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document - from erpnext.controllers.selling_controller import SellingController form_grid_templates = { @@ -122,8 +118,6 @@ class SalesOrder(SellingController): if not self.billing_status: self.billing_status = 'Not Billed' if not self.delivery_status: self.delivery_status = 'Not Delivered' - validate_recurring_document(self) - def validate_warehouse(self): from erpnext.stock.utils import validate_warehouse_company @@ -157,6 +151,8 @@ class SalesOrder(SellingController): doc.set_status(update=True) def on_submit(self): + super(SalesOrder, self).on_submit() + self.update_stock_ledger(update_stock = 1) self.check_credit(self.grand_total) @@ -165,8 +161,6 @@ class SalesOrder(SellingController): self.update_prevdoc_status('submit') frappe.db.set(self, 'status', 'Submitted') - - convert_to_recurring(self, self.transaction_date) def on_cancel(self): # Cannot cancel stopped SO @@ -255,11 +249,6 @@ class SalesOrder(SellingController): def get_portal_page(self): return "order" if self.docstatus==1 else None - def on_update_after_submit(self): - validate_recurring_document(self) - convert_to_recurring(self, self.transaction_date) - - @frappe.whitelist() def make_material_request(source_name, target_doc=None): def postprocess(source, doc): diff --git a/erpnext/templates/emails/recurring_document_failed.html b/erpnext/templates/emails/recurring_document_failed.html index a216e286a5..56d8b80f08 100644 --- a/erpnext/templates/emails/recurring_document_failed.html +++ b/erpnext/templates/emails/recurring_document_failed.html @@ -1,6 +1,6 @@

Recurring {{ type }} Failed

-

An error occured while creating recurring {{ type }} {{ name }} for {{ customer }}.

+

An error occured while creating recurring {{ type }} {{ name }} for {{ party }}.

This could be because of some invalid email ids in the {{ type }}.

To stop sending repetitive error notifications from the system, we have unchecked "Convert into Recurring" field in the {{ type }} {{ name }}.