Merge pull request #2231 from rmehta/item-variants
Item variants
diff --git a/.travis.yml b/.travis.yml
index 344637a..c3132c7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,6 +14,8 @@
- sudo apt-get update
- sudo apt-get purge -y mysql-common
- sudo apt-get install mariadb-server mariadb-common libmariadbclient-dev
+ - ./ci/fix-mariadb.sh
+
- wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-precise-amd64.deb
- sudo dpkg -i wkhtmltox-0.12.1_linux-precise-amd64.deb
- CFLAGS=-O0 pip install git+https://github.com/frappe/frappe.git@v5.0
diff --git a/ci/fix-mariadb.sh b/ci/fix-mariadb.sh
new file mode 100755
index 0000000..886ec5e
--- /dev/null
+++ b/ci/fix-mariadb.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# stolen from http://cgit.drupalcode.org/octopus/commit/?id=db4f837
+includedir=`mysql_config --variable=pkgincludedir`
+thiscwd=`pwd`
+_THIS_DB_VERSION=`mysql -V 2>&1 | tr -d "\n" | cut -d" " -f6 | awk '{ print $1}' | cut -d"-" -f1 | awk '{ print $1}' | sed "s/[\,']//g"`
+if [ "$_THIS_DB_VERSION" = "5.5.40" ] && [ ! -e "$includedir-$_THIS_DB_VERSION-fixed.log" ] ; then
+ cd $includedir
+ sudo patch -p1 < $thiscwd/ci/my_config.h.patch &> /dev/null
+ sudo touch $includedir-$_THIS_DB_VERSION-fixed.log
+fi
diff --git a/ci/my_config.h.patch b/ci/my_config.h.patch
new file mode 100644
index 0000000..5247b5b
--- /dev/null
+++ b/ci/my_config.h.patch
@@ -0,0 +1,22 @@
+diff -burp a/my_config.h b/my_config.h
+--- a/my_config.h 2014-10-09 19:32:46.000000000 -0400
++++ b/my_config.h 2014-10-09 19:35:12.000000000 -0400
+@@ -641,17 +641,4 @@
+ #define SIZEOF_TIME_T 8
+ /* #undef TIME_T_UNSIGNED */
+
+-/*
+- stat structure (from <sys/stat.h>) is conditionally defined
+- to have different layout and size depending on the defined macros.
+- The correct macro is defined in my_config.h, which means it MUST be
+- included first (or at least before <features.h> - so, practically,
+- before including any system headers).
+-
+- __GLIBC__ is defined in <features.h>
+-*/
+-#ifdef __GLIBC__
+-#error <my_config.h> MUST be included first!
+-#endif
+-
+ #endif
+
diff --git a/erpnext/accounts/doctype/c_form/c_form.js b/erpnext/accounts/doctype/c_form/c_form.js
index 3bcfa5e..e4046d5 100644
--- a/erpnext/accounts/doctype/c_form/c_form.js
+++ b/erpnext/accounts/doctype/c_form/c_form.js
@@ -3,6 +3,8 @@
//c-form js file
// -----------------------------
+frappe.require("assets/erpnext/js/utils.js");
+
cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = function(doc) {
return {
filters: {
@@ -22,4 +24,12 @@
cur_frm.cscript.invoice_no = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
return get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1);
+}
+
+cur_frm.cscript.company = function(doc, cdt, cdn) {
+ erpnext.get_fiscal_year(doc.company, doc.received_date);
+}
+
+cur_frm.cscript.received_date = function(doc, cdt, cdn){
+ erpnext.get_fiscal_year(doc.company, doc.received_date);
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.json b/erpnext/accounts/doctype/fiscal_year/fiscal_year.json
index 0f7aefd..3927c4f 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.json
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.json
@@ -39,23 +39,17 @@
"reqd": 1
},
{
- "default": "No",
- "description": "Entries are not allowed against this Fiscal Year if the year is closed.",
- "fieldname": "is_fiscal_year_closed",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Year Closed",
- "no_copy": 1,
- "oldfieldname": "is_fiscal_year_closed",
- "oldfieldtype": "Select",
- "options": "\nNo\nYes",
+ "fieldname": "fiscal_year_companies",
+ "fieldtype": "Table",
+ "label": "Fiscal Year Companies",
+ "options": "Fiscal Year Company",
"permlevel": 0,
- "reqd": 0
+ "precision": ""
}
],
"icon": "icon-calendar",
"idx": 1,
- "modified": "2014-07-14 05:30:56.843180",
+ "modified": "2014-10-07 12:23:41.679419",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year",
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
index cb36581..4549498 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
@@ -4,7 +4,8 @@
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
-from frappe.utils import getdate
+from frappe.utils import getdate, add_days, add_years
+from datetime import timedelta
from frappe.model.document import Document
@@ -34,11 +35,32 @@
if (getdate(self.year_end_date) - getdate(self.year_start_date)).days > 366:
frappe.throw(_("Fiscal Year Start Date and Fiscal Year End Date cannot be more than a year apart."))
+
+ check_duplicate_fiscal_year(self)
- year_start_end_dates = frappe.db.sql("""select name, year_start_date, year_end_date
- from `tabFiscal Year` where name!=%s""", (self.name))
-
- for fiscal_year, ysd, yed in year_start_end_dates:
- if (getdate(self.year_start_date) == ysd and getdate(self.year_end_date) == yed) \
- and (not frappe.flags.in_test):
+@frappe.whitelist()
+def check_duplicate_fiscal_year(doc):
+ year_start_end_dates = frappe.db.sql("""select name, year_start_date, year_end_date from `tabFiscal Year` where name!=%s""", (doc.name))
+ for fiscal_year, ysd, yed in year_start_end_dates:
+ if (getdate(doc.year_start_date) == ysd and getdate(doc.year_end_date) == yed) and (not frappe.flags.in_test):
frappe.throw(_("Fiscal Year Start Date and Fiscal Year End Date are already set in Fiscal Year {0}").format(fiscal_year))
+
+
+@frappe.whitelist()
+def auto_create_fiscal_year():
+ for d in frappe.db.sql("""select name from `tabFiscal Year` where year_end_date =(current_date + 3)"""):
+ try:
+ current_fy = frappe.get_doc("Fiscal Year", d[0])
+
+ new_fy = frappe.copy_doc(current_fy)
+
+ new_fy.year_start_date = add_days(current_fy.year_end_date, 1)
+ new_fy.year_end_date = add_years(current_fy.year_end_date, 1)
+
+ start_year = new_fy.year_start_date[:4]
+ end_year = new_fy.year_end_date[:4]
+ new_fy.year = start_year if start_year==end_year else (start_year + "-" + end_year)
+
+ new_fy.insert()
+ except:
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/fiscal_year_company/__init__.py b/erpnext/accounts/doctype/fiscal_year_company/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/fiscal_year_company/__init__.py
diff --git a/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.json b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.json
new file mode 100644
index 0000000..5de4d3c
--- /dev/null
+++ b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.json
@@ -0,0 +1,51 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "creation": "2014-10-02 13:35:44.155278",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Company",
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "modified": "2014-10-02 13:35:44.155278",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Fiscal Year Company",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py
new file mode 100644
index 0000000..76a8bd4
--- /dev/null
+++ b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py
@@ -0,0 +1,9 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class FiscalYearCompany(Document):
+ pass
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
index 69269d0..a346f6c 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
@@ -2,6 +2,7 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.accounts");
+frappe.require("assets/erpnext/js/utils.js");
erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
onload: function() {
@@ -153,6 +154,11 @@
cur_frm.cscript.company = function(doc, cdt, cdn) {
cur_frm.refresh_fields();
+ erpnext.get_fiscal_year(doc.company, doc.posting_date);
+}
+
+cur_frm.cscript.posting_date = function(doc, cdt, cdn){
+ erpnext.get_fiscal_year(doc.company, doc.posting_date);
}
cur_frm.cscript.is_opening = function(doc, cdt, cdn) {
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.json b/erpnext/accounts/doctype/journal_voucher/journal_voucher.json
index 1638296..180a211 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.json
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.json
@@ -389,20 +389,6 @@
"report_hide": 1
},
{
- "fieldname": "fiscal_year",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
@@ -417,6 +403,20 @@
"search_index": 1
},
{
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
"allow_on_submit": 1,
"fieldname": "select_print_heading",
"fieldtype": "Link",
@@ -447,7 +447,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2014-09-09 05:35:31.217863",
+ "modified": "2014-10-02 14:51:20.624847",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Voucher",
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json
index dd7c8e4..178c077 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json
@@ -2,7 +2,7 @@
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:title",
- "creation": "2013-01-10 16:34:08.000000",
+ "creation": "2013-01-10 16:34:08",
"description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.",
"docstatus": 0,
"doctype": "DocType",
@@ -12,6 +12,7 @@
"fieldname": "title",
"fieldtype": "Data",
"in_filter": 1,
+ "in_list_view": 1,
"label": "Title",
"oldfieldname": "title",
"oldfieldtype": "Data",
@@ -22,19 +23,43 @@
{
"fieldname": "is_default",
"fieldtype": "Check",
+ "in_list_view": 1,
"label": "Default",
"permlevel": 0
},
{
+ "fieldname": "disabled",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Disabled",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "label": "",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
+ "in_list_view": 1,
"label": "Company",
"options": "Company",
"permlevel": 0,
"reqd": 1
},
{
+ "fieldname": "section_break6",
+ "fieldtype": "Section Break",
+ "label": "",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
"fieldname": "other_charges",
"fieldtype": "Table",
"label": "Purchase Taxes and Charges",
@@ -46,7 +71,7 @@
],
"icon": "icon-money",
"idx": 1,
- "modified": "2014-01-29 12:26:38.000000",
+ "modified": "2014-10-07 12:40:17.165882",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges Master",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 05c4cc8..d83aac6 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -1,1252 +1,1273 @@
{
- "allow_import": 1,
- "autoname": "naming_series:",
- "creation": "2013-05-24 19:29:05",
- "default_print_format": "Standard",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Transaction",
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-24 19:29:05",
+ "default_print_format": "Standard",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
"fields": [
{
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "label": "Customer",
- "options": "icon-user",
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "label": "Customer",
+ "options": "icon-user",
"permlevel": 0
- },
+ },
{
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "SINV-",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "SINV-",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"reqd": 1
- },
+ },
{
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Customer",
- "no_copy": 0,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Customer",
+ "no_copy": 0,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "customer",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Name",
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
+ "depends_on": "customer",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Name",
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "permlevel": 0,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "permlevel": 0,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Mobile No",
- "permlevel": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "contact_email",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact Email",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "contact_email",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "mode_of_payment",
- "fieldtype": "Link",
- "label": "Mode of Payment",
- "no_copy": 0,
- "oldfieldname": "mode_of_payment",
- "oldfieldtype": "Select",
- "options": "Mode of Payment",
- "permlevel": 0,
+ "fieldname": "mode_of_payment",
+ "fieldtype": "Link",
+ "label": "Mode of Payment",
+ "no_copy": 0,
+ "oldfieldname": "mode_of_payment",
+ "oldfieldtype": "Select",
+ "options": "Mode of Payment",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "is_pos",
- "fieldtype": "Check",
- "label": "Is POS",
- "oldfieldname": "is_pos",
- "oldfieldtype": "Check",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "is_pos",
+ "fieldtype": "Check",
+ "label": "Is POS",
+ "oldfieldname": "is_pos",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_user_permissions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Link",
- "options": "Sales Invoice",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_user_permissions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Link",
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "default": "Today",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Date",
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "reqd": 1,
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Date",
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 1
- },
+ },
{
- "fieldname": "due_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Payment Due Date",
- "no_copy": 1,
- "oldfieldname": "due_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "read_only": 0,
- "reqd": 1,
+ "fieldname": "due_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Payment Due Date",
+ "no_copy": 1,
+ "oldfieldname": "due_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "",
- "description": "Start date of current invoice's period",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "label": "From Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
+ "allow_on_submit": 1,
+ "depends_on": "",
+ "description": "Start date of current invoice's period",
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "label": "From Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 0
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "",
- "description": "End date of current invoice's period",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "label": "To Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
+ "allow_on_submit": 1,
+ "depends_on": "",
+ "description": "End date of current invoice's period",
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "label": "To Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "currency_section",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "description": "Rate at which Customer Currency is converted to customer's base currency",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate",
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
- "width": "50%"
- },
- {
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "description": "Rate at which Price list currency is converted to customer's base currency",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "fieldname": "ignore_pricing_rule",
- "fieldtype": "Check",
- "label": "Ignore Pricing Rule",
- "no_copy": 1,
- "permlevel": 1,
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Shipping Address Name",
+ "options": "Address",
+ "permlevel": 0,
+ "precision": "",
"print_hide": 1
- },
+ },
{
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "permlevel": 0,
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Shipping Address",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "currency_section",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "update_stock",
- "fieldtype": "Check",
- "label": "Update Stock",
- "oldfieldname": "update_stock",
- "oldfieldtype": "Check",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "fieldname": "entries",
- "fieldtype": "Table",
- "label": "Sales Invoice Items",
- "oldfieldname": "entries",
- "oldfieldtype": "Table",
- "options": "Sales Invoice Item",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"reqd": 1
- },
+ },
{
- "fieldname": "packing_list",
- "fieldtype": "Section Break",
- "label": "Packing List",
- "options": "icon-suitcase",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "fieldname": "packing_details",
- "fieldtype": "Table",
- "label": "Packing Details",
- "options": "Packed Item",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "fieldname": "sales_bom_help",
- "fieldtype": "HTML",
- "label": "Sales BOM Help",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "fieldname": "section_break_30",
- "fieldtype": "Section Break",
- "permlevel": 0
- },
- {
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "description": "Rate at which Customer Currency is converted to customer's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"reqd": 1
- },
+ },
{
- "fieldname": "column_break_32",
- "fieldtype": "Column Break",
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which Price list currency is converted to customer's base currency",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "ignore_pricing_rule",
+ "fieldtype": "Check",
+ "label": "Ignore Pricing Rule",
+ "no_copy": 1,
+ "permlevel": 1,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "update_stock",
+ "fieldtype": "Check",
+ "label": "Update Stock",
+ "oldfieldname": "update_stock",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "entries",
+ "fieldtype": "Table",
+ "label": "Sales Invoice Items",
+ "oldfieldname": "entries",
+ "oldfieldtype": "Table",
+ "options": "Sales Invoice Item",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "packing_list",
+ "fieldtype": "Section Break",
+ "label": "Packing List",
+ "options": "icon-suitcase",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "packing_details",
+ "fieldtype": "Table",
+ "label": "Packing Details",
+ "options": "Packed Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sales_bom_help",
+ "fieldtype": "HTML",
+ "label": "Sales BOM Help",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_30",
+ "fieldtype": "Section Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "net_total_export",
- "fieldtype": "Currency",
- "label": "Net Total",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break_32",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total_export",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Master",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "column_break_38",
- "fieldtype": "Column Break",
+ "fieldname": "column_break_38",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "shipping_rule",
- "fieldtype": "Link",
- "label": "Shipping Rule",
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "shipping_rule",
+ "fieldtype": "Link",
+ "label": "Shipping Rule",
+ "oldfieldtype": "Button",
+ "options": "Shipping Rule",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "section_break_40",
- "fieldtype": "Section Break",
+ "fieldname": "section_break_40",
+ "fieldtype": "Section Break",
"permlevel": 0
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Sales Taxes and Charges",
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges",
- "permlevel": 0,
+ "allow_on_submit": 1,
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Sales Taxes and Charges",
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "oldfieldtype": "HTML",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "section_break_43",
- "fieldtype": "Section Break",
+ "fieldname": "section_break_43",
+ "fieldtype": "Section Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "other_charges_total",
- "fieldtype": "Currency",
- "label": "Total Taxes and Charges (Company Currency)",
- "oldfieldname": "other_charges_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "other_charges_total",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges (Company Currency)",
+ "oldfieldname": "other_charges_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "column_break_45",
- "fieldtype": "Column Break",
+ "fieldname": "column_break_45",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "other_charges_total_export",
- "fieldtype": "Currency",
- "label": "Total Taxes and Charges",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "other_charges_total_export",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount",
- "options": "Company:company:default_currency",
- "permlevel": 0,
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
"print_hide": 0
- },
+ },
{
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "in_filter": 1,
- "label": "Grand Total (Company Currency)",
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "in_filter": 1,
+ "label": "Grand Total (Company Currency)",
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total (Company Currency)",
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total (Company Currency)",
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "description": "In Words will be visible once you save the Sales Invoice.",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
+ "description": "In Words will be visible once you save the Sales Invoice.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "total_advance",
- "fieldtype": "Currency",
- "label": "Total Advance",
- "oldfieldname": "total_advance",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "total_advance",
+ "fieldtype": "Currency",
+ "label": "Total Advance",
+ "oldfieldname": "total_advance",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "outstanding_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Outstanding Amount",
- "no_copy": 1,
- "oldfieldname": "outstanding_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "outstanding_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Outstanding Amount",
+ "no_copy": 1,
+ "oldfieldname": "outstanding_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "grand_total_export",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Grand Total",
- "oldfieldname": "grand_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
+ "fieldname": "grand_total_export",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "oldfieldname": "grand_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
"reqd": 1
- },
+ },
{
- "fieldname": "rounded_total_export",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
+ "fieldname": "rounded_total_export",
+ "fieldtype": "Currency",
+ "label": "Rounded Total",
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "in_words_export",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
+ "fieldname": "in_words_export",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "gross_profit",
- "fieldtype": "Currency",
- "label": "Gross Profit",
- "oldfieldname": "gross_profit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "gross_profit",
+ "fieldtype": "Currency",
+ "label": "Gross Profit",
+ "oldfieldname": "gross_profit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "gross_profit_percent",
- "fieldtype": "Float",
- "label": "Gross Profit (%)",
- "oldfieldname": "gross_profit_percent",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "gross_profit_percent",
+ "fieldtype": "Float",
+ "label": "Gross Profit (%)",
+ "oldfieldname": "gross_profit_percent",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "advances",
- "fieldtype": "Section Break",
- "label": "Advances",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "advances",
+ "fieldtype": "Section Break",
+ "label": "Advances",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "get_advances_received",
- "fieldtype": "Button",
- "label": "Get Advances Received",
- "oldfieldtype": "Button",
- "options": "get_advances",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "get_advances_received",
+ "fieldtype": "Button",
+ "label": "Get Advances Received",
+ "oldfieldtype": "Button",
+ "options": "get_advances",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "advance_adjustment_details",
- "fieldtype": "Table",
- "label": "Sales Invoice Advance",
- "oldfieldname": "advance_adjustment_details",
- "oldfieldtype": "Table",
- "options": "Sales Invoice Advance",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "advance_adjustment_details",
+ "fieldtype": "Table",
+ "label": "Sales Invoice Advance",
+ "oldfieldname": "advance_adjustment_details",
+ "oldfieldtype": "Table",
+ "options": "Sales Invoice Advance",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "payments_section",
- "fieldtype": "Section Break",
- "label": "Payments",
- "options": "icon-money",
- "permlevel": 0,
+ "depends_on": "is_pos",
+ "fieldname": "payments_section",
+ "fieldtype": "Section Break",
+ "label": "Payments",
+ "options": "icon-money",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
+ "depends_on": "is_pos",
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "paid_amount",
- "fieldtype": "Currency",
- "label": "Paid Amount",
- "no_copy": 1,
- "oldfieldname": "paid_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "is_pos",
+ "fieldname": "paid_amount",
+ "fieldtype": "Currency",
+ "label": "Paid Amount",
+ "no_copy": 1,
+ "oldfieldname": "paid_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "cash_bank_account",
- "fieldtype": "Link",
- "label": "Cash/Bank Account",
- "oldfieldname": "cash_bank_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "is_pos",
+ "fieldname": "cash_bank_account",
+ "fieldtype": "Link",
+ "label": "Cash/Bank Account",
+ "oldfieldname": "cash_bank_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
+ "depends_on": "is_pos",
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "write_off_outstanding_amount_automatically",
- "fieldtype": "Check",
- "label": "Write Off Outstanding Amount",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "is_pos",
+ "fieldname": "write_off_outstanding_amount_automatically",
+ "fieldtype": "Check",
+ "label": "Write Off Outstanding Amount",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "write_off_amount",
- "fieldtype": "Currency",
- "label": "Write Off Amount",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "is_pos",
+ "fieldname": "write_off_amount",
+ "fieldtype": "Currency",
+ "label": "Write Off Amount",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "write_off_account",
- "fieldtype": "Link",
- "label": "Write Off Account",
- "options": "Account",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "is_pos",
+ "fieldname": "write_off_account",
+ "fieldtype": "Link",
+ "label": "Write Off Account",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "is_pos",
- "fieldname": "write_off_cost_center",
- "fieldtype": "Link",
- "label": "Write Off Cost Center",
- "options": "Cost Center",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "is_pos",
+ "fieldname": "write_off_cost_center",
+ "fieldtype": "Link",
+ "label": "Write Off Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "fold",
- "fieldtype": "Fold",
+ "fieldname": "fold",
+ "fieldtype": "Fold",
"permlevel": 0
- },
+ },
{
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal",
- "permlevel": 0,
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions Details",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor",
- "permlevel": 0,
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions Details",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "depends_on": "customer",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "label": "Contact Info",
- "options": "icon-bullhorn",
- "permlevel": 0,
+ "depends_on": "customer",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer Group",
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"search_index": 0
- },
+ },
{
- "fieldname": "col_break23",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "col_break23",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "label": "Customer Address",
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "description": "Customer (Receivable) Account",
- "fieldname": "debit_to",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Debit To",
- "oldfieldname": "debit_to",
- "oldfieldtype": "Link",
- "options": "Account",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "description": "Customer (Receivable) Account",
+ "fieldname": "debit_to",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Debit To",
+ "oldfieldname": "debit_to",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 1
- },
+ },
{
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Project Name",
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Project Name",
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0,
+ "read_only": 0,
"search_index": 1
- },
+ },
{
- "depends_on": "eval:doc.source == 'Campaign'",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "label": "Campaign",
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "eval:doc.source == 'Campaign'",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "label": "Campaign",
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "source",
- "fieldtype": "Select",
- "label": "Source",
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "label": "Source",
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "default": "No",
- "description": "Considered as an Opening Balance",
- "fieldname": "is_opening",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Is Opening Entry",
- "oldfieldname": "is_opening",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "default": "No",
+ "description": "Considered as an Opening Balance",
+ "fieldname": "is_opening",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Is Opening Entry",
+ "oldfieldname": "is_opening",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"search_index": 0
- },
+ },
{
- "fieldname": "c_form_applicable",
- "fieldtype": "Select",
- "label": "C-Form Applicable",
- "no_copy": 1,
- "options": "No\nYes",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "c_form_applicable",
+ "fieldtype": "Select",
+ "label": "C-Form Applicable",
+ "no_copy": 1,
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"report_hide": 0
- },
+ },
{
- "fieldname": "c_form_no",
- "fieldtype": "Link",
- "label": "C-Form No",
- "no_copy": 1,
- "options": "C-Form",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "c_form_no",
+ "fieldtype": "Link",
+ "label": "C-Form No",
+ "no_copy": 1,
+ "options": "C-Form",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "column_break8",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "column_break8",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "Letter Head",
- "permlevel": 0,
- "print_hide": 1,
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"report_hide": 1
- },
+ },
{
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "label": "Posting Time",
- "no_copy": 1,
- "oldfieldname": "posting_time",
- "oldfieldtype": "Time",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "label": "Posting Time",
+ "no_copy": 1,
+ "oldfieldname": "posting_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "description": "Actual Invoice Date",
- "fieldname": "aging_date",
- "fieldtype": "Date",
- "label": "Aging Date",
- "oldfieldname": "aging_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 1,
+ "description": "Actual Invoice Date",
+ "fieldname": "aging_date",
+ "fieldtype": "Date",
+ "label": "Aging Date",
+ "oldfieldname": "aging_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "fiscal_year",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Fiscal Year",
- "no_copy": 0,
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "no_copy": 0,
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Text",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"reqd": 0
- },
+ },
{
- "fieldname": "sales_team_section_break",
- "fieldtype": "Section Break",
- "label": "Sales Team",
- "oldfieldtype": "Section Break",
- "options": "icon-group",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "sales_team_section_break",
+ "fieldtype": "Section Break",
+ "label": "Sales Team",
+ "oldfieldtype": "Section Break",
+ "options": "icon-group",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "column_break9",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "column_break9",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "sales_partner",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Sales Partner",
- "oldfieldname": "sales_partner",
- "oldfieldtype": "Link",
- "options": "Sales Partner",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Sales Partner",
+ "oldfieldname": "sales_partner",
+ "oldfieldtype": "Link",
+ "options": "Sales Partner",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "column_break10",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "column_break10",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "commission_rate",
- "fieldtype": "Float",
- "label": "Commission Rate (%)",
- "oldfieldname": "commission_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "commission_rate",
+ "fieldtype": "Float",
+ "label": "Commission Rate (%)",
+ "oldfieldname": "commission_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "total_commission",
- "fieldtype": "Currency",
- "label": "Total Commission",
- "oldfieldname": "total_commission",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "total_commission",
+ "fieldtype": "Currency",
+ "label": "Total Commission",
+ "oldfieldname": "total_commission",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "section_break2",
- "fieldtype": "Section Break",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "section_break2",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "sales_team",
- "fieldtype": "Table",
- "label": "Sales Team1",
- "oldfieldname": "sales_team",
- "oldfieldtype": "Table",
- "options": "Sales Team",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "sales_team",
+ "fieldtype": "Table",
+ "label": "Sales Team1",
+ "oldfieldname": "sales_team",
+ "oldfieldtype": "Table",
+ "options": "Sales Team",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "eval:doc.docstatus<2",
- "fieldname": "recurring_invoice",
- "fieldtype": "Section Break",
- "label": "Recurring Invoice",
- "options": "icon-time",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "eval:doc.docstatus<2",
+ "fieldname": "recurring_invoice",
+ "fieldtype": "Section Break",
+ "label": "Recurring Invoice",
+ "options": "icon-time",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "column_break11",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "column_break11",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.docstatus<2",
- "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date",
- "fieldname": "is_recurring",
- "fieldtype": "Check",
- "label": "Is Recurring",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.docstatus<2",
+ "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date",
+ "fieldname": "is_recurring",
+ "fieldtype": "Check",
+ "label": "Is Recurring",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Select the period when the invoice will be generated automatically",
- "fieldname": "recurring_type",
- "fieldtype": "Select",
- "label": "Recurring Type",
- "no_copy": 1,
- "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "print_hide": 1,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Select the period when the invoice will be generated automatically",
+ "fieldname": "recurring_type",
+ "fieldtype": "Select",
+ "label": "Recurring Type",
+ "no_copy": 1,
+ "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc ",
- "fieldname": "repeat_on_day_of_month",
- "fieldtype": "Int",
- "label": "Repeat on Day of Month",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc ",
+ "fieldname": "repeat_on_day_of_month",
+ "fieldtype": "Int",
+ "label": "Repeat on Day of Month",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which next invoice will be generated. It is generated on submit.\n",
- "fieldname": "next_date",
- "fieldtype": "Date",
- "label": "Next Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The date on which next invoice will be generated. It is generated on submit.\n",
+ "fieldname": "next_date",
+ "fieldtype": "Date",
+ "label": "Next Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which recurring invoice will be stop",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "label": "End Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The date on which recurring invoice will be stop",
+ "fieldname": "end_date",
+ "fieldtype": "Date",
+ "label": "End Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "column_break12",
- "fieldtype": "Column Break",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "column_break12",
+ "fieldtype": "Column Break",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The unique id for tracking all recurring invoices.\u00a0It is generated on submit.",
- "fieldname": "recurring_id",
- "fieldtype": "Data",
- "label": "Recurring Id",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The unique id for tracking all recurring invoices.\u00a0It is generated on submit.",
+ "fieldname": "recurring_id",
+ "fieldtype": "Data",
+ "label": "Recurring Id",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
- "fieldname": "notification_email_address",
- "fieldtype": "Small Text",
- "label": "Notification Email Address",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
+ "fieldname": "notification_email_address",
+ "fieldtype": "Small Text",
+ "label": "Notification Email Address",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "against_income_account",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Against Income Account",
- "no_copy": 1,
- "oldfieldname": "against_income_account",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "against_income_account",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Against Income Account",
+ "no_copy": 1,
+ "oldfieldname": "against_income_account",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"report_hide": 1
}
- ],
- "icon": "icon-file-text",
- "idx": 1,
- "is_submittable": 1,
- "modified": "2014-09-18 03:17:54.976732",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Sales Invoice",
- "owner": "Administrator",
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-10-09 12:08:33.594385",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts Manager",
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "apply_user_permissions": 1,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts User",
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 1,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 1,
"write": 1
- },
+ },
{
- "apply_user_permissions": 1,
- "cancel": 0,
- "delete": 0,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
+ "apply_user_permissions": 1,
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
"role": "Customer"
- },
+ },
{
- "permlevel": 1,
- "read": 1,
- "role": "Accounts Manager",
+ "permlevel": 1,
+ "read": 1,
+ "role": "Accounts Manager",
"write": 1
}
- ],
- "read_only_onload": 1,
- "search_fields": "posting_date, due_date, customer, fiscal_year, grand_total, outstanding_amount",
- "sort_field": "modified",
+ ],
+ "read_only_onload": 1,
+ "search_fields": "posting_date, due_date, customer, fiscal_year, grand_total, outstanding_amount",
+ "sort_field": "modified",
"sort_order": "DESC"
-}
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 352dfab..5201e5e 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -131,8 +131,10 @@
'keyword':'Delivered',
'second_source_dt': 'Delivery Note Item',
'second_source_field': 'qty',
- 'second_join_field': 'prevdoc_detail_docname',
- 'overflow_type': 'delivery'
+ 'second_join_field': 'so_detail',
+ 'overflow_type': 'delivery',
+ 'extra_cond': """ and exists(select name from `tabSales Invoice`
+ where name=`tabSales Invoice Item`.parent and ifnull(update_stock, 0) = 1)"""
})
def get_portal_page(self):
@@ -627,9 +629,11 @@
"Sales Invoice Item": {
"doctype": "Delivery Note Item",
"field_map": {
- "name": "prevdoc_detail_docname",
+ "name": "si_detail",
"parent": "against_sales_invoice",
- "serial_no": "serial_no"
+ "serial_no": "serial_no",
+ "sales_order": "against_sales_order",
+ "so_detail": "so_detail"
},
"postprocess": update_item
},
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.json b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.json
index 47d385b..12d425c 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.json
@@ -28,6 +28,14 @@
"permlevel": 0
},
{
+ "fieldname": "disabled",
+ "fieldtype": "Check",
+ "in_list_view": 0,
+ "label": "Disabled",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"permlevel": 0
@@ -72,7 +80,7 @@
],
"icon": "icon-money",
"idx": 1,
- "modified": "2014-05-27 03:49:19.023941",
+ "modified": "2014-10-06 13:11:18.616789",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges Master",
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index 281f29f..f1812de 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -28,6 +28,30 @@
"fieldtype": "Select",
"options": 'Posting Date' + NEWLINE + 'Due Date',
"default": "Posting Date"
+ },
+ {
+ "fieldtype": "Break",
+ },
+ {
+ "fieldname":"range1",
+ "label": __("Ageing Range 1"),
+ "fieldtype": "Int",
+ "default": "30",
+ "reqd": 1
+ },
+ {
+ "fieldname":"range2",
+ "label": __("Ageing Range 2"),
+ "fieldtype": "Int",
+ "default": "60",
+ "reqd": 1
+ },
+ {
+ "fieldname":"range3",
+ "label": __("Ageing Range 3"),
+ "fieldtype": "Int",
+ "default": "90",
+ "reqd": 1
}
]
}
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.py b/erpnext/accounts/report/accounts_payable/accounts_payable.py
index 1e1f1eac..bc42033 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.py
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.py
@@ -3,14 +3,14 @@
from __future__ import unicode_literals
import frappe
-from frappe import _
-from frappe.utils import getdate, nowdate, flt, cstr
+from frappe.utils import getdate, nowdate, flt, cstr, cint
+from frappe import msgprint, _
from erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data
def execute(filters=None):
if not filters: filters = {}
supplier_naming_by = frappe.db.get_value("Buying Settings", None, "supp_master_name")
- columns = get_columns(supplier_naming_by)
+ columns = get_columns(filters, supplier_naming_by)
entries = get_gl_entries(filters)
entries_after_report_date = [[gle.voucher_type, gle.voucher_no]
@@ -50,7 +50,8 @@
else:
ageing_based_on_date = gle.posting_date
- row += get_ageing_data(age_on, ageing_based_on_date, outstanding_amount) + \
+ row += get_ageing_data(cint(filters.get("range1")), cint(filters.get("range2")), \
+ cint(filters.get("range3")), age_on, ageing_based_on_date, outstanding_amount) + \
[supplier_details.get(gle.party).supplier_type, gle.remarks]
data.append(row)
@@ -70,8 +71,11 @@
columns +=[_("Voucher Type") + "::110", _("Voucher No") + ":Dynamic Link/Voucher Type:120",
_("Due Date") + ":Date:80", _("Bill No") + "::80", _("Bill Date") + ":Date:80",
_("Invoiced Amount") + ":Currency:100", _("Paid Amount") + ":Currency:100",
- _("Outstanding Amount") + ":Currency:100", _("Age") + ":Int:50", "0-30:Currency:100",
- "30-60:Currency:100", "60-90:Currency:100", _("90-Above") + ":Currency:100",
+ _("Outstanding Amount") + ":Currency:100", _("Age") + ":Int:50",
+ "0-" + filters.get("range1") + ":Currency:100",
+ filters.get("range1") + "-" + filters.get("range2") + ":Currency:100",
+ filters.get("range2") + "-" + filters.get("range3") + ":Currency:100",
+ filters.get("range3") + _("-Above") + ":Currency:100",
_("Supplier Type") + ":Link/Supplier Type:150", _("Remarks") + "::150"
]
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index 708f63b..aa7d175 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -28,6 +28,30 @@
"fieldtype": "Select",
"options": 'Posting Date' + NEWLINE + 'Due Date',
"default": "Posting Date"
+ },
+ {
+ "fieldtype": "Break",
+ },
+ {
+ "fieldname":"range1",
+ "label": __("Ageing Range 1"),
+ "fieldtype": "Int",
+ "default": "30",
+ "reqd": 1
+ },
+ {
+ "fieldname":"range2",
+ "label": __("Ageing Range 2"),
+ "fieldtype": "Int",
+ "default": "60",
+ "reqd": 1
+ },
+ {
+ "fieldname":"range3",
+ "label": __("Ageing Range 3"),
+ "fieldtype": "Int",
+ "default": "90",
+ "reqd": 1
}
]
}
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 069391a..b239289 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
-from frappe.utils import getdate, nowdate, flt
+from frappe.utils import getdate, nowdate, flt, cint
class AccountsReceivableReport(object):
def __init__(self, filters=None):
@@ -27,8 +27,10 @@
columns += [_("Voucher Type") + "::110", _("Voucher No") + ":Dynamic Link/Voucher Type:120",
_("Due Date") + ":Date:80", _("Invoiced Amount") + ":Currency:100",
_("Payment Received") + ":Currency:100", _("Outstanding Amount") + ":Currency:100",
- _("Age") + ":Int:50", "0-30:Currency:100", "30-60:Currency:100",
- "60-90:Currency:100", _("90-Above") + ":Currency:100",
+ _("Age") + ":Int:50", "0-" + self.filters.range1 + ":Currency:100",
+ self.filters.range1 + "-" + self.filters.range2 + ":Currency:100",
+ self.filters.range2 + "-" + self.filters.range3 + ":Currency:100",
+ self.filters.range3 + _("-Above") + ":Currency:100",
_("Territory") + ":Link/Territory:80", _("Remarks") + "::200"
]
@@ -56,7 +58,8 @@
payment_received, outstanding_amount]
entry_date = due_date if self.filters.ageing_based_on == "Due Date" else gle.posting_date
- row += get_ageing_data(self.age_as_on, entry_date, outstanding_amount) + \
+ row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2), \
+ cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount) + \
[self.get_territory(gle.account), gle.remarks]
data.append(row)
@@ -155,15 +158,16 @@
def execute(filters=None):
return AccountsReceivableReport(filters).run()
-def get_ageing_data(age_as_on, entry_date, outstanding_amount):
+def get_ageing_data(first_range, second_range, third_range, age_as_on, entry_date, outstanding_amount):
# [0-30, 30-60, 60-90, 90-above]
outstanding_range = [0.0, 0.0, 0.0, 0.0]
+
if not (age_as_on and entry_date):
return [0] + outstanding_range
age = (getdate(age_as_on) - getdate(entry_date)).days or 0
index = None
- for i, days in enumerate([30, 60, 90]):
+ for i, days in enumerate([first_range, second_range, third_range]):
if age <= days:
index = i
break
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 24781a3..e9de551 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -12,26 +12,29 @@
class FiscalYearError(frappe.ValidationError): pass
class BudgetError(frappe.ValidationError): pass
+@frappe.whitelist()
+def get_fiscal_year(date=None, fiscal_year=None, label="Date", verbose=1, company=None):
+ return get_fiscal_years(date, fiscal_year, label, verbose, company)[0]
-def get_fiscal_year(date=None, fiscal_year=None, label="Date", verbose=1):
- return get_fiscal_years(date, fiscal_year, label, verbose)[0]
-
-def get_fiscal_years(date=None, fiscal_year=None, label="Date", verbose=1):
+def get_fiscal_years(date=None, fiscal_year=None, label="Date", verbose=1, company=None):
# if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate)
cond = ""
if fiscal_year:
cond = "name = '%s'" % fiscal_year.replace("'", "\'")
+ elif company:
+ cond = """('%s' in (select company from `tabFiscal Year Company`
+ where `tabFiscal Year Company`.parent = `tabFiscal Year`.name))
+ and '%s' >= year_start_date and '%s' <= year_end_date """ %(company.replace("'", "\'"), date, date)
else:
- cond = "'%s' >= year_start_date and '%s' <= year_end_date" % \
- (date, date)
+ cond = "'%s' >= year_start_date and '%s' <= year_end_date" %(date, date)
+
fy = frappe.db.sql("""select name, year_start_date, year_end_date
from `tabFiscal Year` where %s order by year_start_date desc""" % cond)
if not fy:
error_msg = _("""{0} {1} not in any Fiscal Year""").format(label, formatdate(date))
- if verbose: frappe.msgprint(error_msg)
+ if verbose==1: frappe.msgprint(error_msg)
raise FiscalYearError, error_msg
-
return fy
def validate_fiscal_year(date, fiscal_year, label="Date"):
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 9433ebe..8c2b1a2 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -209,5 +209,4 @@
cur_frm.cscript.send_sms = function() {
frappe.require("assets/erpnext/js/sms_manager.js");
var sms_man = new SMSManager(cur_frm.doc);
-}
-
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
index b8d40ca..b9286a1 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
@@ -71,4 +71,4 @@
return {
filters:{'supplier': doc.supplier}
}
-}
+}
\ No newline at end of file
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index b7e68d3..7a0b51a 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -26,6 +26,9 @@
if self.meta.get_field("is_recurring"):
validate_recurring_document(self)
+ if self.meta.get_field("taxes_and_charges"):
+ self.validate_enabled_taxes_and_charges()
+
def on_submit(self):
if self.meta.get_field("is_recurring"):
convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))
@@ -342,6 +345,11 @@
self.precision(base_field, item))
item.set(base_field, value_in_company_currency)
+ def validate_enabled_taxes_and_charges(self):
+ taxes_and_charges_doctype = self.meta.get_options("taxes_and_charges")
+ if frappe.db.get_value(taxes_and_charges_doctype, self.taxes_and_charges, "disabled"):
+ frappe.throw(_("{0} '{1}' is disabled").format(taxes_and_charges_doctype, self.taxes_and_charges))
+
def calculate_total_advance(self, parenttype, advance_parentfield):
if self.doctype == parenttype and self.docstatus < 2:
sum_of_allocated_amount = sum([flt(adv.allocated_amount, self.precision("allocated_amount", adv))
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index d173abe..5d77814 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -334,8 +334,8 @@
# But in this case reserved qty should only be reduced by 10 and not 12
already_delivered_qty = self.get_already_delivered_qty(self.name,
- d.against_sales_order, d.prevdoc_detail_docname)
- so_qty, reserved_warehouse = self.get_so_qty_and_warehouse(d.prevdoc_detail_docname)
+ d.against_sales_order, d.so_detail)
+ so_qty, reserved_warehouse = self.get_so_qty_and_warehouse(d.so_detail)
if already_delivered_qty + d.qty > so_qty:
reserved_qty_for_main_item = -(so_qty - already_delivered_qty)
@@ -377,7 +377,7 @@
def get_already_delivered_qty(self, dn, so, so_detail):
qty = frappe.db.sql("""select sum(qty) from `tabDelivery Note Item`
- where prevdoc_detail_docname = %s and docstatus = 1
+ where so_detail = %s and docstatus = 1
and against_sales_order = %s
and parent != %s""", (so_detail, so, dn))
return qty and flt(qty[0][0]) or 0.0
diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py
index 9825b04..247d4ff 100644
--- a/erpnext/controllers/status_updater.py
+++ b/erpnext/controllers/status_updater.py
@@ -153,16 +153,21 @@
args['second_source_condition'] = ""
if args.get('second_source_dt') and args.get('second_source_field') \
and args.get('second_join_field'):
+ if not args.get("second_source_extra_cond"):
+ args["second_source_extra_cond"] = ""
+
args['second_source_condition'] = """ + ifnull((select sum(%(second_source_field)s)
from `tab%(second_source_dt)s`
where `%(second_join_field)s`="%(detail_id)s"
- and (docstatus=1)), 0)""" % args
+ and (`tab%(second_source_dt)s`.docstatus=1) %(second_source_extra_cond)s), 0) """ % args
if args['detail_id']:
+ if not args.get("extra_cond"): args["extra_cond"] = ""
+
frappe.db.sql("""update `tab%(target_dt)s`
set %(target_field)s = (select sum(%(source_field)s)
from `tab%(source_dt)s` where `%(join_field)s`="%(detail_id)s"
- and (docstatus=1 %(cond)s)) %(second_source_condition)s
+ and (docstatus=1 %(cond)s) %(extra_cond)s) %(second_source_condition)s
where name='%(detail_id)s'""" % args)
# get unique transactions to update
@@ -171,12 +176,13 @@
args['name'] = name
# update percent complete in the parent table
- frappe.db.sql("""update `tab%(target_parent_dt)s`
- set %(target_parent_field)s = (select sum(if(%(target_ref_field)s >
- ifnull(%(target_field)s, 0), %(target_field)s,
- %(target_ref_field)s))/sum(%(target_ref_field)s)*100
- from `tab%(target_dt)s` where parent="%(name)s") %(modified_cond)s
- where name='%(name)s'""" % args)
+ if args.get('target_parent_field'):
+ frappe.db.sql("""update `tab%(target_parent_dt)s`
+ set %(target_parent_field)s = (select sum(if(%(target_ref_field)s >
+ ifnull(%(target_field)s, 0), %(target_field)s,
+ %(target_ref_field)s))/sum(%(target_ref_field)s)*100
+ from `tab%(target_dt)s` where parent="%(name)s") %(modified_cond)s
+ where name='%(name)s'""" % args)
# update field
if args.get('status_field'):
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 6ef3c43..54b911a 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -45,6 +45,7 @@
"erpnext.stock.reorder_item.reorder_item",
"erpnext.setup.doctype.email_digest.email_digest.send",
"erpnext.support.doctype.support_ticket.support_ticket.auto_close_tickets"
+ "erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year"
],
"daily_long": [
"erpnext.setup.doctype.backup_manager.backup_manager.take_backups_daily"
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index fa2594b..16ae758 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -39,6 +39,7 @@
self.validate_email()
self.validate_status()
self.validate_employee_leave_approver()
+ self.validate_reports_to()
if self.user_id:
self.validate_for_enabled_user_id()
@@ -141,6 +142,10 @@
self.get("employee_leave_approvers").remove(l)
msgprint(_("{0} is not a valid Leave Approver. Removing row #{1}.").format(l.leave_approver, l.idx))
+ def validate_reports_to(self):
+ if self.reports_to == self.name:
+ throw(_("Employee cannot report to himself."))
+
def update_dob_event(self):
if self.status == "Active" and self.date_of_birth \
and not cint(frappe.db.get_value("HR Settings", None, "stop_birthday_reminders")):
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index a4ba2eb..e070b3f 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -153,4 +153,4 @@
if(cint(frappe.boot.notification_settings && frappe.boot.notification_settings.expense_claim)) {
cur_frm.email_doc(frappe.boot.notification_settings.expense_claim_message);
}
-}
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.json b/erpnext/hr/doctype/expense_claim/expense_claim.json
index 15ef03e..a82ef90 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.json
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.json
@@ -90,6 +90,16 @@
"permlevel": 0
},
{
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Posting Date",
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
"fieldname": "employee",
"fieldtype": "Link",
"in_filter": 1,
@@ -115,17 +125,6 @@
"width": "150px"
},
{
- "fieldname": "fiscal_year",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
- "permlevel": 0,
- "reqd": 1
- },
- {
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
@@ -137,21 +136,22 @@
"reqd": 1
},
{
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
"fieldname": "cb1",
"fieldtype": "Column Break",
"permlevel": 0
},
{
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Posting Date",
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "reqd": 1
- },
- {
"allow_on_submit": 0,
"fieldname": "remark",
"fieldtype": "Small Text",
@@ -190,7 +190,7 @@
"icon": "icon-money",
"idx": 1,
"is_submittable": 1,
- "modified": "2014-08-27 07:08:48.454580",
+ "modified": "2014-10-07 18:22:14.689567",
"modified_by": "Administrator",
"module": "HR",
"name": "Expense Claim",
@@ -206,7 +206,6 @@
"read": 1,
"report": 1,
"role": "Employee",
- "user_permission_doctypes": "[\"Company\",\"Employee\",\"Expense Claim\",\"Fiscal Year\"]",
"write": 1
},
{
@@ -222,7 +221,6 @@
"report": 1,
"role": "Expense Approver",
"submit": 1,
- "user_permission_doctypes": "[\"Expense Claim\",\"User\"]",
"write": 1
},
{
@@ -238,7 +236,6 @@
"report": 1,
"role": "HR User",
"submit": 1,
- "user_permission_doctypes": "[\"Company\",\"Expense Claim\",\"Fiscal Year\"]",
"write": 1
}
],
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 9826132..1a45c59 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -82,5 +82,6 @@
erpnext.patches.v4_2.update_sales_order_invoice_field_name
erpnext.patches.v4_2.cost_of_production_cycle
erpnext.patches.v4_2.seprate_manufacture_and_repack
+erpnext.patches.v4_2.party_model
erpnext.patches.v5_0.update_frozen_accounts_permission_role
-erpnext.patches.v5_0.party_model
+erpnext.patches.v5_0.update_dn_against_doc_fields
diff --git a/erpnext/patches/v5_0/update_dn_against_doc_fields.py b/erpnext/patches/v5_0/update_dn_against_doc_fields.py
new file mode 100644
index 0000000..e8780a7
--- /dev/null
+++ b/erpnext/patches/v5_0/update_dn_against_doc_fields.py
@@ -0,0 +1,13 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+import frappe
+
+def execute():
+ frappe.reload_doc('stock', 'doctype', 'delivery_note_item')
+
+ frappe.db.sql("""update `tabDelivery Note Item` set so_detail = prevdoc_detail_docname
+ where ifnull(against_sales_order, '') != ''""")
+
+ frappe.db.sql("""update `tabDelivery Note Item` set si_detail = prevdoc_detail_docname
+ where ifnull(against_sales_invoice, '') != ''""")
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 3a12485..41b3842 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -3,6 +3,8 @@
frappe.provide("erpnext");
frappe.require("assets/erpnext/js/controllers/stock_controller.js");
+frappe.require("assets/erpnext/js/utils.js");
+
erpnext.TransactionController = erpnext.stock.StockController.extend({
onload: function() {
@@ -205,22 +207,37 @@
},
company: function() {
- if(this.frm.doc.company && this.frm.fields_dict.currency) {
- var company_currency = this.get_company_currency();
- if (!this.frm.doc.currency) {
- this.frm.set_value("currency", company_currency);
- }
+ var me = this;
+ var fn = function() {
+ if(me.frm.doc.company && me.frm.fields_dict.currency) {
+ var company_currency = me.get_company_currency();
+ if (!me.frm.doc.currency) {
+ me.frm.set_value("currency", company_currency);
+ }
- if (this.frm.doc.currency == company_currency) {
- this.frm.set_value("conversion_rate", 1.0);
- }
- if (this.frm.doc.price_list_currency == company_currency) {
- this.frm.set_value('plc_conversion_rate', 1.0);
- }
+ if (me.frm.doc.currency == company_currency) {
+ me.frm.set_value("conversion_rate", 1.0);
+ }
+ if (me.frm.doc.price_list_currency == company_currency) {
+ me.frm.set_value('plc_conversion_rate', 1.0);
+ }
- this.frm.script_manager.trigger("currency");
- this.apply_pricing_rule();
+ me.frm.script_manager.trigger("currency");
+ me.apply_pricing_rule();
+ }
}
+
+ if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date;
+ else var date = this.frm.doc.transaction_date;
+ erpnext.get_fiscal_year(this.frm.doc.company, date, fn);
+ },
+
+ transaction_date: function() {
+ erpnext.get_fiscal_year(this.frm.doc.company, this.frm.doc.transaction_date);
+ },
+
+ posting_date: function() {
+ erpnext.get_fiscal_year(this.frm.doc.company, this.frm.doc.posting_date);
},
get_company_currency: function() {
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index ef7d03e..f72bcc4 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -12,6 +12,22 @@
return frappe.boot.sysdefaults.currency;
},
+ get_fiscal_year: function(company, date, fn) {
+ frappe.call({
+ type:"GET",
+ method: "erpnext.accounts.utils.get_fiscal_year",
+ args: {
+ "company": company,
+ "date": date,
+ "verbose": '0'
+ },
+ callback: function(r) {
+ if (r.message) cur_frm.set_value("fiscal_year", r.message[0]);
+ if (fn) fn();
+ }
+ });
+ },
+
toggle_naming_series: function() {
if(cur_frm.fields_dict.naming_series) {
cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal?true:false);
diff --git a/erpnext/selling/doctype/installation_note/installation_note.js b/erpnext/selling/doctype/installation_note/installation_note.js
index e8dee46..60e2f72 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.js
+++ b/erpnext/selling/doctype/installation_note/installation_note.js
@@ -4,6 +4,7 @@
cur_frm.cscript.tname = "Installation Note Item";
cur_frm.cscript.fname = "installed_item_details";
+frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on_change("Installation Note", "customer",
function(frm) { erpnext.utils.get_party_details(frm); });
@@ -69,3 +70,11 @@
});
$.extend(cur_frm.cscript, new erpnext.selling.InstallationNote({frm: cur_frm}));
+
+cur_frm.cscript.company = function(doc, cdt, cdn) {
+ erpnext.get_fiscal_year(doc.company, doc.inst_date);
+}
+
+cur_frm.cscript.inst_date = function(doc, cdt, cdn){
+ erpnext.get_fiscal_year(doc.company, doc.inst_date);
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js
index df84d72..b29c03a 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.js
+++ b/erpnext/selling/doctype/opportunity/opportunity.js
@@ -8,6 +8,7 @@
frappe.provide("erpnext.selling");
+frappe.require("assets/erpnext/js/utils.js");
cur_frm.email_field = "contact_email";
// TODO commonify this code
@@ -145,3 +146,10 @@
var sms_man = new SMSManager(cur_frm.doc);
}
+cur_frm.cscript.company = function(doc, cdt, cdn) {
+ erpnext.get_fiscal_year(doc.company, doc.transaction_date);
+}
+
+cur_frm.cscript.transaction_date = function(doc, cdt, cdn){
+ erpnext.get_fiscal_year(doc.company, doc.transaction_date);
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/opportunity/opportunity.json b/erpnext/selling/doctype/opportunity/opportunity.json
index 270fe77..a47b21f 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.json
+++ b/erpnext/selling/doctype/opportunity/opportunity.json
@@ -272,13 +272,13 @@
"width": "50px"
},
{
- "fieldname": "fiscal_year",
+ "fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
"permlevel": 0,
"print_hide": 1,
"read_only": 0,
@@ -307,13 +307,13 @@
"read_only": 0
},
{
- "fieldname": "company",
+ "fieldname": "fiscal_year",
"fieldtype": "Link",
"in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
"permlevel": 0,
"print_hide": 1,
"read_only": 0,
@@ -388,7 +388,7 @@
"icon": "icon-info-sign",
"idx": 1,
"is_submittable": 1,
- "modified": "2014-09-11 18:53:14.037512",
+ "modified": "2014-10-07 18:12:19.104820",
"modified_by": "Administrator",
"module": "Selling",
"name": "Opportunity",
@@ -396,6 +396,7 @@
"permissions": [
{
"amend": 1,
+ "apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 1,
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 5f25446..857a259 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -169,5 +169,4 @@
cur_frm.cscript.send_sms = function() {
frappe.require("assets/erpnext/js/sms_manager.js");
var sms_man = new SMSManager(cur_frm.doc);
-}
-
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 628e43e..65b91f4 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -198,4 +198,4 @@
cur_frm.cscript.send_sms = function() {
frappe.require("assets/erpnext/js/sms_manager.js");
var sms_man = new SMSManager(cur_frm.doc);
-};
+};
\ 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 c22ed3f..c78e3d8 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -219,7 +219,7 @@
"fieldtype": "Link",
"hidden": 1,
"in_filter": 1,
- "label": "Shipping Address",
+ "label": "Shipping Address Name",
"options": "Address",
"permlevel": 0,
"print_hide": 1,
@@ -1018,7 +1018,7 @@
"idx": 1,
"is_submittable": 1,
"issingle": 0,
- "modified": "2014-09-18 03:17:33.241162",
+ "modified": "2014-10-09 12:08:37.193169",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index b24d297..e59d209 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -294,7 +294,7 @@
"doctype": "Delivery Note Item",
"field_map": {
"rate": "rate",
- "name": "prevdoc_detail_docname",
+ "name": "so_detail",
"parent": "against_sales_order",
},
"postprocess": update_item,
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index c7ec893..f872292 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -34,12 +34,10 @@
self.assertRaises(frappe.ValidationError, make_delivery_note,
so.name)
- sales_order = frappe.get_doc("Sales Order", so.name)
- sales_order.submit()
- dn = make_delivery_note(so.name)
+ dn = self.make_next_doc_testcase(so, "Delivery Note")
self.assertEquals(dn.doctype, "Delivery Note")
- self.assertEquals(len(dn.get("delivery_note_details")), len(sales_order.get("sales_order_details")))
+ self.assertEquals(len(dn.get("delivery_note_details")), len(so.get("sales_order_details")))
def test_make_sales_invoice(self):
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
@@ -49,22 +47,77 @@
self.assertRaises(frappe.ValidationError, make_sales_invoice,
so.name)
- sales_order = frappe.get_doc("Sales Order", so.name)
- sales_order.submit()
- si = make_sales_invoice(so.name)
+ si = self.make_next_doc_testcase(so, "Sales Invoice")
self.assertEquals(si.doctype, "Sales Invoice")
- self.assertEquals(len(si.get("entries")), len(sales_order.get("sales_order_details")))
+ self.assertEquals(len(si.get("entries")), len(so.get("sales_order_details")))
self.assertEquals(len(si.get("entries")), 1)
- si.debit_to = "_Test Receivable - _TC"
- si.posting_date = "2013-10-10"
+ si.set("debit_to", "_Test Receivable - _TC")
+ si.set("posting_date", "2013-10-10")
si.insert()
si.submit()
- si1 = make_sales_invoice(so.name)
+ si1 = self.make_next_doc_testcase(so, "Sales Invoice")
self.assertEquals(len(si1.get("entries")), 0)
+ def test_update_qty(self):
+ so = frappe.copy_doc(test_records[0]).insert()
+
+ dn = self.make_next_doc_testcase(so, "Delivery Note")
+
+ dn.get("delivery_note_details")[0].qty = 6
+ dn.posting_date = "2013-10-10"
+ dn.insert()
+
+ delivery_note = frappe.get_doc("Delivery Note", dn.name)
+ delivery_note.submit()
+
+ sales_order = frappe.get_doc("Sales Order", so.name)
+
+ self.assertEquals(sales_order.get("sales_order_details")[0].delivered_qty, 6)
+
+ #Check delivered_qty after make_sales_invoice without update_stock checked
+ si1 = self.make_next_doc_testcase(sales_order, "Sales Invoice")
+
+ si1.set("debit_to", "_Test Receivable - _TC")
+ si1.set("posting_date", "2013-10-10")
+ si1.get("entries")[0].qty = 1
+ si1.insert()
+ si1.submit()
+
+ sales_order = frappe.get_doc("Sales Order", sales_order.name)
+
+ self.assertEquals(sales_order.get("sales_order_details")[0].delivered_qty, 6)
+
+ #Check delivered_qty after make_sales_invoice with update_stock checked
+ si2 = self.make_next_doc_testcase(sales_order, "Sales Invoice")
+
+ si2.set("debit_to", "_Test Receivable - _TC")
+ si2.set("posting_date", "2013-10-10")
+ si2.set("update_stock", 1)
+ si2.get("entries")[0].qty = 3
+ si2.insert()
+ si2.submit()
+
+ sales_order = frappe.get_doc("Sales Order", sales_order.name)
+
+ self.assertEquals(sales_order.get("sales_order_details")[0].delivered_qty, 9)
+
+ def make_next_doc_testcase(self, so, next_doc = None):
+
+ if so.docstatus < 1:
+ so.submit()
+
+ if next_doc == "Delivery Note":
+ from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note
+ next_doc = make_delivery_note(so.name)
+
+ if next_doc == "Sales Invoice":
+ from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
+ next_doc = make_sales_invoice(so.name)
+
+ return next_doc
def create_so(self, so_doc = None):
if not so_doc:
@@ -85,7 +138,7 @@
dn = frappe.get_doc(frappe.copy_doc(dn_test_records[0]))
dn.get("delivery_note_details")[0].item_code = so.get("sales_order_details")[0].item_code
dn.get("delivery_note_details")[0].against_sales_order = so.name
- dn.get("delivery_note_details")[0].prevdoc_detail_docname = so.get("sales_order_details")[0].name
+ dn.get("delivery_note_details")[0].so_detail = so.get("sales_order_details")[0].name
if delivered_qty:
dn.get("delivery_note_details")[0].qty = delivered_qty
dn.insert()
diff --git a/erpnext/selling/report/customer_credit_balance/__init__.py b/erpnext/selling/report/customer_credit_balance/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/selling/report/customer_credit_balance/__init__.py
diff --git a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.js b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.js
new file mode 100644
index 0000000..90254ad
--- /dev/null
+++ b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.js
@@ -0,0 +1,21 @@
+// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
+// For license information, please see license.txt
+
+frappe.query_reports["Customer Credit Balance"] = {
+ "filters": [
+ {
+ "fieldname":"company",
+ "label": __("Company"),
+ "fieldtype": "Link",
+ "options": "Company",
+ "reqd": 1,
+ "default": frappe.defaults.get_user_default("company")
+ },
+ {
+ "fieldname":"customer",
+ "label": __("Customer"),
+ "fieldtype": "Link",
+ "options": "Customer"
+ }
+ ]
+}
diff --git a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.json b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.json
new file mode 100644
index 0000000..94ea416
--- /dev/null
+++ b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.json
@@ -0,0 +1,17 @@
+{
+ "add_total_row": 0,
+ "apply_user_permissions": 1,
+ "creation": "2014-10-06 15:19:31.578162",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "is_standard": "Yes",
+ "modified": "2014-10-06 15:19:37.578616",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Customer Credit Balance",
+ "owner": "Administrator",
+ "ref_doctype": "Customer",
+ "report_name": "Customer Credit Balance",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py
new file mode 100644
index 0000000..9bc14ac
--- /dev/null
+++ b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py
@@ -0,0 +1,54 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.utils import flt
+from erpnext.selling.doctype.customer.customer import get_customer_outstanding, get_credit_limit
+
+def execute(filters=None):
+ if not filters: filters = {}
+ #Check if customer id is according to naming series or customer name
+ customer_naming_type = frappe.db.get_value("Selling Settings", None, "cust_master_name")
+ columns = get_columns(customer_naming_type)
+
+ data = []
+
+ customer_list = get_details(filters)
+
+ for d in customer_list:
+ row = []
+ outstanding_amt = get_customer_outstanding(d.name, filters.get("company"))
+ credit_limit = get_credit_limit(d.name, filters.get("company"))
+ bal = flt(credit_limit) - flt(outstanding_amt)
+
+ if customer_naming_type == "Naming Series":
+ row = [d.name, d.customer_name, credit_limit, outstanding_amt, bal]
+ else:
+ row = [d.name, credit_limit, outstanding_amt, bal]
+
+ if credit_limit:
+ data.append(row)
+
+ return columns, data
+
+def get_columns(customer_naming_type):
+ columns = [
+ _("Customer") + ":Link/Customer:120", _("Credit Limit") + ":Currency:120",
+ _("Outstanding Amt") + ":Currency:100", _("Credit Balance") + ":Currency:120"
+ ]
+
+ if customer_naming_type == "Naming Series":
+ columns.insert(1, _("Customer Name") + ":Data:120")
+
+ return columns
+
+def get_details(filters):
+ conditions = ""
+
+ if filters.get("customer"):
+ conditions += " where name = %(customer)s"
+
+ return frappe.db.sql("""select name, customer_name from `tabCustomer` %s"""
+ % conditions, filters, as_dict=1)
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index ee8dc0c..67a33c9 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -25,7 +25,7 @@
self.status_updater = [{
'source_dt': 'Delivery Note Item',
'target_dt': 'Sales Order Item',
- 'join_field': 'prevdoc_detail_docname',
+ 'join_field': 'so_detail',
'target_field': 'delivered_qty',
'target_parent_dt': 'Sales Order',
'target_parent_field': 'per_delivered',
@@ -34,6 +34,22 @@
'percent_join_field': 'against_sales_order',
'status_field': 'delivery_status',
'keyword': 'Delivered',
+ 'second_source_dt': 'Sales Invoice Item',
+ 'second_source_field': 'qty',
+ 'second_join_field': 'so_detail',
+ 'overflow_type': 'delivery',
+ 'second_source_extra_cond': """ and exists(select name from `tabSales Invoice`
+ where name=`tabSales Invoice Item`.parent and ifnull(update_stock, 0) = 1)"""
+ },
+ {
+ 'source_dt': 'Delivery Note Item',
+ 'target_dt': 'Sales Invoice Item',
+ 'join_field': 'si_detail',
+ 'target_field': 'delivered_qty',
+ 'target_parent_dt': 'Sales Invoice',
+ 'target_ref_field': 'qty',
+ 'source_field': 'qty',
+ 'percent_join_field': 'against_sales_invoice',
'overflow_type': 'delivery'
}]
@@ -113,7 +129,7 @@
if cint(frappe.defaults.get_global_default('maintain_same_sales_rate')):
super(DeliveryNote, self).validate_with_previous_doc(self.tname, {
fn[0] + " Item": {
- "ref_dn_field": "prevdoc_detail_docname",
+ "ref_dn_field": "so_detail",
"compare_fields": [["rate", "="]],
"is_child_table": True
}
@@ -312,7 +328,7 @@
"field_map": {
"name": "dn_detail",
"parent": "delivery_note",
- "prevdoc_detail_docname": "so_detail",
+ "so_detail": "so_detail",
"against_sales_order": "sales_order",
"serial_no": "serial_no"
},
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
index a5fe469..57adf3f 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -373,11 +373,11 @@
"read_only": 1
},
{
- "fieldname": "prevdoc_detail_docname",
+ "fieldname": "so_detail",
"fieldtype": "Data",
"hidden": 1,
"in_filter": 1,
- "label": "Against Document Detail No",
+ "label": "Against Sales Order Item",
"no_copy": 1,
"oldfieldname": "prevdoc_detail_docname",
"oldfieldtype": "Data",
@@ -389,6 +389,18 @@
"width": "150px"
},
{
+ "fieldname": "si_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Against Sales Invoice Item",
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
"fieldname": "installed_qty",
"fieldtype": "Float",
"label": "Installed Qty",
@@ -426,7 +438,7 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-09-09 05:35:37.460939",
+ "modified": "2014-10-08 11:11:59.411329",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index 3729b55..147a3b1 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -6,6 +6,8 @@
{% include 'buying/doctype/purchase_common/purchase_common.js' %};
+frappe.require("assets/erpnext/js/utils.js");
+
erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.extend({
onload: function(doc) {
this._super();
@@ -194,4 +196,4 @@
cur_frm.cscript.send_sms = function() {
frappe.require("assets/erpnext/js/sms_manager.js");
var sms_man = new SMSManager(cur_frm.doc);
-}
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 96dee3d..d961b40 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -1,10 +1,10 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt
+// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt
cur_frm.cscript.tname = "Stock Entry Detail";
cur_frm.cscript.fname = "mtn_details";
frappe.require("assets/erpnext/js/controllers/stock_controller.js");
+frappe.require("assets/erpnext/js/utils.js");
frappe.provide("erpnext.stock");
erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
@@ -462,4 +462,12 @@
return { query: "erpnext.controllers.queries.supplier_query" }
}
cur_frm.add_fetch('production_order', 'total_fixed_cost', 'total_fixed_cost');
-cur_frm.add_fetch('bom_no', 'total_fixed_cost', 'total_fixed_cost');
\ No newline at end of file
+cur_frm.add_fetch('bom_no', 'total_fixed_cost', 'total_fixed_cost');
+
+cur_frm.cscript.company = function(doc, cdt, cdn) {
+ erpnext.get_fiscal_year(doc.company, doc.posting_date);
+}
+
+cur_frm.cscript.posting_date = function(doc, cdt, cdn){
+ erpnext.get_fiscal_year(doc.company, doc.posting_date);
+}
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json
index 5f78758..8cbfbef 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.json
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.json
@@ -510,17 +510,6 @@
"read_only": 1
},
{
- "fieldname": "fiscal_year",
- "fieldtype": "Link",
- "in_filter": 0,
- "label": "Fiscal Year",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
"allow_on_submit": 0,
"fieldname": "company",
"fieldtype": "Link",
@@ -539,6 +528,17 @@
"search_index": 0
},
{
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "in_filter": 0,
+ "label": "Fiscal Year",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
"allow_on_submit": 1,
"fieldname": "select_print_heading",
"fieldtype": "Link",
@@ -585,7 +585,7 @@
"is_submittable": 1,
"issingle": 0,
"max_attachments": 0,
- "modified": "2014-09-16 15:56:37.514676",
+ "modified": "2014-10-03 14:55:44.916658",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry",
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index 432a999..27ed872 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -2,6 +2,7 @@
// License: GNU General Public License v3. See license.txt
frappe.require("assets/erpnext/js/controllers/stock_controller.js");
+frappe.require("assets/erpnext/js/utils.js");
frappe.provide("erpnext.stock");
erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
@@ -159,3 +160,11 @@
});
cur_frm.cscript = new erpnext.stock.StockReconciliation({frm: cur_frm});
+
+cur_frm.cscript.company = function(doc, cdt, cdn) {
+ erpnext.get_fiscal_year(doc.company, doc.posting_date);
+}
+
+cur_frm.cscript.posting_date = function(doc, cdt, cdn){
+ erpnext.get_fiscal_year(doc.company, doc.posting_date);
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
index daba967..0035fe7 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
@@ -1,5 +1,5 @@
{
- "allow_copy": 1,
+ "allow_copy": 1,
"autoname": "SR/.######",
"creation": "2013-03-28 10:35:31",
"description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.",
@@ -42,6 +42,14 @@
"read_only": 1
},
{
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
"fieldname": "fiscal_year",
"fieldtype": "Link",
"label": "Fiscal Year",
@@ -51,14 +59,6 @@
"reqd": 1
},
{
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company",
- "permlevel": 0,
- "reqd": 1
- },
- {
"depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
"fieldname": "expense_account",
"fieldtype": "Link",
@@ -118,7 +118,7 @@
"idx": 1,
"is_submittable": 1,
"max_attachments": 1,
- "modified": "2014-05-26 03:05:54.024413",
+ "modified": "2014-10-08 12:47:52.102135",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Reconciliation",
diff --git a/erpnext/support/doctype/customer_issue/customer_issue.js b/erpnext/support/doctype/customer_issue/customer_issue.js
index 67a265d..bcc59ea 100644
--- a/erpnext/support/doctype/customer_issue/customer_issue.js
+++ b/erpnext/support/doctype/customer_issue/customer_issue.js
@@ -2,6 +2,7 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.support");
+frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on_change("Customer Issue", "customer", function(frm) {
erpnext.utils.get_party_details(frm) });
@@ -89,3 +90,11 @@
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
return{ query: "erpnext.controllers.queries.customer_query" } }
+
+cur_frm.cscript.company = function(doc, cdt, cdn) {
+ erpnext.get_fiscal_year(doc.company, doc.complaint_date);
+}
+
+cur_frm.cscript.complaint_date = function(doc, cdt, cdn){
+ erpnext.get_fiscal_year(doc.company, doc.complaint_date);
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
index e9a7c84..ffdcb3e 100644
--- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
@@ -2,6 +2,7 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.support");
+frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on_change("Maintenance Visit", "customer", function(frm) {
erpnext.utils.get_party_details(frm) });
@@ -92,3 +93,11 @@
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
return {query: "erpnext.controllers.queries.customer_query" }
}
+
+cur_frm.cscript.company = function(doc, cdt, cdn) {
+ erpnext.get_fiscal_year(doc.company, doc.mntc_date);
+}
+
+cur_frm.cscript.mntc_date = function(doc, cdt, cdn){
+ erpnext.get_fiscal_year(doc.company, doc.mntc_date);
+}
\ No newline at end of file