Account type Temporary and removed Aging Date field from all documents
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index fa3f814..77eaf65 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 c85e07c..254e2b7 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 24ab6f2..dd3c067 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 @@
"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 ffb3f9b..54c7dd6 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.json
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json
@@ -25,17 +25,6 @@
"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",
"in_filter": 1,
@@ -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 3a953e7..525ad98 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -163,11 +163,6 @@
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 5ebac38..6eb395d 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.json
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json
@@ -295,18 +295,6 @@
"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'",
"fieldname": "write_off_based_on",
@@ -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 a06e5fc..8160850 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -32,7 +32,6 @@
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 @@
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 417e3b3..2800425 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -116,11 +116,6 @@
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 6cb1169..03ed987 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -750,18 +750,6 @@
"search_index": 1
},
{
- "description": "Actual Invoice Date",
- "fieldname": "aging_date",
- "fieldtype": "Date",
- "label": "Aging Date",
- "oldfieldname": "aging_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "search_index": 0
- },
- {
"allow_on_submit": 1,
"fieldname": "select_print_heading",
"fieldtype": "Link",
@@ -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 d2d349e..e5bed3c 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -47,7 +47,6 @@
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 @@
}
})
-
- 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 @@
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 @@
# 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 3534cf9..04adc6b 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.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 11ae3b5..46c68e9 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -987,17 +987,6 @@
"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",
"in_filter": 1,
@@ -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 55159e4..17c3739 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -62,7 +62,6 @@
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 @@
}
})
-
- 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 @@
# 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 5fef426..49b5c25 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -204,7 +204,7 @@
{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 fa6e63a..8a0c669 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -39,9 +39,8 @@
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 @@
'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,