diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json index fa3f81493f..77eaf6560e 100644 --- a/erpnext/accounts/doctype/account/account.json +++ b/erpnext/accounts/doctype/account/account.json @@ -101,7 +101,7 @@ "label": "Account Type", "oldfieldname": "account_type", "oldfieldtype": "Select", - "options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock", + "options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary", "permlevel": 0, "search_index": 0 }, @@ -171,7 +171,7 @@ "icon": "icon-money", "idx": 1, "in_create": 0, - "modified": "2015-04-23 02:53:48.056520", + "modified": "2015-04-27 20:07:37.147184", "modified_by": "Administrator", "module": "Accounts", "name": "Account", diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json index c85e07c5af..254e2b717b 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json @@ -55,7 +55,9 @@ "is_group": 1 }, "Temporary Accounts": { - "Temporary Opening": {} + "Temporary Opening": { + "account_type": "Temporary" + } }, "root_type": "Asset" }, diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py index 24ab6f2f97..dd3c06701f 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py @@ -58,7 +58,9 @@ def get(): "is_group": 1 }, _("Temporary Accounts"): { - _("Temporary Opening"): {} + _("Temporary Opening"): { + "account_type": "Temporary" + } }, "root_type": "Asset" }, diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.json b/erpnext/accounts/doctype/gl_entry/gl_entry.json index ffb3f9bb4f..54c7dd6c13 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.json +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json @@ -24,17 +24,6 @@ "oldfieldtype": "Date", "permlevel": 0 }, - { - "fieldname": "aging_date", - "fieldtype": "Date", - "in_filter": 1, - "in_list_view": 1, - "label": "Aging Date", - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "permlevel": 0, - "search_index": 0 - }, { "fieldname": "account", "fieldtype": "Link", @@ -203,7 +192,7 @@ "icon": "icon-list", "idx": 1, "in_create": 1, - "modified": "2014-09-11 18:35:22.822064", + "modified": "2015-04-27 20:32:48.246818", "modified_by": "Administrator", "module": "Accounts", "name": "GL Entry", diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index 3a953e743d..525ad98fd1 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -163,11 +163,6 @@ 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) { - hide_field('aging_date'); - if (doc.is_opening == 'Yes') unhide_field('aging_date'); -} - cur_frm.cscript.update_totals = function(doc) { var td=0.0; var tc =0.0; var el = doc.accounts || []; diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index 5ebac38c61..6eb395d486 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -294,18 +294,6 @@ "read_only": 0, "search_index": 1 }, - { - "description": "", - "fieldname": "aging_date", - "fieldtype": "Date", - "label": "Ageing Date", - "no_copy": 0, - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, { "default": "Accounts Receivable", "depends_on": "eval:doc.voucher_type == 'Write Off Entry'", @@ -457,7 +445,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2015-03-25 07:11:27.108475", + "modified": "2015-04-27 20:32:31.655580", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry", diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index a06e5fc65f..81608505bd 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -32,7 +32,6 @@ class JournalEntry(AccountsController): self.validate_against_purchase_invoice() self.set_against_account() self.create_remarks() - self.set_aging_date() self.set_print_format_fields() self.validate_against_sales_order() self.validate_against_purchase_order() @@ -306,18 +305,6 @@ class JournalEntry(AccountsController): if r: self.remark = ("\n").join(r) #User Remarks is not mandatory - - def set_aging_date(self): - if self.is_opening != 'Yes': - self.aging_date = self.posting_date - else: - party_list = [d.party for d in self.get("accounts") if d.party_type and d.party] - - if len(party_list) and not self.aging_date: - frappe.throw(_("Aging Date is mandatory for opening entry")) - else: - self.aging_date = self.posting_date - def set_print_format_fields(self): for d in self.get('accounts'): if d.party_type and d.party: diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 417e3b307d..2800425e6f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -116,11 +116,6 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ cur_frm.script_manager.make(erpnext.accounts.PurchaseInvoice); -cur_frm.cscript.is_opening = function(doc, dt, dn) { - hide_field('aging_date'); - if (doc.is_opening == 'Yes') unhide_field('aging_date'); -} - cur_frm.cscript.make_bank_entry = function() { return frappe.call({ method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_from_purchase_invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 6cb1169335..03ed987745 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -749,18 +749,6 @@ "read_only": 0, "search_index": 1 }, - { - "description": "Actual Invoice Date", - "fieldname": "aging_date", - "fieldtype": "Date", - "label": "Aging Date", - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "search_index": 0 - }, { "allow_on_submit": 1, "fieldname": "select_print_heading", @@ -965,7 +953,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2015-03-23 14:47:57.373436", + "modified": "2015-04-27 20:32:12.436976", "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 d2d349e2da..e5bed3cccb 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -47,7 +47,6 @@ class PurchaseInvoice(BuyingController): self.check_for_stopped_status() self.validate_with_previous_doc() self.validate_uom_is_integer("uom", "qty") - self.set_aging_date() self.set_against_expense_account() self.validate_write_off_account() self.update_valuation_rate("items") @@ -141,13 +140,6 @@ class PurchaseInvoice(BuyingController): } }) - - def set_aging_date(self): - if self.is_opening != 'Yes': - self.aging_date = self.posting_date - elif not self.aging_date: - throw(_("Ageing date is mandatory for opening entry")) - def set_against_expense_account(self): auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) @@ -173,7 +165,7 @@ class PurchaseInvoice(BuyingController): elif item.expense_account not in against_accounts: # if no auto_accounting_for_stock or not a stock item against_accounts.append(item.expense_account) - + self.against_expense_account = ",".join(against_accounts) def po_required(self): @@ -393,7 +385,7 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters): # Hence the first condition is an "OR" return frappe.db.sql("""select tabAccount.name from `tabAccount` where (tabAccount.report_type = "Profit and Loss" - or tabAccount.account_type in ("Expense Account", "Fixed Asset")) + or tabAccount.account_type in ("Expense Account", "Fixed Asset", "Temporary")) and tabAccount.is_group=0 and tabAccount.docstatus!=2 and tabAccount.company = '%(company)s' diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 3534cf96e9..04adc6ba1e 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -262,11 +262,6 @@ cur_frm.cscript.update_stock = function(doc, dt, dn) { cur_frm.cscript.hide_fields(doc, dt, dn); } -cur_frm.cscript.is_opening = function(doc, dt, dn) { - hide_field('aging_date'); - if (doc.is_opening == 'Yes') unhide_field('aging_date'); -} - cur_frm.cscript['Make Delivery Note'] = function() { frappe.model.open_mapped_doc({ method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_delivery_note", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 11ae3b5940..46c68e98b4 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -986,17 +986,6 @@ "print_hide": 1, "read_only": 0 }, - { - "description": "Actual Invoice Date", - "fieldname": "aging_date", - "fieldtype": "Date", - "label": "Aging Date", - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, { "fieldname": "fiscal_year", "fieldtype": "Link", @@ -1254,8 +1243,8 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2015-04-02 13:42:22.985078", - "modified_by": "anand@erpnext.com", + "modified": "2015-04-27 20:31:51.966964", + "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", "owner": "Administrator", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 55159e4c91..17c3739ea7 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -62,7 +62,6 @@ class SalesInvoice(SellingController): if not self.is_opening: self.is_opening = 'No' - self.set_aging_date() self.set_against_income_account() self.validate_c_form() self.validate_time_logs_are_submitted() @@ -282,13 +281,6 @@ class SalesInvoice(SellingController): } }) - - def set_aging_date(self): - if self.is_opening != 'Yes': - self.aging_date = self.posting_date - elif not self.aging_date: - throw(_("Ageing Date is mandatory for opening entry")) - def set_against_income_account(self): """Set against account for debit to account""" against_acc = [] @@ -616,7 +608,7 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters): # Hence the first condition is an "OR" return frappe.db.sql("""select tabAccount.name from `tabAccount` where (tabAccount.report_type = "Profit and Loss" - or tabAccount.account_type = "Income Account") + or tabAccount.account_type in ("Income Account", "Temporary")) and tabAccount.is_group=0 and tabAccount.docstatus!=2 and tabAccount.company = '%(company)s' diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index 5fef42667a..49b5c25d1c 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -204,7 +204,7 @@ erpnext.AccountsChart = Class.extend({ {fieldtype:'Select', fieldname:'account_type', label:__('Account Type'), options: ['', 'Bank', 'Cash', 'Warehouse', 'Receivable', 'Payable', 'Equity', 'Cost of Goods Sold', 'Fixed Asset', 'Expense Account', - 'Income Account', 'Tax', 'Chargeable'].join('\n'), + 'Income Account', 'Tax', 'Chargeable', 'Temporary'].join('\n'), description: __("Optional. This setting will be used to filter in various transactions.") }, {fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate')}, {fieldtype:'Link', fieldname:'warehouse', label:__('Warehouse'), options:"Warehouse"} diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index fa6e63a35f..8a0c669fd6 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -39,9 +39,8 @@ class AccountsController(TransactionBase): def before_recurring(self): self.fiscal_year = None - for fieldname in ("due_date", "aging_date"): - if self.meta.get_field(fieldname): - self.set(fieldname, None) + if self.meta.get_field("due_date"): + self.due_date = None def set_missing_values(self, for_validate=False): for fieldname in ["posting_date", "transaction_date"]: @@ -178,7 +177,6 @@ class AccountsController(TransactionBase): 'posting_date': self.posting_date, 'voucher_type': self.doctype, 'voucher_no': self.name, - 'aging_date': self.get("aging_date") or self.posting_date, 'remarks': self.get("remarks"), 'fiscal_year': self.fiscal_year, 'debit': 0,