From 5b9d517d04a319f0e41ac2891215d55a8e1c14ba Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 17 Mar 2016 22:46:09 +0530 Subject: [PATCH 1/8] [fix]Fiscal year removed from trends report --- erpnext/controllers/trends.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py index 7d1b96ba80..3a627161fd 100644 --- a/erpnext/controllers/trends.py +++ b/erpnext/controllers/trends.py @@ -46,6 +46,9 @@ def get_data(filters, conditions): if conditions["based_on_select"] in ["t1.project,", "t2.project,"]: cond = 'and '+ conditions["based_on_select"][:-1] +' IS Not NULL' + year_start_date, year_end_date = frappe.db.get_value("Fiscal Year", + filters.get('fiscal_year'), ["year_start_date", "year_end_date"]) + if filters.get("group_by"): sel_col = '' ind = conditions["columns"].index(conditions["grbc"][0]) @@ -62,12 +65,12 @@ def get_data(filters, conditions): else : inc = 1 data1 = frappe.db.sql(""" select %s from `tab%s` t1, `tab%s Item` t2 %s - where t2.parent = t1.name and t1.company = %s and t1.fiscal_year = %s and + where t2.parent = t1.name and t1.company = %s and t1.posting_date >= %s and %s >= t1.posting_date and t1.docstatus = 1 %s %s group by %s """ % (query_details, conditions["trans"], conditions["trans"], conditions["addl_tables"], "%s", - "%s", conditions.get("addl_tables_relational_cond"), cond, conditions["group_by"]), (filters.get("company"), - filters["fiscal_year"]),as_list=1) + "%s", "%s", conditions.get("addl_tables_relational_cond"), cond, conditions["group_by"]), (filters.get("company"), + year_start_date, year_end_date),as_list=1) for d in range(len(data1)): #to add blanck column @@ -77,25 +80,25 @@ def get_data(filters, conditions): #to get distinct value of col specified by group_by in filter row = frappe.db.sql("""select DISTINCT(%s) from `tab%s` t1, `tab%s Item` t2 %s - where t2.parent = t1.name and t1.company = %s and t1.fiscal_year = %s + where t2.parent = t1.name and t1.company = %s and t1.posting_date >= %s and %s >= t1.posting_date and t1.docstatus = 1 and %s = %s %s """ % (sel_col, conditions["trans"], conditions["trans"], conditions["addl_tables"], - "%s", "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")), - (filters.get("company"), filters.get("fiscal_year"), data1[d][0]), as_list=1) + "%s", "%s", "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")), + (filters.get("company"), year_start_date, year_end_date, data1[d][0]), as_list=1) for i in range(len(row)): des = ['' for q in range(len(conditions["columns"]))] #get data for group_by filter row1 = frappe.db.sql(""" select %s , %s from `tab%s` t1, `tab%s Item` t2 %s - where t2.parent = t1.name and t1.company = %s and t1.fiscal_year = %s + where t2.parent = t1.name and t1.company = %s and t1.posting_date >= %s and %s >= t1.posting_date and t1.docstatus = 1 and %s = %s and %s = %s %s """ % (sel_col, conditions["period_wise_select"], conditions["trans"], - conditions["trans"], conditions["addl_tables"], "%s", "%s", sel_col, + conditions["trans"], conditions["addl_tables"], "%s", "%s","%s", sel_col, "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")), - (filters.get("company"), filters.get("fiscal_year"), row[i][0], + (filters.get("company"), year_start_date, year_end_date, row[i][0], data1[d][0]), as_list=1) des[ind] = row[i][0] @@ -106,13 +109,13 @@ def get_data(filters, conditions): data.append(des) else: data = frappe.db.sql(""" select %s from `tab%s` t1, `tab%s Item` t2 %s - where t2.parent = t1.name and t1.company = %s and t1.fiscal_year = %s and + where t2.parent = t1.name and t1.company = %s and t1.posting_date >= %s and %s >= t1.posting_date and t1.docstatus = 1 %s %s group by %s """ % (query_details, conditions["trans"], conditions["trans"], conditions["addl_tables"], - "%s", "%s", cond, conditions.get("addl_tables_relational_cond", ""), conditions["group_by"]), - (filters.get("company"), filters.get("fiscal_year")), as_list=1) + "%s", "%s", "%s", cond, conditions.get("addl_tables_relational_cond", ""), conditions["group_by"]), + (filters.get("company"), year_start_date, year_end_date), as_list=1) return data From 90ff509f6d58c6fed06f8415a4a6e47cfc8699d7 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 17 Mar 2016 17:30:53 +0530 Subject: [PATCH 2/8] [fix]Earlier recurring billing --- .../purchase_invoice/purchase_invoice.json | 6 +- .../doctype/sales_invoice/sales_invoice.json | 6 +- .../purchase_order/purchase_order.json | 6 +- erpnext/controllers/accounts_controller.py | 13 ++++- erpnext/controllers/recurring_document.py | 6 +- .../doctype/sales_order/sales_order.json | 56 +++++++++---------- 6 files changed, 52 insertions(+), 41 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 9bfc5bed71..757ae1218a 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -2655,7 +2655,7 @@ "unique": 0 }, { - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "depends_on": "is_recurring", @@ -2673,7 +2673,7 @@ "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, - "read_only": 1, + "read_only": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -2692,7 +2692,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-03-16 15:02:51.511069", + "modified": "2016-03-18 02:03:39.309675", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index e640ad21be..a9cf9cbf7d 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -3355,7 +3355,7 @@ "unique": 0 }, { - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "depends_on": "is_recurring", @@ -3373,7 +3373,7 @@ "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, - "read_only": 1, + "read_only": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -3418,7 +3418,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-03-15 19:02:25.882750", + "modified": "2016-03-18 02:03:34.511447", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 6c2fc79c0b..0b83e62eef 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -2657,7 +2657,7 @@ "unique": 0 }, { - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "depends_on": "is_recurring", @@ -2675,7 +2675,7 @@ "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, - "read_only": 1, + "read_only": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -2693,7 +2693,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-16 15:35:21.382861", + "modified": "2016-03-18 02:03:28.445402", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index ae225d2c44..7b6f9436e9 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe import _, throw -from frappe.utils import today, flt, cint, fmt_money +from frappe.utils import today, flt, cint, fmt_money, getdate from erpnext.setup.utils import get_company_currency, get_exchange_rate from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year, get_account_currency from erpnext.utilities.transaction_base import TransactionBase @@ -31,6 +31,9 @@ class AccountsController(TransactionBase): self.set_missing_values(for_validate=True) self.validate_date_with_fiscal_year() + if self.meta.get_field('next_date') and self.next_date: + self.validate_recurring_next_date() + if self.meta.get_field("currency"): self.calculate_taxes_and_totals() if not self.meta.get_field("is_return") or not self.is_return: @@ -88,6 +91,14 @@ class AccountsController(TransactionBase): validate_fiscal_year(self.get(date_field), self.fiscal_year, self.meta.get_label(date_field), self) + def validate_recurring_next_date(self): + posting_date = self.get("posting_date") or self.get("transaction_date") + if getdate(posting_date) > getdate(self.next_date): + frappe.throw(_("Next Date must be greater than Posting Date")) + + if getdate(self.next_date).day != self.repeat_on_day_of_month: + frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal")) + def validate_due_date(self): from erpnext.accounts.party import validate_due_date if self.doctype == "Sales Invoice": diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py index f83df2bea8..c3e98e8260 100644 --- a/erpnext/controllers/recurring_document.py +++ b/erpnext/controllers/recurring_document.py @@ -72,7 +72,7 @@ def manage_recurring_documents(doctype, next_date=None, commit=True): frappe.throw(exception_message) def make_new_document(reference_doc, date_field, posting_date): - new_document = frappe.copy_doc(reference_doc, ignore_no_copy=True) + new_document = frappe.copy_doc(reference_doc, ignore_no_copy=False) mcount = month_map[reference_doc.recurring_type] from_date = get_next_date(reference_doc.from_date, mcount) @@ -89,7 +89,7 @@ def make_new_document(reference_doc, date_field, posting_date): date_field: posting_date, "from_date": from_date, "to_date": to_date, - "next_date": get_next_date(from_date, mcount,cint(reference_doc.repeat_on_day_of_month)) + "next_date": get_next_date(reference_doc.next_date, mcount,cint(reference_doc.repeat_on_day_of_month)) }) # copy document fields @@ -202,7 +202,7 @@ def set_next_date(doc, posting_date): if not doc.repeat_on_day_of_month: msgprint(_("Please enter 'Repeat on Day of Month' field value"), raise_exception=1) - next_date = doc.next_date or get_next_date(doc.from_date, month_map[doc.recurring_type], + next_date = get_next_date(posting_date, month_map[doc.recurring_type], cint(doc.repeat_on_day_of_month)) frappe.db.set(doc, 'next_date', next_date) diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index e6e0cd22d8..072ade8b05 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -2929,32 +2929,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "depends_on": "is_recurring", - "description": "", - "fieldname": "to_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "To Date", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 1, "bold": 0, @@ -2987,6 +2961,32 @@ "collapsible": 0, "depends_on": "is_recurring", "description": "", + "fieldname": "to_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "To Date", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "is_recurring", + "description": "", "fieldname": "next_date", "fieldtype": "Date", "hidden": 0, @@ -3000,7 +3000,7 @@ "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, - "read_only": 1, + "read_only": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -3018,7 +3018,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-14 18:36:19.317513", + "modified": "2016-03-18 02:03:43.706326", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order", From b43df36e851252a258f53d2eddbe6d802cc3712b Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 18 Mar 2016 15:05:50 +0530 Subject: [PATCH 3/8] [fixes] return debtors account name --- erpnext/accounts/utils.py | 2 +- erpnext/shopping_cart/cart.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 5678c29981..06197eb61f 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -479,7 +479,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None): return outstanding_invoices -def get_account(account_type=None, root_type=None, is_group=None, account_currency=None, company=None): +def get_account_name(account_type=None, root_type=None, is_group=None, account_currency=None, company=None): """return account based on matching conditions""" return frappe.db.get_value("Account", { "account_type": account_type or '', diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index 012aaf7750..27271afadd 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -9,7 +9,7 @@ from frappe.utils import cint, flt, get_fullname, cstr from erpnext.utilities.doctype.address.address import get_address_display from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import get_shopping_cart_settings from frappe.utils.nestedset import get_root_of -from erpnext.accounts.utils import get_account +from erpnext.accounts.utils import get_account_name class WebsitePriceListMissingError(frappe.ValidationError): pass @@ -305,7 +305,7 @@ def get_customer(user=None): customer.update({ "accounts": [{ "company": cart_settings.company, - "account": debtors_account.name + "account": debtors_account }] }) @@ -329,24 +329,24 @@ def get_debtors_account(cart_settings): account_name = _("Debtors ({0})".format(payment_gateway_account_currency)) - debtors_account = get_account("Receivable", "Asset", is_group=0,\ - account_currency=payment_gateway_account_currency, company=cart_settings.company) + debtors_account_name = get_account_name("Receivable", "Asset", is_group=0,\ + account_currency=payment_gateway_account_currency, company=cart_settings.company) - if not debtors_account: + if not debtors_account_name: debtors_account = frappe.get_doc({ "doctype": "Account", "account_type": "Receivable", "root_type": "Asset", "is_group": 0, - "parent_account": get_account(root_type="Asset", is_group=1, company=cart_settings.company), + "parent_account": get_account_name(root_type="Asset", is_group=1, company=cart_settings.company), "account_name": account_name, "currency": payment_gateway_account_currency }).insert(ignore_permissions=True) - return debtors_account + return debtors_account.name else: - return debtors_account + return debtors_account_name def get_address_docs(doctype=None, txt=None, filters=None, limit_start=0, limit_page_length=20, party=None): From 5996b2f1bb235ba0b819b1b3e647ec2669af9529 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 18 Mar 2016 15:19:54 +0530 Subject: [PATCH 4/8] [fix] recurring document logic --- .../purchase_invoice/purchase_invoice.json | 4 +- .../purchase_invoice/purchase_invoice.py | 2 - .../doctype/sales_invoice/sales_invoice.json | 4 +- .../doctype/sales_invoice/sales_invoice.py | 4 +- .../purchase_order/purchase_order.json | 4 +- .../doctype/purchase_order/purchase_order.py | 2 - erpnext/controllers/accounts_controller.py | 22 ++--------- erpnext/controllers/recurring_document.py | 39 +++++++++++-------- .../doctype/sales_order/sales_order.json | 4 +- .../doctype/sales_order/sales_order.py | 2 - 10 files changed, 36 insertions(+), 51 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 757ae1218a..c2628c928a 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -2472,7 +2472,7 @@ "unique": 0 }, { - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", @@ -2692,7 +2692,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-03-18 02:03:39.309675", + "modified": "2016-03-18 13:13:43.694604", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index bbb0cf73ab..180831ee92 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -234,8 +234,6 @@ class PurchaseInvoice(BuyingController): reconcile_against_document(lst) def on_submit(self): - super(PurchaseInvoice, self).on_submit() - self.check_prev_docstatus() frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index a9cf9cbf7d..598cfb82ba 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -3171,7 +3171,7 @@ "unique": 0 }, { - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", @@ -3418,7 +3418,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-03-18 02:03:34.511447", + "modified": "2016-03-18 13:12:12.430038", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 5a294247f3..2d45abefda 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -81,8 +81,6 @@ class SalesInvoice(SellingController): self.update_packing_list() def on_submit(self): - super(SalesInvoice, self).on_submit() - if cint(self.update_stock) == 1: self.update_stock_ledger() else: @@ -473,7 +471,7 @@ class SalesInvoice(SellingController): frappe.db.set(self,'paid_amount',0) frappe.db.set(self, 'base_paid_amount', - flt(self.paid_amount*self.conversion_rate, self.precision("base_paid_amount"))) + flt(self.paid_amount*self.conversion_rate, self.precision("base_paid_amount"))) def check_prev_docstatus(self): for d in self.get('items'): diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 0b83e62eef..055f059bd4 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -2474,7 +2474,7 @@ "unique": 0 }, { - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", @@ -2693,7 +2693,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-18 02:03:28.445402", + "modified": "2016-03-18 13:13:07.334625", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 47b592278f..5dd59e8ffc 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -171,8 +171,6 @@ class PurchaseOrder(BuyingController): if self.is_against_so(): self.update_status_updater() - super(PurchaseOrder, self).on_submit() - purchase_controller = frappe.get_doc("Purchase Common") self.update_prevdoc_status() diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 7b6f9436e9..bcaa9fbac9 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe import _, throw -from frappe.utils import today, flt, cint, fmt_money, getdate +from frappe.utils import today, flt, cint, fmt_money from erpnext.setup.utils import get_company_currency, get_exchange_rate from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year, get_account_currency from erpnext.utilities.transaction_base import TransactionBase @@ -31,9 +31,6 @@ class AccountsController(TransactionBase): self.set_missing_values(for_validate=True) self.validate_date_with_fiscal_year() - if self.meta.get_field('next_date') and self.next_date: - self.validate_recurring_next_date() - if self.meta.get_field("currency"): self.calculate_taxes_and_totals() if not self.meta.get_field("is_return") or not self.is_return: @@ -45,17 +42,14 @@ class AccountsController(TransactionBase): if self.doctype in ("Sales Invoice", "Purchase Invoice") and not self.is_return: self.validate_due_date() - 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() self.validate_party() self.validate_currency() - - def on_submit(self): - if self.meta.get_field("is_recurring"): + + if self.meta.get_field("is_recurring") and not self.get("__islocal"): + validate_recurring_document(self) convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date")) def on_update_after_submit(self): @@ -91,14 +85,6 @@ class AccountsController(TransactionBase): validate_fiscal_year(self.get(date_field), self.fiscal_year, self.meta.get_label(date_field), self) - def validate_recurring_next_date(self): - posting_date = self.get("posting_date") or self.get("transaction_date") - if getdate(posting_date) > getdate(self.next_date): - frappe.throw(_("Next Date must be greater than Posting Date")) - - if getdate(self.next_date).day != self.repeat_on_day_of_month: - frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal")) - def validate_due_date(self): from erpnext.accounts.party import validate_due_date if self.doctype == "Sales Invoice": diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py index c3e98e8260..2df7352348 100644 --- a/erpnext/controllers/recurring_document.py +++ b/erpnext/controllers/recurring_document.py @@ -108,6 +108,7 @@ def make_new_document(reference_doc, date_field, posting_date): new_document.run_method("on_recurring", reference_doc=reference_doc) if reference_doc.submit_on_creation: + new_document.insert() new_document.submit() else: new_document.docstatus=0 @@ -160,26 +161,33 @@ def assign_task_to_owner(doc, doctype, msg, users): def validate_recurring_document(doc): if doc.is_recurring: validate_notification_email_id(doc) - - if not doc.recurring_id and not doc.is_new(): - doc.recurring_id = doc.name - if not doc.recurring_type: - msgprint(_("Please select {0}").format(doc.meta.get_label("recurring_type")), - raise_exception=1) + frappe.throw(_("Please select {0}").format(doc.meta.get_label("recurring_type"))) elif not (doc.from_date and doc.to_date): - throw(_("Period From and Period To dates mandatory for recurring {0}").format(doc.doctype)) + frappe.throw(_("Period From and Period To dates mandatory for recurring {0}").format(doc.doctype)) + +def validate_recurring_next_date(doc): + posting_date = doc.get("posting_date") or doc.get("transaction_date") + if getdate(posting_date) > getdate(doc.next_date): + frappe.throw(_("Next Date must be greater than Posting Date")) + + if getdate(doc.next_date).day != doc.repeat_on_day_of_month: + frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal")) -# def convert_to_recurring(doc, posting_date): - if doc.is_recurring: - set_next_date(doc, posting_date) + if doc.is_recurring: + if not doc.recurring_id: + doc.db_set("recurring_id", doc.name) - elif doc.recurring_id: - frappe.db.sql("""update `tab%s` set is_recurring = 0 - where recurring_id = %s""" % (doc.doctype, '%s'), (doc.recurring_id)) -# + set_next_date(doc, posting_date) + + elif doc.recurring_id: + frappe.db.sql("""update `tab%s` set is_recurring = 0 + where recurring_id = %s""" % (doc.doctype, '%s'), (doc.recurring_id)) + + if doc.next_date: + validate_recurring_next_date(doc) def validate_notification_email_id(doc): if doc.notify_by_email: @@ -198,13 +206,12 @@ def validate_notification_email_id(doc): def set_next_date(doc, posting_date): """ Set next date on which recurring document will be created""" - if not doc.repeat_on_day_of_month: msgprint(_("Please enter 'Repeat on Day of Month' field value"), raise_exception=1) next_date = get_next_date(posting_date, month_map[doc.recurring_type], cint(doc.repeat_on_day_of_month)) - frappe.db.set(doc, 'next_date', next_date) + doc.db_set('next_date', next_date) msgprint(_("Next Recurring {0} will be created on {1}").format(doc.doctype, next_date)) diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index 072ade8b05..a9d4e2997d 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -2799,7 +2799,7 @@ "unique": 0 }, { - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", @@ -3018,7 +3018,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-18 02:03:43.706326", + "modified": "2016-03-18 13:11:32.654873", "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 2aff7c5979..529c17cebe 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -150,8 +150,6 @@ class SalesOrder(SellingController): frappe.throw(_("Row #{0}: Set Supplier for item {1}").format(d.idx, d.item_code)) def on_submit(self): - super(SalesOrder, self).on_submit() - self.check_credit_limit() self.update_reserved_qty() From cef10864412137761ca9fff90f60dd4b6eb54a86 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 18 Mar 2016 15:03:57 +0530 Subject: [PATCH 5/8] [fix]Letterhead not being changed with change in company --- erpnext/public/js/controllers/transaction.js | 7 +------ erpnext/public/js/utils.js | 18 ------------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 9ca4351519..d109c656de 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -308,7 +308,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ 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, function() { set_party_account(set_pricing); }); + set_party_account(set_pricing); if(this.frm.doc.company) { erpnext.last_selected_company = this.frm.doc.company; @@ -319,8 +319,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ if (this.frm.doc.transaction_date) { this.frm.transaction_date = this.frm.doc.transaction_date; } - - erpnext.get_fiscal_year(this.frm.doc.company, this.frm.doc.transaction_date); }, posting_date: function() { @@ -342,11 +340,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ if(r.message) { me.frm.set_value("due_date", r.message); } - erpnext.get_fiscal_year(me.frm.doc.company, me.frm.doc.posting_date); } }) - } else { - erpnext.get_fiscal_year(me.frm.doc.company, me.frm.doc.posting_date); } } }, diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index c0549ba41d..9c287e75a7 100644 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -13,24 +13,6 @@ $.extend(erpnext, { return frappe.boot.sysdefaults.currency; }, - get_fiscal_year: function(company, date, fn) { - if(frappe.meta.get_docfield(cur_frm.doctype, "fiscal_year")) { - 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); From 9a75530c26e3a3881628ca9f822f13b975813471 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 18 Mar 2016 16:19:13 +0530 Subject: [PATCH 6/8] [fix] reload doctype for renaming project --- .../doctype/purchase_invoice_item/purchase_invoice_item.json | 2 +- .../buying/doctype/purchase_order_item/purchase_order_item.json | 2 +- .../supplier_quotation_item/supplier_quotation_item.json | 2 +- erpnext/manufacturing/doctype/bom/bom.json | 2 +- .../doctype/production_order/production_order.json | 2 +- erpnext/patches/v6_20x/rename_project_name_to_project.py | 2 +- erpnext/stock/doctype/delivery_note/delivery_note.json | 2 +- .../doctype/purchase_receipt_item/purchase_receipt_item.json | 2 +- erpnext/stock/doctype/stock_entry/stock_entry.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json index 687b84bba5..ae44c1a4b7 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -1239,7 +1239,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-03-10 05:05:27.752823", + "modified": "2016-03-18 05:05:27.752823", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json index c481e01bcc..aaf0ae8a36 100755 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json @@ -1384,7 +1384,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-03-10 05:08:54.505417", + "modified": "2016-03-18 05:08:54.505417", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item", diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json index 04a31f4bc1..b09667ba96 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -1046,7 +1046,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-03-10 05:15:03.936587", + "modified": "2016-03-18 05:15:03.936587", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json index bf8c67ca34..bd379e2a6b 100644 --- a/erpnext/manufacturing/doctype/bom/bom.json +++ b/erpnext/manufacturing/doctype/bom/bom.json @@ -807,7 +807,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-10 05:09:50.749754", + "modified": "2016-03-18 05:09:50.749754", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM", diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json index 35196de0d3..02467ef5c3 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.json +++ b/erpnext/manufacturing/doctype/production_order/production_order.json @@ -1036,7 +1036,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-10 05:10:07.951138", + "modified": "2016-03-18 05:10:07.951138", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order", diff --git a/erpnext/patches/v6_20x/rename_project_name_to_project.py b/erpnext/patches/v6_20x/rename_project_name_to_project.py index 8851451cb0..b420ce9013 100644 --- a/erpnext/patches/v6_20x/rename_project_name_to_project.py +++ b/erpnext/patches/v6_20x/rename_project_name_to_project.py @@ -12,6 +12,6 @@ def execute(): "Purchase Receipt Item", "Supplier Quotation Item"] for doctype in doc_list: - frappe.reload_doctype(doctype, force=True) + frappe.reload_doctype(doctype) rename_field(doctype, "project_name", "project") \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index 7fb5421c7d..b4bb456520 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -2799,7 +2799,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-03-10 05:10:56.813113", + "modified": "2016-03-18 05:10:56.813113", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 678ee5afa1..b7e4f2dc20 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -1715,7 +1715,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-03-10 05:11:15.937267", + "modified": "2016-03-18 05:11:15.937267", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json index 495900f08f..2697fd0f6d 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.json +++ b/erpnext/stock/doctype/stock_entry/stock_entry.json @@ -1431,7 +1431,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-07 08:37:08.747493", + "modified": "2016-03-18 08:37:08.747493", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry", From 277b7fa64187c8b0dd4ab0b245199739bb21a2e0 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 18 Mar 2016 16:15:26 +0530 Subject: [PATCH 7/8] [Enhancement]Fetch default letter head of company on salary structure and salary slip --- erpnext/hr/doctype/salary_slip/salary_slip.js | 1 + .../hr/doctype/salary_slip/salary_slip.json | 83 +++++++++++----- .../salary_structure/salary_structure.js | 1 + .../salary_structure/salary_structure.json | 98 ++++++++++++++----- 4 files changed, 133 insertions(+), 50 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js index f2e5a9ed68..905ec21203 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -2,6 +2,7 @@ // License: GNU General Public License v3. See license.txt cur_frm.add_fetch('employee', 'company', 'company'); +cur_frm.add_fetch('company', 'default_letter_head', 'letter_head'); // On load // ------------------------------------------------------------------- diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json index e79ff618da..e83d442bbb 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.json +++ b/erpnext/hr/doctype/salary_slip/salary_slip.json @@ -16,6 +16,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -40,6 +41,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Employee", @@ -66,6 +68,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Employee Name", @@ -91,6 +94,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Department", @@ -117,6 +121,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Designation", @@ -143,6 +148,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Branch", @@ -161,6 +167,31 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "company", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Company", + "length": 0, + "no_copy": 0, + "options": "Company", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 1, "bold": 0, @@ -169,6 +200,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Letter Head", @@ -185,30 +217,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "company", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Company", - "length": 0, - "no_copy": 0, - "options": "Company", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -217,6 +225,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -241,6 +250,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 1, "label": "Month", @@ -268,6 +278,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 1, "label": "Fiscal Year", @@ -294,6 +305,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Working Days", @@ -319,6 +331,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Leave Without Pay", @@ -344,6 +357,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Payment Days", @@ -369,6 +383,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Bank Name", @@ -394,6 +409,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Bank Account No.", @@ -419,6 +435,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Email", @@ -444,6 +461,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Amended From", @@ -470,6 +488,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Earning & Deduction", @@ -494,6 +513,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Earning", @@ -519,6 +539,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Earnings", @@ -545,6 +566,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Deduction", @@ -570,6 +592,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Deductions", @@ -596,6 +619,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "", @@ -620,6 +644,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -642,6 +667,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -664,6 +690,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Arrear Amount", @@ -690,6 +717,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Leave Encashment Amount", @@ -716,6 +744,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Gross Pay", @@ -742,6 +771,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total Deduction", @@ -769,6 +799,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Net Pay", @@ -795,6 +826,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Rounded Total", @@ -820,6 +852,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total in words", @@ -848,7 +881,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-02-03 01:17:01.042780", + "modified": "2016-03-18 16:02:55.254165", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip", diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js index 65aac1bf60..77f516eff7 100755 --- a/erpnext/hr/doctype/salary_structure/salary_structure.js +++ b/erpnext/hr/doctype/salary_structure/salary_structure.js @@ -2,6 +2,7 @@ // License: GNU General Public License v3. See license.txt cur_frm.add_fetch('employee', 'company', 'company'); +cur_frm.add_fetch('company', 'default_letter_head', 'letter_head'); cur_frm.cscript.onload = function(doc, dt, dn){ e_tbl = doc.earnings || []; diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.json b/erpnext/hr/doctype/salary_structure/salary_structure.json index 113f30982e..e832697cd2 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.json +++ b/erpnext/hr/doctype/salary_structure/salary_structure.json @@ -16,6 +16,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -39,6 +40,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Employee", @@ -65,6 +67,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, "label": "Employee Name", @@ -90,6 +93,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Branch", @@ -116,6 +120,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Designation", @@ -142,6 +147,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Department", @@ -160,6 +166,57 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "company", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Company", + "length": 0, + "no_copy": 0, + "options": "Company", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "letter_head", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Letter Head", + "length": 0, + "no_copy": 0, + "options": "Letter Head", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -168,6 +225,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -192,6 +250,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 1, "label": "Is Active", @@ -218,6 +277,7 @@ "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, "label": "From Date", @@ -243,6 +303,7 @@ "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, "label": "To Date", @@ -260,30 +321,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "company", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Company", - "length": 0, - "no_copy": 0, - "options": "Company", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -293,6 +330,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Monthly Earning & Deduction", @@ -318,6 +356,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Earning", @@ -344,6 +383,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Earnings", @@ -370,6 +410,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Deduction", @@ -396,6 +437,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Deductions", @@ -422,6 +464,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -445,6 +488,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -468,6 +512,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total Earning", @@ -494,6 +539,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total Deduction", @@ -520,6 +566,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -543,6 +590,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Net Pay", @@ -570,7 +618,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-02-03 01:18:16.629324", + "modified": "2016-03-18 16:10:30.031811", "modified_by": "Administrator", "module": "HR", "name": "Salary Structure", From 6d274704019f9a1969a819a272674a42fc00ffaa Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 18 Mar 2016 17:06:40 +0600 Subject: [PATCH 8/8] bumped to version 6.27.1 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index d6d18f9a2d..0fa96da0f9 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '6.27.0' +__version__ = '6.27.1' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index a525749be0..e58625bdd0 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd." app_description = """ERP made simple""" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "6.27.0" +app_version = "6.27.1" app_email = "info@erpnext.com" app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" diff --git a/setup.py b/setup.py index 54ffc07833..847e727c46 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages from pip.req import parse_requirements -version = "6.27.0" +version = "6.27.1" requirements = parse_requirements("requirements.txt", session="") setup(