From 00d415da2857e3bf64e20358b23b516295977fa0 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 13 Jul 2018 07:45:08 +0000 Subject: [PATCH] changes for signext --- .../sales_invoice/sales_invoice.js_old | 583 ++++++ .../doctype/sales_invoice/sales_invoice.json | 184 +- erpnext/fixtures/web_form.json | 1616 +++++++++++++++++ erpnext/projects/doctype/project/project.json | 46 +- .../doctype/project/project_dashboard.py | 2 +- .../doctype/project/project_dashboard.py.old | 26 + .../doctype/project/project_dashboard.py_1209 | 26 + .../project/project_dashboard.py_final | 26 + .../projects/doctype/project/test_project.js | 23 + .../gst_tax_invoice/gst_tax_invoice.json | 6 +- .../sales_order/sales_order.js_23_9_17 | 438 +++++ .../doctype/sales_order/sales_order.js_old | 437 +++++ .../doctype/sales_order/sales_order.json | 20 +- .../delivery_note/delivery_note.js_1209 | 271 +++ erpnext/stock/doctype/item/item.json | 128 +- erpnext/stock/doctype/item/test_item.js | 23 + 16 files changed, 3769 insertions(+), 86 deletions(-) create mode 100755 erpnext/accounts/doctype/sales_invoice/sales_invoice.js_old create mode 100644 erpnext/fixtures/web_form.json create mode 100755 erpnext/projects/doctype/project/project_dashboard.py.old create mode 100755 erpnext/projects/doctype/project/project_dashboard.py_1209 create mode 100644 erpnext/projects/doctype/project/project_dashboard.py_final create mode 100644 erpnext/projects/doctype/project/test_project.js create mode 100755 erpnext/selling/doctype/sales_order/sales_order.js_23_9_17 create mode 100755 erpnext/selling/doctype/sales_order/sales_order.js_old create mode 100755 erpnext/stock/doctype/delivery_note/delivery_note.js_1209 create mode 100644 erpnext/stock/doctype/item/test_item.js diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js_old b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js_old new file mode 100755 index 000000000..c38645067 --- /dev/null +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js_old @@ -0,0 +1,583 @@ +// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + +// print heading +cur_frm.pformat.print_heading = 'Invoice'; + +{% include 'erpnext/selling/sales_common.js' %}; + +cur_frm.add_fetch('customer', 'tax_id', 'tax_id'); + +frappe.provide("erpnext.accounts"); +erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.extend({ + setup: function(doc) { + this.setup_posting_date_time_check(); + this._super(doc); + }, + onload: function() { + var me = this; + this._super(); + + if(!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) { + // show debit_to in print format + this.frm.set_df_property("debit_to", "print_hide", 0); + } + + erpnext.queries.setup_queries(this.frm, "Warehouse", function() { + return erpnext.queries.warehouse(me.frm.doc); + }); + + if(this.frm.doc.__islocal && this.frm.doc.is_pos) { + //Load pos profile data on the invoice if the default value of Is POS is 1 + + me.frm.script_manager.trigger("is_pos"); + me.frm.refresh_fields(); + } + }, + + refresh: function(doc, dt, dn) { + this._super(); + if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) { + // hide new msgbox + cur_frm.msgbox.hide(); + } + + this.frm.toggle_reqd("due_date", !this.frm.doc.is_return); + + this.show_general_ledger(); + + if(doc.update_stock) this.show_stock_ledger(); + + if(doc.docstatus==1 && !doc.is_return) { + + var is_delivered_by_supplier = false; + + is_delivered_by_supplier = cur_frm.doc.items.some(function(item){ + return item.is_delivered_by_supplier ? true : false; + }) + + if(doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) { + cur_frm.add_custom_button(__('Return / Credit Note'), + this.make_sales_return, __("Make")); + cur_frm.page.set_inner_btn_group_as_primary(__("Make")); + } + + if(cint(doc.update_stock)!=1) { + // show Make Delivery Note button only if Sales Invoice is not created from Delivery Note + var from_delivery_note = false; + from_delivery_note = cur_frm.doc.items + .some(function(item) { + return item.delivery_note ? true : false; + }); + + if(!from_delivery_note && !is_delivered_by_supplier) { + cur_frm.add_custom_button(__('Delivery'), + cur_frm.cscript['Make Delivery Note'], __("Make")); + } + } + + if(doc.outstanding_amount!=0 && !cint(doc.is_return)) { + cur_frm.add_custom_button(__('Payment'), + this.make_payment_entry, __("Make")); + } + + if(doc.outstanding_amount>0 && !cint(doc.is_return)) { + cur_frm.add_custom_button(__('Payment Request'), + this.make_payment_request, __("Make")); + } + + + } + + // Show buttons only when pos view is active + if (cint(doc.docstatus==0) && cur_frm.page.current_view_name!=="pos" && !doc.is_return) { + cur_frm.cscript.sales_order_btn(); + cur_frm.cscript.delivery_note_btn(); + } + + this.set_default_print_format(); + }, + + on_submit: function(doc, dt, dn) { + var me = this; + + $.each(doc["items"], function(i, row) { + if(row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note) + }) + + if(this.frm.doc.is_pos) { + this.frm.msgbox = frappe.msgprint( + ` + ${__('Print')} + + ${__('New')}` + ); + + } else if(cint(frappe.boot.notification_settings.sales_invoice)) { + this.frm.email_doc(frappe.boot.notification_settings.sales_invoice_message); + } + }, + + set_default_print_format: function() { + // set default print format to POS type + if(cur_frm.doc.is_pos) { + if(cur_frm.pos_print_format) { + cur_frm.meta._default_print_format = cur_frm.meta.default_print_format; + cur_frm.meta.default_print_format = cur_frm.pos_print_format; + } + } else { + if(cur_frm.meta._default_print_format) { + cur_frm.meta.default_print_format = cur_frm.meta._default_print_format; + cur_frm.meta._default_print_format = null; + } + } + }, + + sales_order_btn: function() { + var me = this; + this.$sales_order_btn = this.frm.add_custom_button(__('Sales Order'), + function() { + erpnext.utils.map_current_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice", + source_doctype: "Sales Order", + target: me.frm, + setters: { + customer: me.frm.doc.customer || undefined, + }, + get_query_filters: { + docstatus: 1, + status: ["!=", "Closed"], + per_billed: ["<", 99.99], + company: me.frm.doc.company + } + }) + }, __("Get items from")); + }, + + delivery_note_btn: function() { + var me = this; + this.$delivery_note_btn = this.frm.add_custom_button(__('Delivery Note'), + function() { + erpnext.utils.map_current_doc({ + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice", + source_doctype: "Delivery Note", + target: me.frm, + date_field: "posting_date", + setters: { + customer: me.frm.doc.customer || undefined + }, + get_query: function() { + var filters = { + docstatus: 1, + company: me.frm.doc.company + }; + if(me.frm.doc.customer) filters["customer"] = me.frm.doc.customer; + return { + query: "erpnext.controllers.queries.get_delivery_notes_to_be_billed", + filters: filters + }; + } + }); + }, __("Get items from")); + }, + + tc_name: function() { + this.get_terms(); + }, + + customer: function() { + var me = this; + if(this.frm.updating_party_details) return; + + erpnext.utils.get_party_details(this.frm, + "erpnext.accounts.party.get_party_details", { + posting_date: this.frm.doc.posting_date, + party: this.frm.doc.customer, + party_type: "Customer", + account: this.frm.doc.debit_to, + price_list: this.frm.doc.selling_price_list, + }, function() { + me.apply_pricing_rule(); + }) + }, + + debit_to: function() { + var me = this; + if(this.frm.doc.debit_to) { + me.frm.call({ + method: "frappe.client.get_value", + args: { + doctype: "Account", + fieldname: "account_currency", + filters: { name: me.frm.doc.debit_to }, + }, + callback: function(r, rt) { + if(r.message) { + me.frm.set_value("party_account_currency", r.message.account_currency); + me.set_dynamic_labels(); + } + } + }); + } + }, + + allocated_amount: function() { + this.calculate_total_advance(); + this.frm.refresh_fields(); + }, + + write_off_outstanding_amount_automatically: function() { + if(cint(this.frm.doc.write_off_outstanding_amount_automatically)) { + frappe.model.round_floats_in(this.frm.doc, ["grand_total", "paid_amount"]); + // this will make outstanding amount 0 + this.frm.set_value("write_off_amount", + flt(this.frm.doc.grand_total - this.frm.doc.paid_amount - this.frm.doc.total_advance, precision("write_off_amount")) + ); + this.frm.toggle_enable("write_off_amount", false); + + } else { + this.frm.toggle_enable("write_off_amount", true); + } + + this.calculate_outstanding_amount(false); + this.frm.refresh_fields(); + }, + + write_off_amount: function() { + this.set_in_company_currency(this.frm.doc, ["write_off_amount"]); + this.write_off_outstanding_amount_automatically(); + }, + + items_add: function(doc, cdt, cdn) { + var row = frappe.get_doc(cdt, cdn); + this.frm.script_manager.copy_from_first_row("items", row, ["income_account", "cost_center"]); + }, + + set_dynamic_labels: function() { + this._super(); + this.hide_fields(this.frm.doc); + }, + + items_on_form_rendered: function() { + erpnext.setup_serial_no(); + }, + + make_sales_return: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_sales_return", + frm: cur_frm + }) + }, + + asset: function(frm, cdt, cdn) { + var row = locals[cdt][cdn]; + if(row.asset) { + frappe.call({ + method: erpnext.accounts.doctype.asset.depreciation.get_disposal_account_and_cost_center, + args: { + "company": frm.doc.company + }, + callback: function(r, rt) { + frappe.model.set_value(cdt, cdn, "income_account", r.message[0]); + frappe.model.set_value(cdt, cdn, "cost_center", r.message[1]); + } + }) + } + }, + + is_pos: function(frm){ + if(this.frm.doc.is_pos) { + if(!this.frm.doc.company) { + this.frm.set_value("is_pos", 0); + frappe.msgprint(__("Please specify Company to proceed")); + } else { + var me = this; + return this.frm.call({ + doc: me.frm.doc, + method: "set_missing_values", + callback: function(r) { + if(!r.exc) { + if(r.message && r.message.print_format) { + frm.pos_print_format = r.message.print_format; + } + me.frm.script_manager.trigger("update_stock"); + frappe.model.set_default_values(me.frm.doc); + me.set_dynamic_labels(); + me.calculate_taxes_and_totals(); + } + } + }); + } + } + else this.frm.trigger("refresh") + }, + + amount: function(){ + this.write_off_outstanding_amount_automatically() + }, + + change_amount: function(){ + if(this.frm.doc.paid_amount > this.frm.doc.grand_total){ + this.calculate_write_off_amount() + }else { + this.frm.set_value("change_amount", 0.0) + this.frm.set_value("base_change_amount", 0.0) + } + + this.frm.refresh_fields(); + }, + + company_address: function() { + var me = this; + if(this.frm.doc.company_address) { + frappe.call({ + method: "frappe.contacts.doctype.address.address.get_address_display", + args: {"address_dict": this.frm.doc.company_address }, + callback: function(r) { + if(r.message) { + me.frm.set_value("company_address_display", r.message) + } + } + }) + } else { + this.frm.set_value("company_address_display", ""); + } + } +}); + +// for backward compatibility: combine new and previous states +$.extend(cur_frm.cscript, new erpnext.accounts.SalesInvoiceController({frm: cur_frm})); + +// Hide Fields +// ------------ +cur_frm.cscript.hide_fields = function(doc) { + var parent_fields = ['project', 'due_date', 'is_opening', 'source', 'total_advance', 'get_advances', + 'advances', 'sales_partner', 'commission_rate', 'total_commission', 'advances', 'from_date', 'to_date']; + + if(cint(doc.is_pos) == 1) { + hide_field(parent_fields); + } else { + for (var i in parent_fields) { + var docfield = frappe.meta.docfield_map[doc.doctype][parent_fields[i]]; + if(!docfield.hidden) unhide_field(parent_fields[i]); + } + } + + // India related fields + if (frappe.boot.sysdefaults.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']); + else hide_field(['c_form_applicable', 'c_form_no']); + + this.frm.toggle_enable("write_off_amount", !!!cint(doc.write_off_outstanding_amount_automatically)); + + cur_frm.refresh_fields(); +} + +cur_frm.cscript.update_stock = function(doc, dt, dn) { + cur_frm.cscript.hide_fields(doc, dt, dn); + this.frm.fields_dict.items.grid.toggle_reqd("item_code", doc.update_stock? true: false) +} + +cur_frm.cscript['Make Delivery Note'] = function() { + frappe.model.open_mapped_doc({ + method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_delivery_note", + frm: cur_frm + }) +} + +cur_frm.fields_dict.cash_bank_account.get_query = function(doc) { + return { + filters: [ + ["Account", "account_type", "in", ["Cash", "Bank"]], + ["Account", "root_type", "=", "Asset"], + ["Account", "is_group", "=",0], + ["Account", "company", "=", doc.company] + ] + } +} + +cur_frm.fields_dict.write_off_account.get_query = function(doc) { + return{ + filters:{ + 'report_type': 'Profit and Loss', + 'is_group': 0, + 'company': doc.company + } + } +} + +// Write off cost center +//----------------------- +cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) { + return{ + filters:{ + 'is_group': 0, + 'company': doc.company + } + } +} + +//project name +//-------------------------- +cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) { + return{ + query: "erpnext.controllers.queries.get_project_name", + filters: {'customer': doc.customer} + } +} + +// Income Account in Details Table +// -------------------------------- +cur_frm.set_query("income_account", "items", function(doc) { + return{ + query: "erpnext.controllers.queries.get_income_account", + filters: {'company': doc.company} + } +}); + + +// Cost Center in Details Table +// ----------------------------- +cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(doc) { + return { + filters: { + 'company': doc.company, + "is_group": 0 + } + } +} + +cur_frm.cscript.income_account = function(doc, cdt, cdn) { + erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "items", "income_account"); +} + +cur_frm.cscript.expense_account = function(doc, cdt, cdn) { + erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "items", "expense_account"); +} + +cur_frm.cscript.cost_center = function(doc, cdt, cdn) { + erpnext.utils.copy_value_in_all_row(doc, cdt, cdn, "items", "cost_center"); +} + +cur_frm.set_query("debit_to", function(doc) { + // filter on Account + if (doc.customer) { + return { + filters: { + 'account_type': 'Receivable', + 'is_group': 0, + 'company': doc.company + } + } + } else { + return { + filters: { + 'report_type': 'Balance Sheet', + 'is_group': 0, + 'company': doc.company + } + } + } +}); + +cur_frm.set_query("asset", "items", function(doc, cdt, cdn) { + var d = locals[cdt][cdn]; + return { + filters: [ + ["Asset", "item_code", "=", d.item_code], + ["Asset", "docstatus", "=", 1], + ["Asset", "status", "in", ["Submitted", "Partially Depreciated", "Fully Depreciated"]], + ["Asset", "company", "=", doc.company] + ] + } +}); + +frappe.ui.form.on('Sales Invoice', { + setup: function(frm){ + frm.custom_make_buttons = { + 'Delivery Note': 'Delivery', + 'Sales Invoice': 'Sales Return', + 'Payment Request': 'Payment Request', + 'Payment Entry': 'Payment' + }, + frm.fields_dict["timesheets"].grid.get_field("time_sheet").get_query = function(doc, cdt, cdn){ + return{ + query: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet", + filters: {'project': doc.project} + } + } + + // expense account + frm.fields_dict['items'].grid.get_field('expense_account').get_query = function(doc) { + if (erpnext.is_perpetual_inventory_enabled(doc.company)) { + return { + filters: { + 'report_type': 'Profit and Loss', + 'company': doc.company, + "is_group": 0 + } + } + } + } + + frm.set_query('company_address', function(doc) { + if(!doc.company) { + frappe.throw(_('Please set Company')); + } + + return { + query: 'frappe.contacts.doctype.address.address.address_query', + filters: { + link_doctype: 'Company', + link_name: doc.company + } + }; + }); + }, + + project: function(frm){ + frm.call({ + method: "add_timesheet_data", + doc: frm.doc, + callback: function(r, rt) { + refresh_field(['timesheets']) + } + }) + } +}) + +frappe.ui.form.on('Sales Invoice Timesheet', { + time_sheet: function(frm, cdt, cdn){ + var d = locals[cdt][cdn]; + if(d.time_sheet) { + frappe.call({ + method: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet_data", + args: { + 'name': d.time_sheet, + 'project': frm.doc.project || null + }, + callback: function(r, rt) { + if(r.message){ + data = r.message; + frappe.model.set_value(cdt, cdn, "billing_hours", data.billing_hours); + frappe.model.set_value(cdt, cdn, "billing_amount", data.billing_amount); + frappe.model.set_value(cdt, cdn, "timesheet_detail", data.timesheet_detail); + calculate_total_billing_amount(frm) + } + } + }) + } + } +}) + +var calculate_total_billing_amount = function(frm) { + var doc = frm.doc; + + doc.total_billing_amount = 0.0 + if(doc.timesheets) { + $.each(doc.timesheets, function(index, data){ + doc.total_billing_amount += data.billing_amount + }) + } + + refresh_field('total_billing_amount') +} diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 9aa0e6b6a..f0a99e5a2 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -543,6 +543,188 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "reference_information", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Reference Information", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "quotation_number", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Quotation Number", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "sales_order", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Sales Order", + "length": 0, + "no_copy": 0, + "options": "Sales Order", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "cb23", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "po_no", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Customer's Purchase Order", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "po_date", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Customer's Purchase Order Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -4811,7 +4993,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-09-19 11:23:08.675028", + "modified": "2017-11-14 12:58:58.140608", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/fixtures/web_form.json b/erpnext/fixtures/web_form.json new file mode 100644 index 000000000..13bfca715 --- /dev/null +++ b/erpnext/fixtures/web_form.json @@ -0,0 +1,1616 @@ +[ + { + "accept_payment": 0, + "allow_comments": 1, + "allow_delete": 1, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": "[{\"title\":\"Tasks\", \"name\":\"tasks\"}]", + "currency": null, + "doc_type": "Task", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": null, + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2016-08-06 11:59:21.494549", + "module": "Projects", + "name": "tasks", + "payment_button_help": null, + "payment_button_label": null, + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "tasks", + "show_sidebar": 0, + "sidebar_items": [], + "success_message": null, + "success_url": "", + "title": "Task", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "project", + "fieldtype": "Link", + "hidden": 0, + "label": "Project", + "max_length": 0, + "max_value": 0, + "options": "Project", + "read_only": 1, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "subject", + "fieldtype": "Data", + "hidden": 0, + "label": "Subject", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "label": "Status", + "max_length": 0, + "max_value": 0, + "options": "Open\nClosed\nCancelled", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "description", + "fieldtype": "Text", + "hidden": 0, + "label": "Details", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "priority", + "fieldtype": "Select", + "hidden": 0, + "label": "Priority", + "max_length": 0, + "max_value": 0, + "options": "Low\nMedium\nHigh\nUrgent", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "exp_start_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Expected Start Date", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "exp_end_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Expected End Date", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 1, + "allow_delete": 1, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": "[{\"label\":_(\"Issues\"), \"route\":\"issues\"}]", + "currency": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": "", + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2017-07-25 22:49:10.762704", + "module": "Support", + "name": "issues", + "payment_button_help": null, + "payment_button_label": null, + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "issues", + "show_sidebar": 1, + "sidebar_items": [], + "success_message": "", + "success_url": "/issues", + "title": "Issue", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "subject", + "fieldtype": "Data", + "hidden": 0, + "label": "Subject", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": "Open", + "description": null, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "label": "Status", + "max_length": 0, + "max_value": 0, + "options": "Open\nReplied\nHold\nClosed", + "read_only": 1, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "customer", + "fieldtype": "Data", + "hidden": 0, + "label": "Customer", + "max_length": 0, + "max_value": 0, + "options": "Customer", + "read_only": 1, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "description", + "fieldtype": "Text", + "hidden": 0, + "label": "Description", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "attachment", + "fieldtype": "Attach", + "hidden": 0, + "label": "Attachment", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": null, + "currency": null, + "doc_type": "Address", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": null, + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2016-12-07 04:17:02.020768", + "module": "Utilities", + "name": "addresses", + "payment_button_help": null, + "payment_button_label": null, + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "address", + "show_sidebar": 0, + "sidebar_items": [], + "success_message": null, + "success_url": "/addresses", + "title": "Address", + "web_form_fields": [ + { + "default": null, + "description": "", + "fieldname": "address_title", + "fieldtype": "Data", + "hidden": 0, + "label": "Address Title", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "address_type", + "fieldtype": "Select", + "hidden": 0, + "label": "Address Type", + "max_length": 0, + "max_value": 0, + "options": "Billing\nShipping\nOffice\nPersonal\nPlant\nPostal\nShop\nSubsidiary\nWarehouse\nOther", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "address_line1", + "fieldtype": "Data", + "hidden": 0, + "label": "Address Line 1", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "address_line2", + "fieldtype": "Data", + "hidden": 0, + "label": "Address Line 2", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "city", + "fieldtype": "Data", + "hidden": 0, + "label": "City/Town", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "state", + "fieldtype": "Data", + "hidden": 0, + "label": "State", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "pincode", + "fieldtype": "Data", + "hidden": 0, + "label": "Postal Code", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "country", + "fieldtype": "Link", + "hidden": 0, + "label": "Country", + "max_length": 0, + "max_value": 0, + "options": "Country", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": null, + "fieldtype": "Column Break", + "hidden": 0, + "label": null, + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "email_id", + "fieldtype": "Data", + "hidden": 0, + "label": "Email Address", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "phone", + "fieldtype": "Data", + "hidden": 0, + "label": "Phone", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": "0", + "description": "", + "fieldname": "is_primary_address", + "fieldtype": "Check", + "hidden": 0, + "label": "Preferred Billing Address", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": "0", + "description": "", + "fieldname": "is_shipping_address", + "fieldtype": "Check", + "hidden": 0, + "label": "Preferred Shipping Address", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 1, + "allow_delete": 1, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": null, + "currency": null, + "doc_type": "Discussion", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": null, + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2016-07-19 07:55:37.826664", + "module": "Schools", + "name": "discussion", + "payment_button_help": null, + "payment_button_label": null, + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "discussion", + "show_sidebar": 0, + "sidebar_items": [], + "success_message": null, + "success_url": "", + "title": "Discussion", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "course", + "fieldtype": "Data", + "hidden": 0, + "label": "Course", + "max_length": 0, + "max_value": 0, + "options": "Course", + "read_only": 1, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "subject", + "fieldtype": "Text", + "hidden": 0, + "label": "Subject", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "description", + "fieldtype": "Text", + "hidden": 0, + "label": "Description", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 1, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": null, + "currency": null, + "doc_type": "Job Applicant", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": "", + "is_standard": 1, + "login_required": 0, + "max_attachment_size": 0, + "modified": "2016-12-20 00:21:44.081622", + "module": "HR", + "name": "job-application", + "payment_button_help": null, + "payment_button_label": null, + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "job_application", + "show_sidebar": 1, + "sidebar_items": [], + "success_message": "Thank you for applying.", + "success_url": "/jobs", + "title": "Job Application", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "job_title", + "fieldtype": "Data", + "hidden": 0, + "label": "Job Opening", + "max_length": 0, + "max_value": 0, + "options": "", + "read_only": 1, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "applicant_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Applicant Name", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "email_id", + "fieldtype": "Data", + "hidden": 0, + "label": "Email Address", + "max_length": 0, + "max_value": 0, + "options": "Email", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "cover_letter", + "fieldtype": "Text", + "hidden": 0, + "label": "Cover Letter", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "resume_attachment", + "fieldtype": "Attach", + "hidden": 0, + "label": "Resume Attachment", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 0, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": "[{\"title\": _(\"My Account\"), \"route\": \"me\"}]", + "currency": null, + "doc_type": "User", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": "", + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2017-07-24 12:14:04.039284", + "module": "Core", + "name": "edit-profile", + "payment_button_help": null, + "payment_button_label": null, + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "update-profile", + "show_sidebar": 1, + "sidebar_items": [], + "success_message": "Profile updated successfully.", + "success_url": "/me", + "title": "Update Profile", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "first_name", + "fieldtype": "Data", + "hidden": 0, + "label": "First Name", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "middle_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Middle Name (Optional)", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "last_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Last Name", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": "", + "fieldname": "user_image", + "fieldtype": "Attach", + "hidden": 0, + "label": "User Image", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": null, + "fieldtype": "Section Break", + "hidden": 0, + "label": "More Information", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "phone", + "fieldtype": "Data", + "hidden": 0, + "label": "Phone", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "mobile_no", + "fieldtype": "Data", + "hidden": 0, + "label": "Mobile Number", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": "", + "fieldname": "language", + "fieldtype": "Link", + "hidden": 0, + "label": "Language", + "max_length": 0, + "max_value": 0, + "options": "Language", + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": null, + "currency": null, + "doc_type": "Student Applicant", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": null, + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2017-02-21 04:44:46.022738", + "module": "Schools", + "name": "student-applicant", + "payment_button_help": null, + "payment_button_label": "Buy Now", + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "student-applicant", + "show_sidebar": 1, + "sidebar_items": [], + "success_message": null, + "success_url": "/student-applicant", + "title": "Student Applicant", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "first_name", + "fieldtype": "Data", + "hidden": 0, + "label": "First Name", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "middle_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Middle Name", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "last_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Last Name", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "image", + "fieldtype": "Data", + "hidden": 0, + "label": "Image", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "program", + "fieldtype": "Link", + "hidden": 0, + "label": "Program", + "max_length": 0, + "max_value": 0, + "options": "Program", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "academic_year", + "fieldtype": "Link", + "hidden": 0, + "label": "Academic Year", + "max_length": 0, + "max_value": 0, + "options": "Academic Year", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "date_of_birth", + "fieldtype": "Date", + "hidden": 0, + "label": "Date of Birth", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "blood_group", + "fieldtype": "Select", + "hidden": 0, + "label": "Blood Group", + "max_length": 0, + "max_value": 0, + "options": "\nA+\nA-\nB+\nB-\nO+\nO-\nAB+\nAB-", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "student_email_id", + "fieldtype": "Data", + "hidden": 0, + "label": "Student Email ID", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "student_mobile_number", + "fieldtype": "Data", + "hidden": 0, + "label": "Student Mobile Number", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": "INDIAN", + "description": null, + "fieldname": "nationality", + "fieldtype": "Data", + "hidden": 0, + "label": "Nationality", + "max_length": 0, + "max_value": 0, + "options": "", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "address_line_1", + "fieldtype": "Data", + "hidden": 0, + "label": "Address Line 1", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "address_line_2", + "fieldtype": "Data", + "hidden": 0, + "label": "Address Line 2", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "pincode", + "fieldtype": "Data", + "hidden": 0, + "label": "Pincode", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "guardians", + "fieldtype": "Table", + "hidden": 0, + "label": "Guardians", + "max_length": 0, + "max_value": 0, + "options": "Student Guardian", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "siblings", + "fieldtype": "Table", + "hidden": 0, + "label": "Siblings", + "max_length": 0, + "max_value": 0, + "options": "Student Sibling", + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 1, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": null, + "currency": "INR", + "doc_type": "Lab Test", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": "Lab Test", + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2017-06-07 16:03:06.781364", + "module": "Healthcare", + "name": "lab-test", + "payment_button_help": null, + "payment_button_label": "Buy Now", + "payment_gateway": null, + "print_format": "Lab Test Print", + "published": 1, + "route": "lab-test", + "show_sidebar": 1, + "sidebar_items": [], + "success_message": null, + "success_url": "/lab-test", + "title": "Lab Test", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "naming_series", + "fieldtype": "Select", + "hidden": 0, + "label": "Series", + "max_length": 0, + "max_value": 0, + "options": "LP-", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "invoice", + "fieldtype": "Link", + "hidden": 0, + "label": "Invoice", + "max_length": 0, + "max_value": 0, + "options": "Sales Invoice", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "patient", + "fieldtype": "Link", + "hidden": 0, + "label": "Patient", + "max_length": 0, + "max_value": 0, + "options": "Patient", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "patient_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Patient Name", + "max_length": 0, + "max_value": 0, + "options": "patient.patient_name", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "physician", + "fieldtype": "Link", + "hidden": 0, + "label": "Doctor", + "max_length": 0, + "max_value": 0, + "options": "Physician", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "label": "Status", + "max_length": 0, + "max_value": 0, + "options": "Draft\nCompleted\nApproved\nRejected\nCancelled", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "department", + "fieldtype": "Link", + "hidden": 0, + "label": "Department", + "max_length": 0, + "max_value": 0, + "options": "Medical Department", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "sample", + "fieldtype": "Link", + "hidden": 0, + "label": "Sample ID", + "max_length": 0, + "max_value": 0, + "options": "Sample Collection", + "read_only": 0, + "reqd": 0 + }, + { + "default": "", + "description": null, + "fieldname": "result_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Result Date", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "report_preference", + "fieldtype": "Data", + "hidden": 0, + "label": "Report Preference", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "test_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Test Name", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "normal_test_items", + "fieldtype": "Table", + "hidden": 0, + "label": null, + "max_length": 0, + "max_value": 0, + "options": "Normal Test Items", + "read_only": 1, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "special_test_items", + "fieldtype": "Table", + "hidden": 0, + "label": null, + "max_length": 0, + "max_value": 0, + "options": "Special Test Items", + "read_only": 1, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "sensitivity_test_items", + "fieldtype": "Table", + "hidden": 0, + "label": null, + "max_length": 0, + "max_value": 0, + "options": "Sensitivity Test Items", + "read_only": 1, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "test_comment", + "fieldtype": "Text", + "hidden": 0, + "label": "Comments", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 1, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "custom_result", + "fieldtype": "Text Editor", + "hidden": 0, + "label": "Custom Result", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 1, + "reqd": 0 + }, + { + "default": "0", + "description": null, + "fieldname": "sensitivity_toggle", + "fieldtype": "Check", + "hidden": 1, + "label": null, + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": "0", + "description": null, + "fieldname": "special_toggle", + "fieldtype": "Check", + "hidden": 1, + "label": null, + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": "0", + "description": null, + "fieldname": "normal_toggle", + "fieldtype": "Check", + "hidden": 1, + "label": null, + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 1, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": null, + "currency": "INR", + "doc_type": "Consultation", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": "Patient Prescriptions", + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2017-06-20 11:56:05.132154", + "module": "Healthcare", + "name": "prescription", + "payment_button_help": null, + "payment_button_label": "Buy Now", + "payment_gateway": null, + "print_format": "Consultation Print", + "published": 1, + "route": "prescription", + "show_sidebar": 1, + "sidebar_items": [], + "success_message": null, + "success_url": "/prescription", + "title": "Prescription", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "physician", + "fieldtype": "Link", + "hidden": 0, + "label": "Doctor", + "max_length": 0, + "max_value": 0, + "options": "Physician", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "visit_department", + "fieldtype": "Link", + "hidden": 0, + "label": "Department", + "max_length": 0, + "max_value": 0, + "options": "Medical Department", + "read_only": 0, + "reqd": 0 + }, + { + "default": "Today", + "description": null, + "fieldname": "consultation_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Consultation Date", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": "", + "description": null, + "fieldname": "consultation_time", + "fieldtype": "Data", + "hidden": 0, + "label": "Consultation Time", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "drug_prescription", + "fieldtype": "Table", + "hidden": 0, + "label": "Drug Prescription", + "max_length": 0, + "max_value": 0, + "options": "Drug Prescription", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "test_prescription", + "fieldtype": "Table", + "hidden": 0, + "label": "Investigations", + "max_length": 0, + "max_value": 0, + "options": "Lab Prescription", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "consultation_comment", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Review Details", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 1, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": null, + "currency": "INR", + "doc_type": "Patient Appointment", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": "Patient Appointments", + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2017-06-07 15:57:27.196428", + "module": "Healthcare", + "name": "patient-appointments", + "payment_button_help": null, + "payment_button_label": "Buy Now", + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "patient-appointments", + "show_sidebar": 1, + "sidebar_items": [], + "success_message": null, + "success_url": "/patient-appointments", + "title": "Patient Appointments", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": "patient", + "fieldtype": "Link", + "hidden": 0, + "label": "Patient", + "max_length": 0, + "max_value": 0, + "options": "Patient", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "physician", + "fieldtype": "Link", + "hidden": 0, + "label": "Physician", + "max_length": 0, + "max_value": 0, + "options": "Physician", + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "appointment_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Date", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 1 + }, + { + "default": null, + "description": null, + "fieldname": "appointment_time", + "fieldtype": "Data", + "hidden": 0, + "label": "Time", + "max_length": 0, + "max_value": 0, + "options": null, + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "department", + "fieldtype": "Link", + "hidden": 0, + "label": "Department", + "max_length": 0, + "max_value": 0, + "options": "Medical Department", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "appointment_type", + "fieldtype": "Link", + "hidden": 0, + "label": "Type", + "max_length": 0, + "max_value": 0, + "options": "Appointment Type", + "read_only": 0, + "reqd": 0 + }, + { + "default": "Scheduled", + "description": null, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "label": "Status", + "max_length": 0, + "max_value": 0, + "options": "\nScheduled\nOpen\nClosed\nPending\nCancelled", + "read_only": 1, + "reqd": 0 + } + ], + "web_page_link_text": null + }, + { + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 1, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "amount_field": null, + "breadcrumbs": null, + "currency": "INR", + "doc_type": "Dispatch Items", + "docstatus": 0, + "doctype": "Web Form", + "introduction_text": "", + "is_standard": 0, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2017-09-14 10:14:01.771759", + "module": "Projects", + "name": "dispatch", + "payment_button_help": null, + "payment_button_label": "Buy Now", + "payment_gateway": null, + "print_format": null, + "published": 1, + "route": "dispatch", + "show_sidebar": 1, + "sidebar_items": [], + "success_message": "done", + "success_url": "/me", + "title": "Dispatch", + "web_form_fields": [ + { + "default": null, + "description": null, + "fieldname": null, + "fieldtype": "Table", + "hidden": 0, + "label": null, + "max_length": 0, + "max_value": 0, + "options": "Dispatch", + "read_only": 0, + "reqd": 0 + }, + { + "default": null, + "description": null, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 0, + "label": "Amended From", + "max_length": 0, + "max_value": 0, + "options": "Dispatch", + "read_only": 0, + "reqd": 0 + } + ], + "web_page_link_text": null + } +] \ No newline at end of file diff --git a/erpnext/projects/doctype/project/project.json b/erpnext/projects/doctype/project/project.json index 101e4ff1c..1a2d7b499 100644 --- a/erpnext/projects/doctype/project/project.json +++ b/erpnext/projects/doctype/project/project.json @@ -3,7 +3,7 @@ "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, - "autoname": "field:project_name", + "autoname": "PRJ-.#####./2018-19", "beta": 0, "creation": "2013-03-07 11:55:07", "custom": 0, @@ -1255,8 +1255,8 @@ "issingle": 0, "istable": 0, "max_attachments": 4, - "modified": "2017-07-26 14:36:20.857673", - "modified_by": "Administrator", + "modified": "2018-04-02 16:57:58.995668", + "modified_by": "basant.mahar9819@gmail.com", "module": "Projects", "name": "Project", "owner": "Administrator", @@ -1320,6 +1320,46 @@ "share": 1, "submit": 0, "write": 1 + }, + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Installation Engineer", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 0, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 3, + "print": 1, + "read": 1, + "report": 1, + "role": "Installation Engineer", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 } ], "quick_entry": 1, diff --git a/erpnext/projects/doctype/project/project_dashboard.py b/erpnext/projects/doctype/project/project_dashboard.py index 0ac7d6fc3..7623a3aae 100644 --- a/erpnext/projects/doctype/project/project_dashboard.py +++ b/erpnext/projects/doctype/project/project_dashboard.py @@ -16,7 +16,7 @@ def get_data(): }, { 'label': _('Sales'), - 'items': ['Sales Order', 'Delivery Note', 'Sales Invoice'] + 'items': ['Quotation','Sales Order', 'Delivery Note', 'Sales Invoice','Dispatch Items'] }, { 'label': _('Purchase'), diff --git a/erpnext/projects/doctype/project/project_dashboard.py.old b/erpnext/projects/doctype/project/project_dashboard.py.old new file mode 100755 index 000000000..0ac7d6fc3 --- /dev/null +++ b/erpnext/projects/doctype/project/project_dashboard.py.old @@ -0,0 +1,26 @@ +from frappe import _ + +def get_data(): + return { + 'heatmap': True, + 'heatmap_message': _('This is based on the Time Sheets created against this project'), + 'fieldname': 'project', + 'transactions': [ + { + 'label': _('Project'), + 'items': ['Task', 'Timesheet', 'Expense Claim', 'Issue'] + }, + { + 'label': _('Material'), + 'items': ['Material Request', 'BOM', 'Stock Entry'] + }, + { + 'label': _('Sales'), + 'items': ['Sales Order', 'Delivery Note', 'Sales Invoice'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'] + }, + ] + } diff --git a/erpnext/projects/doctype/project/project_dashboard.py_1209 b/erpnext/projects/doctype/project/project_dashboard.py_1209 new file mode 100755 index 000000000..94790e1b0 --- /dev/null +++ b/erpnext/projects/doctype/project/project_dashboard.py_1209 @@ -0,0 +1,26 @@ +from frappe import _ + +def get_data(): + return { + 'heatmap': True, + 'heatmap_message': _('This is based on the Time Sheets created against this project'), + 'fieldname': 'project', + 'transactions': [ + { + 'label': _('Project'), + 'items': ['Task', 'Timesheet', 'Expense Claim', 'Issue'] + }, + { + 'label': _('Material'), + 'items': ['Material Request', 'BOM', 'Stock Entry'] + }, + { + 'label': _('Sales'), + 'items': ['Quotation','Sales Order', 'Delivery Note', 'Sales Invoice'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'] + }, + ] + } diff --git a/erpnext/projects/doctype/project/project_dashboard.py_final b/erpnext/projects/doctype/project/project_dashboard.py_final new file mode 100644 index 000000000..440fcff44 --- /dev/null +++ b/erpnext/projects/doctype/project/project_dashboard.py_final @@ -0,0 +1,26 @@ +from frappe import _ + +def get_data(): + return { + 'heatmap': True, + 'heatmap_message': _('This is based on the Time Sheets created against this project'), + 'fieldname': 'project', + 'transactions': [ + { + 'label': _('Project'), + 'items': ['Task', 'Timesheet', 'Expense Claim', 'Issue'] + }, + { + 'label': _('Material'), + 'items': ['Material Request', 'BOM', 'Stock Entry'] + }, + { + 'label': _('Sales'), + 'items': ['Quotation','Sales Order', 'Delivery Note', 'Sales Invoice','Dispatch'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'] + }, + ] + } diff --git a/erpnext/projects/doctype/project/test_project.js b/erpnext/projects/doctype/project/test_project.js new file mode 100644 index 000000000..16494f62b --- /dev/null +++ b/erpnext/projects/doctype/project/test_project.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Project", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Project + () => frappe.tests.make('Project', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/regional/print_format/gst_tax_invoice/gst_tax_invoice.json b/erpnext/regional/print_format/gst_tax_invoice/gst_tax_invoice.json index 55d870f99..0d26d0937 100644 --- a/erpnext/regional/print_format/gst_tax_invoice/gst_tax_invoice.json +++ b/erpnext/regional/print_format/gst_tax_invoice/gst_tax_invoice.json @@ -7,11 +7,11 @@ "docstatus": 0, "doctype": "Print Format", "font": "Default", - "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"
\\n\\t

\\n\\t\\tTAX INVOICE
\\n\\t\\t{{ doc.name }}\\n\\t

\\n
\\n

\\n\\t{% if doc.invoice_copy -%}\\n\\t\\t{{ doc.invoice_copy }}\\n\\t{% endif -%}\\n

\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"company\", \"label\": \"Company\"}, {\"print_hide\": 0, \"fieldname\": \"company_address_display\", \"label\": \"Company Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"posting_date\", \"label\": \"Date\"}, {\"print_hide\": 0, \"fieldname\": \"due_date\", \"label\": \"Payment Due Date\"}, {\"print_hide\": 0, \"fieldname\": \"reverse_charge\", \"label\": \"Reverse Charge\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"options\": \"
\", \"fieldname\": \"_custom_html\", \"fieldtype\": \"HTML\", \"label\": \"Custom HTML\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name\", \"label\": \"Customer Name\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"shipping_address\", \"label\": \"Shipping Address\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"200px\"}, {\"print_hide\": 0, \"fieldname\": \"gst_hsn_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"serial_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Sales Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\", \"label\": \"Rounded Total\"}, {\"print_hide\": 0, \"fieldname\": \"in_words\", \"label\": \"In Words\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"other_charges_calculation\", \"align\": \"left\", \"label\": \"Tax Breakup\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Terms\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions Details\"}]", + "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"\\n\\n
\\t\\t\\t\\t

TAX INVOICE

{{doc.name}}


\\n

(Original For Recipient)

\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"company\", \"label\": \"Company\"}, {\"print_hide\": 0, \"fieldname\": \"company_address_display\", \"label\": \"Company Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"posting_date\", \"label\": \"Date\"}, {\"print_hide\": 0, \"fieldname\": \"due_date\", \"label\": \"Payment Due Date\"}, {\"print_hide\": 0, \"fieldname\": \"po_no\", \"align\": \"left\", \"label\": \"Customer's Purchase Order\"}, {\"print_hide\": 0, \"fieldname\": \"po_date\", \"label\": \"Customer's Purchase Order Date\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"options\": \"
\", \"fieldname\": \"_custom_html\", \"fieldtype\": \"HTML\", \"label\": \"Custom HTML\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name\", \"label\": \"Customer Name\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"shipping_address\", \"label\": \"Shipping Address\"}, {\"print_hide\": 0, \"fieldname\": \"modes_of_dispatch\", \"label\": \"Modes of dispatch\"}, {\"print_hide\": 0, \"fieldname\": \"mode_of_shipment_\", \"label\": \"Mode Of Shipment \"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"200px\"}, {\"print_hide\": 0, \"fieldname\": \"gst_hsn_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"serial_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Sales Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\", \"label\": \"Rounded Total\"}, {\"print_hide\": 0, \"fieldname\": \"in_words\", \"label\": \"In Words\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"other_charges_calculation\", \"align\": \"left\", \"label\": \"Tax Breakup\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Terms\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions Details\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"options\": \"

\\n

\\n\\n

\\t\\t\\t\\t

TAX INVOICE


{{doc.name}}


\\n\", \"fieldname\": \"_custom_html\", \"fieldtype\": \"HTML\", \"label\": \"Custom HTML\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"options\": \"
\\n
\", \"fieldname\": \"_custom_html\", \"fieldtype\": \"HTML\", \"label\": \"Custom HTML\"}, {\"print_hide\": 0, \"fieldname\": \"company\", \"label\": \"Company\"}, {\"print_hide\": 0, \"fieldname\": \"company_address_display\", \"label\": \"Company Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"options\": \"

(Duplicate For Transportor)

\\n
\", \"fieldname\": \"_custom_html\", \"fieldtype\": \"HTML\", \"label\": \"Custom HTML\"}, {\"print_hide\": 0, \"fieldname\": \"posting_date\", \"label\": \"Date\"}, {\"print_hide\": 0, \"fieldname\": \"due_date\", \"label\": \"Payment Due Date\"}, {\"print_hide\": 0, \"fieldname\": \"quotation_number_\", \"label\": \"Quotation Number \"}, {\"print_hide\": 0, \"fieldname\": \"po_no\", \"label\": \"Customer P.O NO\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name\", \"label\": \"Customer Name\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"shipping_address\", \"label\": \"Shipping Address\"}, {\"print_hide\": 0, \"fieldname\": \"modes_of_dispatch\", \"label\": \"Modes of dispatch\"}, {\"print_hide\": 0, \"fieldname\": \"mode_of_shipment_\", \"label\": \"Mode Of Shipment \"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"200px\"}, {\"print_hide\": 0, \"fieldname\": \"gst_hsn_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"serial_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Sales Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\", \"label\": \"Rounded Total\"}, {\"print_hide\": 0, \"fieldname\": \"in_words\", \"label\": \"In Words\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"other_charges_calculation\", \"align\": \"left\", \"label\": \"Tax Breakup\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions Details\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"options\": \"

\\n

\\n\\n

\\t\\t\\t\\t

TAX INVOICE


{{doc.name}}


\\n\", \"fieldname\": \"_custom_html\", \"fieldtype\": \"HTML\", \"label\": \"Custom HTML\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"options\": \"
\\n
\", \"fieldname\": \"_custom_html\", \"fieldtype\": \"HTML\", \"label\": \"Custom HTML\"}, {\"print_hide\": 0, \"fieldname\": \"company\", \"label\": \"Company\"}, {\"print_hide\": 0, \"fieldname\": \"company_address_display\", \"label\": \"Company Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"options\": \"\\n

(Triplicate For Supplier)

\\n
\", \"fieldname\": \"_custom_html\", \"fieldtype\": \"HTML\", \"label\": \"Custom HTML\"}, {\"print_hide\": 0, \"fieldname\": \"posting_date\", \"label\": \"Date\"}, {\"print_hide\": 0, \"fieldname\": \"due_date\", \"label\": \"Payment Due Date\"}, {\"print_hide\": 0, \"fieldname\": \"quotation_number_\", \"label\": \"Quotation Number \"}, {\"print_hide\": 0, \"fieldname\": \"po_no\", \"label\": \"Customer P.O NO\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name\", \"label\": \"Customer Name\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"shipping_address\", \"label\": \"Shipping Address\"}, {\"print_hide\": 0, \"fieldname\": \"modes_of_dispatch\", \"label\": \"Modes of dispatch\"}, {\"print_hide\": 0, \"fieldname\": \"mode_of_shipment_\", \"label\": \"Mode Of Shipment \"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"200px\"}, {\"print_hide\": 0, \"fieldname\": \"gst_hsn_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"serial_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Sales Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\", \"label\": \"Rounded Total\"}, {\"print_hide\": 0, \"fieldname\": \"in_words\", \"label\": \"In Words\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"other_charges_calculation\", \"align\": \"left\", \"label\": \"Tax Breakup\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions Details\"}]", "idx": 0, "line_breaks": 0, - "modified": "2017-09-11 14:56:25.303797", - "modified_by": "Administrator", + "modified": "2017-11-14 11:04:19.619400", + "modified_by": "basant.mahar9819@gmail.com", "module": "Regional", "name": "GST Tax Invoice", "owner": "Administrator", diff --git a/erpnext/selling/doctype/sales_order/sales_order.js_23_9_17 b/erpnext/selling/doctype/sales_order/sales_order.js_23_9_17 new file mode 100755 index 000000000..cc56c92c3 --- /dev/null +++ b/erpnext/selling/doctype/sales_order/sales_order.js_23_9_17 @@ -0,0 +1,438 @@ +// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + +{% include 'erpnext/selling/sales_common.js' %} + +frappe.ui.form.on("Sales Order", { + setup: function(frm) { + frm.custom_make_buttons = { + 'Delivery Note': 'Delivery', + 'Sales Invoice': 'Invoice', + 'Material Request': 'Material Request', + 'Purchase Order': 'Purchase Order', + 'Project': 'Project' + } + frm.add_fetch('customer', 'tax_id', 'tax_id'); + }, + onload: function(frm) { + erpnext.queries.setup_queries(frm, "Warehouse", function() { + return erpnext.queries.warehouse(frm.doc); + }); + + frm.set_query('project', function(doc, cdt, cdn) { + return { + query: "erpnext.controllers.queries.get_project_name", + filters: { + 'customer': doc.customer + } + } + }); + + // formatter for material request item + frm.set_indicator_formatter('item_code', + function(doc) { return (doc.stock_qty<=doc.delivered_qty) ? "green" : "orange" }) + + erpnext.queries.setup_warehouse_query(frm); + }, + + delivery_date: function(frm) { + $.each(frm.doc.items || [], function(i, d) { + if(!d.delivery_date) d.delivery_date = frm.doc.delivery_date; + }); + refresh_field("items"); + } +}); + +frappe.ui.form.on("Sales Order Item", { + delivery_date: function(frm, cdt, cdn) { + if(!frm.doc.delivery_date) { + erpnext.utils.copy_value_in_all_row(frm.doc, cdt, cdn, "items", "delivery_date"); + } + } +}); + +erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({ + refresh: function(doc, dt, dn) { + var me = this; + this._super(); + var allow_purchase = false; + var allow_delivery = false; + + if(doc.docstatus==1) { + if(doc.status != 'Closed') { + + for (var i in this.frm.doc.items) { + var item = this.frm.doc.items[i]; + if(item.delivered_by_supplier === 1 || item.supplier){ + if(item.qty > flt(item.ordered_qty) + && item.qty > flt(item.delivered_qty)) { + allow_purchase = true; + } + } + + if (item.delivered_by_supplier===0) { + if(item.qty > flt(item.delivered_qty)) { + allow_delivery = true; + } + } + + if (allow_delivery && allow_purchase) { + break; + } + } + + if (this.frm.has_perm("submit")) { + // close + if(flt(doc.per_delivered, 2) < 100 || flt(doc.per_billed) < 100) { + this.frm.add_custom_button(__('Close'), + function() { me.close_sales_order() }, __("Status")) + } + } + + // delivery note + if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) { + this.frm.add_custom_button(__('Delivery'), + function() { me.make_delivery_note_based_on_delivery_note(); }, __("Make")); + this.frm.add_custom_button(__('Production Order'), + function() { me.make_production_order() }, __("Make")); + + this.frm.page.set_inner_btn_group_as_primary(__("Make")); + } + + // sales invoice + if(flt(doc.per_billed, 2) < 100) { + this.frm.add_custom_button(__('Invoice'), + function() { me.make_sales_invoice() }, __("Make")); + } + + // material request + if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 + && flt(doc.per_delivered, 2) < 100) { + this.frm.add_custom_button(__('Material Request'), + function() { me.make_material_request() }, __("Make")); + } + + // make purchase order + if(flt(doc.per_delivered, 2) < 100 && allow_purchase) { + this.frm.add_custom_button(__('Purchase Order'), + function() { me.make_purchase_order() }, __("Make")); + } + + // payment request + if(flt(doc.per_billed)==0) { + this.frm.add_custom_button(__('Payment Request'), + function() { me.make_payment_request() }, __("Make")); + this.frm.add_custom_button(__('Payment'), + function() { me.make_payment_entry() }, __("Make")); + } + + // maintenance + if(flt(doc.per_delivered, 2) < 100 && + ["Sales", "Shopping Cart"].indexOf(doc.order_type)===-1) { + this.frm.add_custom_button(__('Maintenance Visit'), + function() { me.make_maintenance_visit() }, __("Make")); + this.frm.add_custom_button(__('Maintenance Schedule'), + function() { me.make_maintenance_schedule() }, __("Make")); + } + + // project + if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) { + this.frm.add_custom_button(__('Project'), + function() { me.make_project() }, __("Make")); + } + + } else { + if (this.frm.has_perm("submit")) { + // un-close + this.frm.add_custom_button(__('Re-open'), function() { + me.frm.cscript.update_status('Re-open', 'Draft') + }, __("Status")); + } + } + } + + if (this.frm.doc.docstatus===0) { + this.frm.add_custom_button(__('Quotation'), + function() { + erpnext.utils.map_current_doc({ + method: "erpnext.selling.doctype.quotation.quotation.make_sales_order", + source_doctype: "Quotation", + target: me.frm, + setters: { + customer: me.frm.doc.customer || undefined, + shipping_person: me.frm.doc.shipping_person + }, + get_query_filters: { + company: me.frm.doc.company, + docstatus: 1, + status: ["!=", "Lost"], + } + }) + }, __("Get items from")); + } + + this.order_type(doc); + }, + + make_production_order() { + var me = this; + this.frm.call({ + doc: this.frm.doc, + method: 'get_production_order_items', + callback: function(r) { + if(!r.message.every(function(d) { return !!d.bom })) { + frappe.msgprint({ + title: __('Production Order not created'), + message: __('No Items with Bill of Materials to Manufacture'), + indicator: 'orange' + }); + return; + } + else if(!r.message.every(function(d) { return !!d.pending_qty })) { + frappe.msgprint({ + title: __('Production Order not created'), + message: __('Production Order already created for all items with BOM'), + indicator: 'orange' + }); + return; + } else { + var fields = [ + {fieldtype:'Table', fieldname: 'items', + description: __('Select BOM and Qty for Production'), + fields: [ + {fieldtype:'Read Only', fieldname:'item_code', + label: __('Item Code'), in_list_view:1}, + {fieldtype:'Link', fieldname:'bom', options: 'BOM', reqd: 1, + label: __('Select BOM'), in_list_view:1, get_query: function(doc) { + return {filters: {item: doc.item_code}}; + }}, + {fieldtype:'Float', fieldname:'pending_qty', reqd: 1, + label: __('Qty'), in_list_view:1}, + ], + get_data: function() { + return r.message + } + } + ] + var d = new frappe.ui.Dialog({ + title: __('Select Items to Manufacture'), + fields: fields, + primary_action: function() { + var data = d.get_values(); + me.frm.call({ + method: 'make_production_orders', + args: { + items: data, + company: me.frm.doc.company, + sales_order: me.frm.docname, + project: me.frm.project + }, + freeze: true, + callback: function(r) { + if(r.message) { + frappe.msgprint({ + message: __('Production Orders Created: {0}', + [r.message.map(function(d) { + return repl('%(name)s', {name:d}) + }).join(', ')]), + indicator: 'green' + }) + } + d.hide(); + } + }); + }, + primary_action_label: __('Make') + }); + d.show(); + } + } + }); + }, + + order_type: function() { + this.frm.fields_dict.items.grid.toggle_reqd("delivery_date", this.frm.doc.order_type == "Sales"); + }, + + tc_name: function() { + this.get_terms(); + }, + + make_material_request: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request", + frm: this.frm + }) + }, + + make_delivery_note_based_on_delivery_note: function() { + var me = this; + + var delivery_dates = []; + $.each(this.frm.doc.items || [], function(i, d) { + if(!delivery_dates.includes(d.delivery_date)) { + delivery_dates.push(d.delivery_date); + } + }); + + var item_grid = this.frm.fields_dict["items"].grid; + if(!item_grid.get_selected().length && delivery_dates.length > 1) { + var dialog = new frappe.ui.Dialog({ + title: __("Select Items based on Delivery Date"), + fields: [{fieldtype: "HTML", fieldname: "dates_html"}] + }); + + var html = $(` +
+
+
+ ${__('Delivery Date')} +
+
+ ${delivery_dates.map(date => ` +
+
+ +
+
+ `).join("")} +
+ `); + + var wrapper = dialog.fields_dict.dates_html.$wrapper; + wrapper.html(html); + + dialog.set_primary_action(__("Select"), function() { + var dates = wrapper.find('input[type=checkbox]:checked') + .map((i, el) => $(el).attr('data-date')).toArray(); + + if(!dates) return; + + $.each(dates, function(i, d) { + $.each(item_grid.grid_rows || [], function(j, row) { + if(row.doc.delivery_date == d) { + row.doc.__checked = 1; + } + }); + }) + me.make_delivery_note(); + dialog.hide(); + }); + dialog.show(); + } else { + this.make_delivery_note(); + } + }, + + make_delivery_note: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note", + frm: me.frm + }) + }, + + make_sales_invoice: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice", + frm: this.frm + }) + }, + + make_maintenance_schedule: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule", + frm: this.frm + }) + }, + + make_project: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_project", + frm: this.frm + }) + }, + + make_maintenance_visit: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit", + frm: this.frm + }) + }, + + make_purchase_order: function(){ + var me = this; + var dialog = new frappe.ui.Dialog({ + title: __("For Supplier"), + fields: [ + {"fieldtype": "Link", "label": __("Supplier"), "fieldname": "supplier", "options":"Supplier", + "get_query": function () { + return { + query:"erpnext.selling.doctype.sales_order.sales_order.get_supplier", + filters: {'parent': me.frm.doc.name} + } + }, "reqd": 1 }, + {"fieldtype": "Button", "label": __("Make Purchase Order"), "fieldname": "make_purchase_order", "cssClass": "btn-primary"}, + ] + }); + + dialog.fields_dict.make_purchase_order.$input.click(function() { + var args = dialog.get_values(); + if(!args) return; + dialog.hide(); + return frappe.call({ + type: "GET", + method: "erpnext.selling.doctype.sales_order.sales_order.make_purchase_order_for_drop_shipment", + args: { + "source_name": me.frm.doc.name, + "for_supplier": args.supplier + }, + freeze: true, + callback: function(r) { + if(!r.exc) { + var doc = frappe.model.sync(r.message); + frappe.set_route("Form", r.message.doctype, r.message.name); + } + } + }) + }); + dialog.show(); + }, + close_sales_order: function(){ + this.frm.cscript.update_status("Close", "Closed") + }, + update_status: function(label, status){ + var doc = this.frm.doc; + var me = this; + frappe.ui.form.is_saving = true; + frappe.call({ + method: "erpnext.selling.doctype.sales_order.sales_order.update_status", + args: {status: status, name: doc.name}, + callback: function(r){ + me.frm.reload_doc(); + }, + always: function() { + frappe.ui.form.is_saving = false; + } + }); + }, + on_submit: function(doc, cdt, cdn) { + if(cint(frappe.boot.notification_settings.sales_order)) { + this.frm.email_doc(frappe.boot.notification_settings.sales_order_message); + } + }, + + items_add: function(doc, cdt, cdn) { + var row = frappe.get_doc(cdt, cdn); + if(doc.delivery_date) { + row.delivery_date = doc.delivery_date; + refresh_field("delivery_date", cdn, "items"); + } else { + this.frm.script_manager.copy_from_first_row("items", row, ["delivery_date"]); + } + } +}); + +$.extend(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm})); diff --git a/erpnext/selling/doctype/sales_order/sales_order.js_old b/erpnext/selling/doctype/sales_order/sales_order.js_old new file mode 100755 index 000000000..80dc4f23e --- /dev/null +++ b/erpnext/selling/doctype/sales_order/sales_order.js_old @@ -0,0 +1,437 @@ +// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + +{% include 'erpnext/selling/sales_common.js' %} + +frappe.ui.form.on("Sales Order", { + setup: function(frm) { + frm.custom_make_buttons = { + 'Delivery Note': 'Delivery', + 'Sales Invoice': 'Invoice', + 'Material Request': 'Material Request', + 'Purchase Order': 'Purchase Order', + 'Project': 'Project' + } + frm.add_fetch('customer', 'tax_id', 'tax_id'); + }, + onload: function(frm) { + erpnext.queries.setup_queries(frm, "Warehouse", function() { + return erpnext.queries.warehouse(frm.doc); + }); + + frm.set_query('project', function(doc, cdt, cdn) { + return { + query: "erpnext.controllers.queries.get_project_name", + filters: { + 'customer': doc.customer + } + } + }); + + // formatter for material request item + frm.set_indicator_formatter('item_code', + function(doc) { return (doc.stock_qty<=doc.delivered_qty) ? "green" : "orange" }) + + erpnext.queries.setup_warehouse_query(frm); + }, + + delivery_date: function(frm) { + $.each(frm.doc.items || [], function(i, d) { + if(!d.delivery_date) d.delivery_date = frm.doc.delivery_date; + }); + refresh_field("items"); + } +}); + +frappe.ui.form.on("Sales Order Item", { + delivery_date: function(frm, cdt, cdn) { + if(!frm.doc.delivery_date) { + erpnext.utils.copy_value_in_all_row(frm.doc, cdt, cdn, "items", "delivery_date"); + } + } +}); + +erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({ + refresh: function(doc, dt, dn) { + var me = this; + this._super(); + var allow_purchase = false; + var allow_delivery = false; + + if(doc.docstatus==1) { + if(doc.status != 'Closed') { + + for (var i in this.frm.doc.items) { + var item = this.frm.doc.items[i]; + if(item.delivered_by_supplier === 1 || item.supplier){ + if(item.qty > flt(item.ordered_qty) + && item.qty > flt(item.delivered_qty)) { + allow_purchase = true; + } + } + + if (item.delivered_by_supplier===0) { + if(item.qty > flt(item.delivered_qty)) { + allow_delivery = true; + } + } + + if (allow_delivery && allow_purchase) { + break; + } + } + + if (this.frm.has_perm("submit")) { + // close + if(flt(doc.per_delivered, 2) < 100 || flt(doc.per_billed) < 100) { + this.frm.add_custom_button(__('Close'), + function() { me.close_sales_order() }, __("Status")) + } + } + + // delivery note + if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) { + this.frm.add_custom_button(__('Delivery'), + function() { me.make_delivery_note_based_on_delivery_note(); }, __("Make")); + this.frm.add_custom_button(__('Production Order'), + function() { me.make_production_order() }, __("Make")); + + this.frm.page.set_inner_btn_group_as_primary(__("Make")); + } + + // sales invoice + if(flt(doc.per_billed, 2) < 100) { + this.frm.add_custom_button(__('Invoice'), + function() { me.make_sales_invoice() }, __("Make")); + } + + // material request + if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 + && flt(doc.per_delivered, 2) < 100) { + this.frm.add_custom_button(__('Material Request'), + function() { me.make_material_request() }, __("Make")); + } + + // make purchase order + if(flt(doc.per_delivered, 2) < 100 && allow_purchase) { + this.frm.add_custom_button(__('Purchase Order'), + function() { me.make_purchase_order() }, __("Make")); + } + + // payment request + if(flt(doc.per_billed)==0) { + this.frm.add_custom_button(__('Payment Request'), + function() { me.make_payment_request() }, __("Make")); + this.frm.add_custom_button(__('Payment'), + function() { me.make_payment_entry() }, __("Make")); + } + + // maintenance + if(flt(doc.per_delivered, 2) < 100 && + ["Sales", "Shopping Cart"].indexOf(doc.order_type)===-1) { + this.frm.add_custom_button(__('Maintenance Visit'), + function() { me.make_maintenance_visit() }, __("Make")); + this.frm.add_custom_button(__('Maintenance Schedule'), + function() { me.make_maintenance_schedule() }, __("Make")); + } + + // project + if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) { + this.frm.add_custom_button(__('Project'), + function() { me.make_project() }, __("Make")); + } + + } else { + if (this.frm.has_perm("submit")) { + // un-close + this.frm.add_custom_button(__('Re-open'), function() { + me.frm.cscript.update_status('Re-open', 'Draft') + }, __("Status")); + } + } + } + + if (this.frm.doc.docstatus===0) { + this.frm.add_custom_button(__('Quotation'), + function() { + erpnext.utils.map_current_doc({ + method: "erpnext.selling.doctype.quotation.quotation.make_sales_order", + source_doctype: "Quotation", + target: me.frm, + setters: { + customer: me.frm.doc.customer || undefined + }, + get_query_filters: { + company: me.frm.doc.company, + docstatus: 1, + status: ["!=", "Lost"], + } + }) + }, __("Get items from")); + } + + this.order_type(doc); + }, + + make_production_order() { + var me = this; + this.frm.call({ + doc: this.frm.doc, + method: 'get_production_order_items', + callback: function(r) { + if(!r.message.every(function(d) { return !!d.bom })) { + frappe.msgprint({ + title: __('Production Order not created'), + message: __('No Items with Bill of Materials to Manufacture'), + indicator: 'orange' + }); + return; + } + else if(!r.message.every(function(d) { return !!d.pending_qty })) { + frappe.msgprint({ + title: __('Production Order not created'), + message: __('Production Order already created for all items with BOM'), + indicator: 'orange' + }); + return; + } else { + var fields = [ + {fieldtype:'Table', fieldname: 'items', + description: __('Select BOM and Qty for Production'), + fields: [ + {fieldtype:'Read Only', fieldname:'item_code', + label: __('Item Code'), in_list_view:1}, + {fieldtype:'Link', fieldname:'bom', options: 'BOM', reqd: 1, + label: __('Select BOM'), in_list_view:1, get_query: function(doc) { + return {filters: {item: doc.item_code}}; + }}, + {fieldtype:'Float', fieldname:'pending_qty', reqd: 1, + label: __('Qty'), in_list_view:1}, + ], + get_data: function() { + return r.message + } + } + ] + var d = new frappe.ui.Dialog({ + title: __('Select Items to Manufacture'), + fields: fields, + primary_action: function() { + var data = d.get_values(); + me.frm.call({ + method: 'make_production_orders', + args: { + items: data, + company: me.frm.doc.company, + sales_order: me.frm.docname, + project: me.frm.project + }, + freeze: true, + callback: function(r) { + if(r.message) { + frappe.msgprint({ + message: __('Production Orders Created: {0}', + [r.message.map(function(d) { + return repl('%(name)s', {name:d}) + }).join(', ')]), + indicator: 'green' + }) + } + d.hide(); + } + }); + }, + primary_action_label: __('Make') + }); + d.show(); + } + } + }); + }, + + order_type: function() { + this.frm.fields_dict.items.grid.toggle_reqd("delivery_date", this.frm.doc.order_type == "Sales"); + }, + + tc_name: function() { + this.get_terms(); + }, + + make_material_request: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request", + frm: this.frm + }) + }, + + make_delivery_note_based_on_delivery_note: function() { + var me = this; + + var delivery_dates = []; + $.each(this.frm.doc.items || [], function(i, d) { + if(!delivery_dates.includes(d.delivery_date)) { + delivery_dates.push(d.delivery_date); + } + }); + + var item_grid = this.frm.fields_dict["items"].grid; + if(!item_grid.get_selected().length && delivery_dates.length > 1) { + var dialog = new frappe.ui.Dialog({ + title: __("Select Items based on Delivery Date"), + fields: [{fieldtype: "HTML", fieldname: "dates_html"}] + }); + + var html = $(` +
+
+
+ ${__('Delivery Date')} +
+
+ ${delivery_dates.map(date => ` +
+
+ +
+
+ `).join("")} +
+ `); + + var wrapper = dialog.fields_dict.dates_html.$wrapper; + wrapper.html(html); + + dialog.set_primary_action(__("Select"), function() { + var dates = wrapper.find('input[type=checkbox]:checked') + .map((i, el) => $(el).attr('data-date')).toArray(); + + if(!dates) return; + + $.each(dates, function(i, d) { + $.each(item_grid.grid_rows || [], function(j, row) { + if(row.doc.delivery_date == d) { + row.doc.__checked = 1; + } + }); + }) + me.make_delivery_note(); + dialog.hide(); + }); + dialog.show(); + } else { + this.make_delivery_note(); + } + }, + + make_delivery_note: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note", + frm: me.frm + }) + }, + + make_sales_invoice: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice", + frm: this.frm + }) + }, + + make_maintenance_schedule: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule", + frm: this.frm + }) + }, + + make_project: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_project", + frm: this.frm + }) + }, + + make_maintenance_visit: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit", + frm: this.frm + }) + }, + + make_purchase_order: function(){ + var me = this; + var dialog = new frappe.ui.Dialog({ + title: __("For Supplier"), + fields: [ + {"fieldtype": "Link", "label": __("Supplier"), "fieldname": "supplier", "options":"Supplier", + "get_query": function () { + return { + query:"erpnext.selling.doctype.sales_order.sales_order.get_supplier", + filters: {'parent': me.frm.doc.name} + } + }, "reqd": 1 }, + {"fieldtype": "Button", "label": __("Make Purchase Order"), "fieldname": "make_purchase_order", "cssClass": "btn-primary"}, + ] + }); + + dialog.fields_dict.make_purchase_order.$input.click(function() { + var args = dialog.get_values(); + if(!args) return; + dialog.hide(); + return frappe.call({ + type: "GET", + method: "erpnext.selling.doctype.sales_order.sales_order.make_purchase_order_for_drop_shipment", + args: { + "source_name": me.frm.doc.name, + "for_supplier": args.supplier + }, + freeze: true, + callback: function(r) { + if(!r.exc) { + var doc = frappe.model.sync(r.message); + frappe.set_route("Form", r.message.doctype, r.message.name); + } + } + }) + }); + dialog.show(); + }, + close_sales_order: function(){ + this.frm.cscript.update_status("Close", "Closed") + }, + update_status: function(label, status){ + var doc = this.frm.doc; + var me = this; + frappe.ui.form.is_saving = true; + frappe.call({ + method: "erpnext.selling.doctype.sales_order.sales_order.update_status", + args: {status: status, name: doc.name}, + callback: function(r){ + me.frm.reload_doc(); + }, + always: function() { + frappe.ui.form.is_saving = false; + } + }); + }, + on_submit: function(doc, cdt, cdn) { + if(cint(frappe.boot.notification_settings.sales_order)) { + this.frm.email_doc(frappe.boot.notification_settings.sales_order_message); + } + }, + + items_add: function(doc, cdt, cdn) { + var row = frappe.get_doc(cdt, cdn); + if(doc.delivery_date) { + row.delivery_date = doc.delivery_date; + refresh_field("delivery_date", cdn, "items"); + } else { + this.frm.script_manager.copy_from_first_row("items", row, ["delivery_date"]); + } + } +}); + +$.extend(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm})); \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index b57895ad7..6104b12d0 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -397,8 +397,6 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "", - "description": "", "fieldname": "po_no", "fieldtype": "Data", "hidden": 0, @@ -411,9 +409,8 @@ "label": "Customer's Purchase Order", "length": 0, "no_copy": 0, - "oldfieldname": "po_no", - "oldfieldtype": "Data", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -422,8 +419,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, - "unique": 0, - "width": "100px" + "unique": 0 }, { "allow_bulk_edit": 0, @@ -431,8 +427,6 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.po_no", - "description": "", "fieldname": "po_date", "fieldtype": "Date", "hidden": 0, @@ -445,9 +439,8 @@ "label": "Customer's Purchase Order Date", "length": 0, "no_copy": 0, - "oldfieldname": "po_date", - "oldfieldtype": "Date", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -456,8 +449,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, - "unique": 0, - "width": "100px" + "unique": 0 }, { "allow_bulk_edit": 0, @@ -3783,8 +3775,8 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-09-19 11:21:36.332326", - "modified_by": "Administrator", + "modified": "2017-11-13 13:43:15.220483", + "modified_by": "basant.mahar9819@gmail.com", "module": "Selling", "name": "Sales Order", "owner": "Administrator", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js_1209 b/erpnext/stock/doctype/delivery_note/delivery_note.js_1209 new file mode 100755 index 000000000..46d536dac --- /dev/null +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js_1209 @@ -0,0 +1,271 @@ +// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + +{% include 'erpnext/selling/sales_common.js' %}; + +cur_frm.add_fetch('customer', 'tax_id', 'tax_id'); + +frappe.provide("erpnext.stock"); +frappe.provide("erpnext.stock.delivery_note"); + +frappe.ui.form.on("Delivery Note", { + setup: function(frm) { + frm.custom_make_buttons = { + 'Packing Slip': 'Packing Slip', + 'Installation Note': 'Installation Note', + 'Sales Invoice': 'Invoice', + 'Stock Entry': 'Return', + }, + frm.set_indicator_formatter('item_code', + function(doc) { + return (doc.docstatus==1 || doc.qty<=doc.actual_qty) ? "green" : "orange" + }) + + erpnext.queries.setup_warehouse_query(frm); + + frm.set_query('project', function(doc) { + return { + query: "erpnext.controllers.queries.get_project_name", + filters: { + 'customer': doc.customer + } + } + }) + + frm.set_query('transporter_name', function(doc) { + return { + filters: { 'supplier_type': "transporter" } + } + }); + + + frm.set_query('expense_account', 'items', function(doc, cdt, cdn) { + if (erpnext.is_perpetual_inventory_enabled(doc.company)) { + return { + filters: { + "report_type": "Profit and Loss", + "company": doc.company, + "is_group": 0 + } + } + } + }); + + frm.set_query('cost_center', 'items', function(doc, cdt, cdn) { + if (erpnext.is_perpetual_inventory_enabled(doc.company)) { + return { + filters: { + 'company': doc.company, + "is_group": 0 + } + } + } + }); + + + }, + print_without_amount: function(frm) { + erpnext.stock.delivery_note.set_print_hide(frm.doc); + }, + on_submit: function(frm) { + if(cint(frappe.boot.notification_settings.delivery_note)) { + frm.email_doc(frappe.boot.notification_settings.delivery_note_message); + } + } +}); + +frappe.ui.form.on("Delivery Note Item", { + expense_account: function(frm, dt, dn) { + var d = locals[dt][dn]; + frm.update_in_all_rows('items', 'expense_account', d.expense_account); + }, + cost_center: function(frm, dt, dn) { + var d = locals[dt][dn]; + frm.update_in_all_rows('items', 'cost_center', d.cost_center); + } +}); + +erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend({ + setup: function(doc) { + this.setup_posting_date_time_check(); + this._super(doc); + }, + refresh: function(doc, dt, dn) { + var me = this; + this._super(); + if (!doc.is_return && doc.status!="Closed") { + if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1) + this.frm.add_custom_button(__('Installation Note'), function() { + me.make_installation_note() }, __("Make")); + + if (doc.docstatus==1) { + this.frm.add_custom_button(__('Sales Return'), function() { + me.make_sales_return() }, __("Make")); + } + + if(doc.docstatus==0 && !doc.__islocal) { + this.frm.add_custom_button(__('Packing Slip'), function() { + frappe.model.open_mapped_doc({ + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_packing_slip", + frm: me.frm + }) }, __("Make")); + } + + if (!doc.__islocal && doc.docstatus==1) { + this.frm.page.set_inner_btn_group_as_primary(__("Make")); + } + + if (this.frm.doc.docstatus===0) { + this.frm.add_custom_button(__('Sales Order'), + function() { + erpnext.utils.map_current_doc({ + method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note", + source_doctype: "Sales Order", + target: me.frm, + setters: { + customer: me.frm.doc.customer || undefined, + }, + get_query_filters: { + docstatus: 1, + status: ["!=", "Closed"], + per_delivered: ["<", 99.99], + company: me.frm.doc.company, + project: me.frm.doc.project || undefined, + } + }) + }, __("Get items from")); + } + } + + if (doc.docstatus==1) { + this.show_stock_ledger(); + if (erpnext.is_perpetual_inventory_enabled(doc.company)) { + this.show_general_ledger(); + } + if (this.frm.has_perm("submit") && doc.status !== "Closed") { + me.frm.add_custom_button(__("Close"), function() { me.close_delivery_note() }, + __("Status")) + } + } + + if(doc.docstatus==1 && !doc.is_return && doc.status!="Closed" && flt(doc.per_billed) < 100) { + // show Make Invoice button only if Delivery Note is not created from Sales Invoice + var from_sales_invoice = false; + from_sales_invoice = me.frm.doc.items.some(function(item) { + return item.against_sales_invoice ? true : false; + }); + + if(!from_sales_invoice) { + this.frm.add_custom_button(__('Invoice'), function() { me.make_sales_invoice() }, + __("Make")); + } + } + + if(doc.docstatus==1 && doc.status === "Closed" && this.frm.has_perm("submit")) { + this.frm.add_custom_button(__('Reopen'), function() { me.reopen_delivery_note() }, + __("Status")) + } + erpnext.stock.delivery_note.set_print_hide(doc, dt, dn); + }, + + make_sales_invoice: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice", + frm: this.frm + }) + }, + + make_installation_note: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_installation_note", + frm: this.frm + }); + }, + + make_sales_return: function() { + frappe.model.open_mapped_doc({ + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_return", + frm: this.frm + }) + }, + + tc_name: function() { + this.get_terms(); + }, + + items_on_form_rendered: function(doc, grid_row) { + erpnext.setup_serial_no(); + }, + + close_delivery_note: function(doc){ + this.update_status("Closed") + }, + + reopen_delivery_note : function() { + this.update_status("Submitted") + }, + + update_status: function(status) { + var me = this; + frappe.ui.form.is_saving = true; + frappe.call({ + method:"erpnext.stock.doctype.delivery_note.delivery_note.update_delivery_note_status", + args: {docname: me.frm.doc.name, status: status}, + callback: function(r){ + if(!r.exc) + me.frm.reload_doc(); + }, + always: function(){ + frappe.ui.form.is_saving = false; + } + }) + } + +}); + +$.extend(cur_frm.cscript, new erpnext.stock.DeliveryNoteController({frm: cur_frm})); + +frappe.ui.form.on('Delivery Note', { + setup: function(frm) { + if(frm.doc.company) { + frm.trigger("unhide_account_head"); + } + }, + + company: function(frm) { + frm.trigger("unhide_account_head"); + }, + + unhide_account_head: function(frm) { + // unhide expense_account and cost_center if perpetual inventory is enabled in the company + var aii_enabled = erpnext.is_perpetual_inventory_enabled(frm.doc.company) + frm.fields_dict["items"].grid.set_column_disp(["expense_account", "cost_center"], aii_enabled); + } +}) + + +erpnext.stock.delivery_note.set_print_hide = function(doc, cdt, cdn){ + var dn_fields = frappe.meta.docfield_map['Delivery Note']; + var dn_item_fields = frappe.meta.docfield_map['Delivery Note Item']; + var dn_fields_copy = dn_fields; + var dn_item_fields_copy = dn_item_fields; + + if (doc.print_without_amount) { + dn_fields['currency'].print_hide = 1; + dn_item_fields['rate'].print_hide = 1; + dn_item_fields['discount_percentage'].print_hide = 1; + dn_item_fields['price_list_rate'].print_hide = 1; + dn_item_fields['amount'].print_hide = 1; + dn_fields['taxes'].print_hide = 1; + } else { + if (dn_fields_copy['currency'].print_hide != 1) + dn_fields['currency'].print_hide = 0; + if (dn_item_fields_copy['rate'].print_hide != 1) + dn_item_fields['rate'].print_hide = 0; + if (dn_item_fields_copy['amount'].print_hide != 1) + dn_item_fields['amount'].print_hide = 0; + if (dn_fields_copy['taxes'].print_hide != 1) + dn_fields['taxes'].print_hide = 0; + } +} + diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 525321c5a..0290ef035 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -481,6 +481,68 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "fieldname": "is_purchase_item", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Is Purchase Item", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "fieldname": "is_sales_item", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Is Sales Item", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -1442,37 +1504,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "fieldname": "is_purchase_item", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Purchase Item", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -2069,37 +2100,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "fieldname": "is_sales_item", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Sales Item", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -3205,8 +3205,8 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2017-09-27 14:08:02.948326", - "modified_by": "Administrator", + "modified": "2017-11-01 19:55:20.529256", + "modified_by": "basant.mahar9819@gmail.com", "module": "Stock", "name": "Item", "owner": "Administrator", diff --git a/erpnext/stock/doctype/item/test_item.js b/erpnext/stock/doctype/item/test_item.js new file mode 100644 index 000000000..af44278a5 --- /dev/null +++ b/erpnext/stock/doctype/item/test_item.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Item", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Item + () => frappe.tests.make('Item', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +});