Merge branch 'master' of github.com:webnotes/erpnext into purchase_price_list

Conflicts:
	accounts/doctype/gl_control/gl_control.py
This commit is contained in:
Anand Doshi
2013-01-17 20:31:41 +05:30
92 changed files with 1234 additions and 1924 deletions

View File

@@ -1 +1,62 @@
[{'doc_type': 'Journal Voucher', 'modified_by': 'nabin@webnotestech.com', 'name': 'Journal Voucher', 'parent': None, 'creation': '2009-03-12 12:09:24', 'modified': '2010-04-30 17:56:41', 'module': 'Accounts', 'doctype': 'GL Mapper', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}, {'creation': '2009-03-12 12:09:24', 'voucher_type': 'parent:doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': 'cost_center', 'voucher_no': 'parent:name', 'modified_by': 'nabin@webnotestech.com', 'against_voucher': "value:d.against_voucher or d.against_invoice or d.against_jv or ''", 'table_field': 'entries', 'transaction_date': 'parent:voucher_date', 'debit': 'debit', 'docstatus': 0, 'parent': 'Journal Voucher', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': 'is_advance', 'remarks': 'parent:remark', 'account': 'account', 'name': 'GLMDetail00001', 'idx': 1, 'against_voucher_type': "value:(d.against_voucher and 'Purchase Invoice') or (d.against_invoice and 'Sales Invoice') or (d.against_jv and 'Journal Voucher') or ''", 'modified': '2010-04-30 17:56:41', 'against': 'against_account', 'credit': 'credit', 'parenttype': 'GL Mapper', 'is_opening': 'parent:is_opening', 'posting_date': 'parent:posting_date', 'parentfield': 'fields'}, {'creation': '2009-06-11 11:09:11', 'voucher_type': 'doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': '', 'voucher_no': 'name', 'modified_by': 'nabin@webnotestech.com', 'against_voucher': '', 'table_field': '', 'transaction_date': 'voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Journal Voucher', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': '', 'remarks': 'remark', 'account': 'tax_code', 'name': 'GLMDetail00009', 'idx': 2, 'against_voucher_type': None, 'modified': '2010-04-30 17:56:41', 'against': 'supplier_account', 'credit': 'ded_amount', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}]
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-05-01 12:46:31",
"modified_by": "Administrator",
"modified": "2012-05-01 09:16:31"
},
{
"doc_type": "Journal Voucher",
"name": "__common__",
"doctype": "GL Mapper"
},
{
"name": "__common__",
"parent": "Journal Voucher",
"doctype": "GL Mapper Detail",
"parenttype": "GL Mapper",
"parentfield": "fields"
},
{
"name": "Journal Voucher",
"doctype": "GL Mapper"
},
{
"account": "account",
"doctype": "GL Mapper Detail",
"credit": "credit",
"against_voucher_type": "value:(d.against_voucher and 'Purchase Invoice') or (d.against_invoice and 'Sales Invoice') or (d.against_jv and 'Journal Voucher') or ''",
"company": "parent:company",
"debit": "debit",
"fiscal_year": "parent:fiscal_year",
"against": "against_account",
"voucher_type": "parent:doctype",
"against_voucher": "value:d.against_voucher or d.against_invoice or d.against_jv or ''",
"table_field": "entries",
"transaction_date": "parent:voucher_date",
"is_advance": "is_advance",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remark",
"posting_date": "parent:posting_date",
"voucher_no": "parent:name",
"cost_center": "cost_center"
},
{
"account": "tax_code",
"doctype": "GL Mapper Detail",
"company": "company",
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "supplier_account",
"voucher_type": "doctype",
"credit": "ded_amount",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remark",
"posting_date": "posting_date",
"voucher_no": "name"
}
]

View File

@@ -1,233 +1,148 @@
[
{
'creation': '2011-05-10 11:21:22',
'doc_type': 'POS with write off',
'docstatus': 0,
'doctype': 'GL Mapper',
'idx': None,
'modified': '2011-05-10 11:21:22',
'modified_by': 'Administrator',
'name': 'POS with write off',
'owner': 'Administrator',
'parent': None,
'parentfield': None,
'parenttype': None
},
{
'account': 'income_account',
'against': 'parent:debit_to',
'against_voucher': None,
'against_voucher_type': None,
'aging_date': 'parent:aging_date',
'company': 'parent:company',
'cost_center': 'cost_center',
'creation': '2011-05-10 11:21:22',
'credit': 'amount',
'debit': 'value:0',
'docstatus': 0,
'doctype': 'GL Mapper Detail',
'fiscal_year': 'parent:fiscal_year',
'idx': 1,
'is_advance': None,
'is_opening': 'parent:is_opening',
'modified': '2011-05-10 11:21:22',
'modified_by': 'Administrator',
'name': '000002752',
'owner': 'Administrator',
'parent': 'POS with write off',
'parentfield': 'fields',
'parenttype': 'GL Mapper',
'posting_date': 'parent:posting_date',
'remarks': 'parent:remarks',
'table_field': 'entries',
'transaction_date': 'parent:voucher_date',
'voucher_no': 'parent:name',
'voucher_type': 'parent:doctype'
},
{
'account': 'account_head',
'against': 'parent:debit_to',
'against_voucher': None,
'against_voucher_type': None,
'aging_date': 'parent:aging_date',
'company': 'parent:company',
'cost_center': 'cost_center_other_charges',
'creation': '2011-05-10 11:21:22',
'credit': 'tax_amount',
'debit': 'value:0',
'docstatus': 0,
'doctype': 'GL Mapper Detail',
'fiscal_year': 'parent:fiscal_year',
'idx': 2,
'is_advance': None,
'is_opening': 'parent:is_opening',
'modified': '2011-05-10 11:21:22',
'modified_by': 'Administrator',
'name': '000002753',
'owner': 'Administrator',
'parent': 'POS with write off',
'parentfield': 'fields',
'parenttype': 'GL Mapper',
'posting_date': 'parent:posting_date',
'remarks': 'parent:remarks',
'table_field': 'other_charges',
'transaction_date': 'parent:voucher_date',
'voucher_no': 'parent:name',
'voucher_type': 'parent:doctype'
},
{
'account': 'debit_to',
'against': 'against_income_account',
'against_voucher': 'name',
'against_voucher_type': 'doctype',
'aging_date': 'aging_date',
'company': 'company',
'cost_center': None,
'creation': '2011-05-10 11:21:22',
'credit': 'value:0',
'debit': 'grand_total',
'docstatus': 0,
'doctype': 'GL Mapper Detail',
'fiscal_year': 'fiscal_year',
'idx': 3,
'is_advance': None,
'is_opening': 'is_opening',
'modified': '2011-05-10 11:21:22',
'modified_by': 'Administrator',
'name': '000002754',
'owner': 'Administrator',
'parent': 'POS with write off',
'parentfield': 'fields',
'parenttype': 'GL Mapper',
'posting_date': 'posting_date',
'remarks': 'remarks',
'table_field': None,
'transaction_date': 'voucher_date',
'voucher_no': 'name',
'voucher_type': 'doctype'
},
{
'account': 'debit_to',
'against': 'cash_bank_account',
'against_voucher': 'name',
'against_voucher_type': 'doctype',
'aging_date': 'aging_date',
'company': 'company',
'cost_center': None,
'creation': '2011-05-10 11:21:22',
'credit': 'paid_amount',
'debit': 'value:0',
'docstatus': 0,
'doctype': 'GL Mapper Detail',
'fiscal_year': 'fiscal_year',
'idx': 4,
'is_advance': None,
'is_opening': 'is_opening',
'modified': '2011-05-10 11:21:22',
'modified_by': 'Administrator',
'name': '000002755',
'owner': 'Administrator',
'parent': 'POS with write off',
'parentfield': 'fields',
'parenttype': 'GL Mapper',
'posting_date': 'posting_date',
'remarks': 'remarks',
'table_field': None,
'transaction_date': 'voucher_date',
'voucher_no': 'name',
'voucher_type': 'doctype'
},
{
'account': 'debit_to',
'against': 'write_off_account',
'against_voucher': 'name',
'against_voucher_type': 'doctype',
'aging_date': 'aging_date',
'company': 'company',
'cost_center': None,
'creation': '2011-05-10 11:21:22',
'credit': 'write_off_amount',
'debit': 'value:0',
'docstatus': 0,
'doctype': 'GL Mapper Detail',
'fiscal_year': 'fiscal_year',
'idx': 5,
'is_advance': None,
'is_opening': 'is_opening',
'modified': '2011-05-10 11:21:22',
'modified_by': 'Administrator',
'name': '000002758',
'owner': 'Administrator',
'parent': 'POS with write off',
'parentfield': 'fields',
'parenttype': 'GL Mapper',
'posting_date': 'posting_date',
'remarks': 'remarks',
'table_field': None,
'transaction_date': 'voucher_date',
'voucher_no': 'name',
'voucher_type': 'doctype'
},
{
'account': 'cash_bank_account',
'against': 'debit_to',
'against_voucher': None,
'against_voucher_type': None,
'aging_date': 'aging_date',
'company': 'company',
'cost_center': None,
'creation': '2011-05-10 11:21:22',
'credit': 'value:0',
'debit': 'paid_amount',
'docstatus': 0,
'doctype': 'GL Mapper Detail',
'fiscal_year': 'fiscal_year',
'idx': 6,
'is_advance': None,
'is_opening': 'is_opening',
'modified': '2011-05-10 11:21:22',
'modified_by': 'Administrator',
'name': '000002756',
'owner': 'Administrator',
'parent': 'POS with write off',
'parentfield': 'fields',
'parenttype': 'GL Mapper',
'posting_date': 'posting_date',
'remarks': 'remarks',
'table_field': None,
'transaction_date': 'voucher_date',
'voucher_no': 'name',
'voucher_type': 'doctype'
},
{
'account': 'write_off_account',
'against': 'debit_to',
'against_voucher': None,
'against_voucher_type': None,
'aging_date': 'aging_date',
'company': 'company',
'cost_center': 'write_off_cost_center',
'creation': '2011-05-10 11:21:22',
'credit': 'value:0',
'debit': 'write_off_amount',
'docstatus': 0,
'doctype': 'GL Mapper Detail',
'fiscal_year': 'fiscal_year',
'idx': 7,
'is_advance': None,
'is_opening': 'is_opening',
'modified': '2011-05-10 11:21:22',
'modified_by': 'Administrator',
'name': '000002757',
'owner': 'Administrator',
'parent': 'POS with write off',
'parentfield': 'fields',
'parenttype': 'GL Mapper',
'posting_date': 'posting_date',
'remarks': 'remarks',
'table_field': None,
'transaction_date': 'voucher_date',
'voucher_no': 'name',
'voucher_type': 'doctype'
}
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2011-05-20 10:07:58",
"modified_by": "Administrator",
"modified": "2012-05-01 09:16:31"
},
{
"doc_type": "POS with write off",
"name": "__common__",
"doctype": "GL Mapper"
},
{
"name": "__common__",
"parent": "POS with write off",
"doctype": "GL Mapper Detail",
"parenttype": "GL Mapper",
"parentfield": "fields"
},
{
"name": "POS with write off",
"doctype": "GL Mapper"
},
{
"account": "income_account",
"doctype": "GL Mapper Detail",
"company": "parent:company",
"debit": "value:0",
"fiscal_year": "parent:fiscal_year",
"against": "parent:debit_to",
"voucher_type": "parent:doctype",
"credit": "amount",
"table_field": "entries",
"transaction_date": "parent:voucher_date",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
"voucher_no": "parent:name",
"cost_center": "cost_center"
},
{
"account": "account_head",
"doctype": "GL Mapper Detail",
"company": "parent:company",
"debit": "value:0",
"fiscal_year": "parent:fiscal_year",
"against": "parent:debit_to",
"voucher_type": "parent:doctype",
"credit": "tax_amount",
"table_field": "other_charges",
"transaction_date": "parent:voucher_date",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
"voucher_no": "parent:name",
"cost_center": "cost_center_other_charges"
},
{
"account": "debit_to",
"doctype": "GL Mapper Detail",
"against_voucher": "name",
"against_voucher_type": "doctype",
"company": "company",
"debit": "grand_total",
"fiscal_year": "fiscal_year",
"against": "against_income_account",
"voucher_type": "doctype",
"credit": "value:0",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name"
},
{
"account": "debit_to",
"doctype": "GL Mapper Detail",
"against_voucher": "name",
"against_voucher_type": "doctype",
"company": "company",
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "cash_bank_account",
"voucher_type": "doctype",
"credit": "paid_amount",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name"
},
{
"account": "debit_to",
"doctype": "GL Mapper Detail",
"against_voucher": "name",
"against_voucher_type": "doctype",
"company": "company",
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "write_off_account",
"voucher_type": "doctype",
"credit": "write_off_amount",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name"
},
{
"account": "cash_bank_account",
"doctype": "GL Mapper Detail",
"company": "company",
"debit": "paid_amount",
"fiscal_year": "fiscal_year",
"against": "debit_to",
"voucher_type": "doctype",
"credit": "value:0",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name"
},
{
"account": "write_off_account",
"doctype": "GL Mapper Detail",
"company": "company",
"debit": "write_off_amount",
"fiscal_year": "fiscal_year",
"against": "debit_to",
"voucher_type": "doctype",
"credit": "value:0",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name",
"cost_center": "write_off_cost_center"
}
]

View File

@@ -1 +1,117 @@
[{'doc_type': 'POS', 'modified_by': 'Administrator', 'name': 'POS', 'parent': None, 'creation': '2010-12-14 16:40:09', 'modified': '2010-12-14 20:15:04', 'doctype': 'GL Mapper', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}, {'creation': '2010-12-14 16:40:09', 'voucher_type': 'parent:doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': 'cost_center', 'voucher_no': 'parent:name', 'modified_by': 'Administrator', 'against_voucher': None, 'table_field': 'entries', 'transaction_date': 'parent:voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'POS', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'income_account', 'name': 'GLMDetail00010', 'idx': 1, 'against_voucher_type': None, 'modified': '2010-12-14 20:15:04', 'against': 'parent:debit_to', 'credit': 'amount', 'parenttype': 'GL Mapper', 'is_opening': 'parent:is_opening', 'posting_date': 'parent:posting_date', 'parentfield': 'fields'}, {'creation': '2010-12-14 16:40:09', 'voucher_type': 'parent:doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': 'cost_center_other_charges', 'voucher_no': 'parent:name', 'modified_by': 'Administrator', 'against_voucher': None, 'table_field': 'other_charges', 'transaction_date': 'parent:voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'POS', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'account_head', 'name': 'GLMDetail00011', 'idx': 2, 'against_voucher_type': None, 'modified': '2010-12-14 20:15:04', 'against': 'parent:debit_to', 'credit': 'tax_amount', 'parenttype': 'GL Mapper', 'is_opening': 'parent:is_opening', 'posting_date': 'parent:posting_date', 'parentfield': 'fields'}, {'creation': '2010-12-14 16:40:09', 'voucher_type': 'doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': None, 'voucher_no': 'name', 'modified_by': 'Administrator', 'against_voucher': 'name', 'table_field': None, 'transaction_date': 'voucher_date', 'debit': 'grand_total', 'docstatus': 0, 'parent': 'POS', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'debit_to', 'name': 'GLMDetail00012', 'idx': 3, 'against_voucher_type': 'doctype', 'modified': '2010-12-14 20:15:04', 'against': 'against_income_account', 'credit': 'value:0', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}, {'creation': '2010-12-14 16:40:09', 'voucher_type': 'doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': '', 'voucher_no': 'name', 'modified_by': 'Administrator', 'against_voucher': 'name', 'table_field': None, 'transaction_date': 'voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'POS', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'debit_to', 'name': 'GLMDetail00013', 'idx': 4, 'against_voucher_type': 'doctype', 'modified': '2010-12-14 20:15:04', 'against': 'cash_bank_account', 'credit': 'paid_amount', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}, {'creation': '2010-12-14 16:40:09', 'voucher_type': 'doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': '', 'voucher_no': 'name', 'modified_by': 'Administrator', 'against_voucher': '', 'table_field': None, 'transaction_date': 'voucher_date', 'debit': 'paid_amount', 'docstatus': 0, 'parent': 'POS', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'cash_bank_account', 'name': 'GLMDetail00014', 'idx': 5, 'against_voucher_type': '', 'modified': '2010-12-14 20:15:04', 'against': 'debit_to', 'credit': 'value:0', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}]
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2010-12-15 08:39:20",
"modified_by": "Administrator",
"modified": "2012-05-01 09:16:31"
},
{
"doc_type": "POS",
"name": "__common__",
"doctype": "GL Mapper"
},
{
"name": "__common__",
"parent": "POS",
"doctype": "GL Mapper Detail",
"parenttype": "GL Mapper",
"parentfield": "fields"
},
{
"name": "POS",
"doctype": "GL Mapper"
},
{
"account": "income_account",
"doctype": "GL Mapper Detail",
"company": "parent:company",
"debit": "value:0",
"fiscal_year": "parent:fiscal_year",
"against": "parent:debit_to",
"voucher_type": "parent:doctype",
"credit": "amount",
"table_field": "entries",
"transaction_date": "parent:voucher_date",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
"voucher_no": "parent:name",
"cost_center": "cost_center"
},
{
"account": "account_head",
"doctype": "GL Mapper Detail",
"company": "parent:company",
"debit": "value:0",
"fiscal_year": "parent:fiscal_year",
"against": "parent:debit_to",
"voucher_type": "parent:doctype",
"credit": "tax_amount",
"table_field": "other_charges",
"transaction_date": "parent:voucher_date",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
"voucher_no": "parent:name",
"cost_center": "cost_center_other_charges"
},
{
"account": "debit_to",
"doctype": "GL Mapper Detail",
"against_voucher": "name",
"against_voucher_type": "doctype",
"company": "company",
"debit": "grand_total",
"fiscal_year": "fiscal_year",
"against": "against_income_account",
"voucher_type": "doctype",
"credit": "value:0",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name"
},
{
"account": "debit_to",
"doctype": "GL Mapper Detail",
"credit": "paid_amount",
"against_voucher_type": "doctype",
"company": "company",
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "cash_bank_account",
"voucher_type": "doctype",
"against_voucher": "name",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name",
"cost_center": ""
},
{
"account": "cash_bank_account",
"doctype": "GL Mapper Detail",
"credit": "value:0",
"against_voucher_type": "",
"company": "company",
"debit": "paid_amount",
"fiscal_year": "fiscal_year",
"against": "debit_to",
"voucher_type": "doctype",
"against_voucher": "",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name",
"cost_center": ""
}
]

View File

@@ -2,7 +2,7 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-04-30 19:55:05",
"creation": "2012-10-03 11:29:52",
"modified_by": "Administrator",
"modified": "2012-10-03 11:08:09"
},
@@ -24,89 +24,89 @@
},
{
"account": "expense_head",
"doctype": "GL Mapper Detail",
"company": "parent:company",
"debit": "amount",
"fiscal_year": "parent:fiscal_year",
"against": "parent:credit_to",
"aging_date": "parent:aging_date",
"voucher_type": "parent:doctype",
"credit": "value:0",
"table_field": "entries",
"transaction_date": "parent:voucher_date",
"voucher_type": "parent:doctype",
"is_opening": "parent:is_opening",
"aging_date": "parent:aging_date",
"doctype": "GL Mapper Detail",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
"is_opening": "parent:is_opening",
"voucher_no": "parent:name",
"cost_center": "cost_center"
"debit": "amount",
"cost_center": "cost_center",
"posting_date": "parent:posting_date"
},
{
"account": "account_head",
"doctype": "GL Mapper Detail",
"company": "parent:company",
"debit": "value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0",
"fiscal_year": "parent:fiscal_year",
"against": "parent:credit_to",
"aging_date": "parent:aging_date",
"voucher_type": "parent:doctype",
"credit": "value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0",
"table_field": "purchase_tax_details",
"transaction_date": "parent:voucher_date",
"voucher_type": "parent:doctype",
"is_opening": "parent:is_opening",
"aging_date": "parent:aging_date",
"doctype": "GL Mapper Detail",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
"is_opening": "parent:is_opening",
"voucher_no": "parent:name",
"cost_center": "cost_center"
"debit": "value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0",
"cost_center": "cost_center",
"posting_date": "parent:posting_date"
},
{
"account": "tax_code",
"doctype": "GL Mapper Detail",
"company": "company",
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "credit_to",
"aging_date": "aging_date",
"credit": "ded_amount",
"transaction_date": "voucher_date",
"voucher_type": "doctype",
"is_opening": "is_opening",
"credit": "ded_amount",
"debit": "value:0",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"doctype": "GL Mapper Detail",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name"
"is_opening": "is_opening",
"voucher_no": "name",
"posting_date": "posting_date"
},
{
"account": "credit_to",
"doctype": "GL Mapper Detail",
"credit": "total_amount_to_pay",
"against_voucher": "name",
"against_voucher_type": "value:'Purchase Invoice'",
"company": "company",
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "against_expense_account",
"aging_date": "aging_date",
"against_voucher": "name",
"transaction_date": "voucher_date",
"voucher_type": "doctype",
"is_opening": "is_opening",
"credit": "total_amount_to_pay",
"debit": "value:0",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"doctype": "GL Mapper Detail",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name"
"is_opening": "is_opening",
"voucher_no": "name",
"posting_date": "posting_date"
},
{
"account": "write_off_account",
"doctype": "GL Mapper Detail",
"company": "company",
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "credit_to",
"aging_date": "aging_date",
"credit": "write_off_amount",
"transaction_date": "voucher_date",
"voucher_type": "doctype",
"is_opening": "is_opening",
"credit": "write_off_amount",
"debit": "value:0",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"doctype": "GL Mapper Detail",
"remarks": "remarks",
"posting_date": "posting_date",
"is_opening": "is_opening",
"voucher_no": "name",
"cost_center": "write_off_cost_center"
"cost_center": "write_off_cost_center",
"posting_date": "posting_date"
}
]

View File

@@ -2,7 +2,7 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-04-30 19:55:04",
"creation": "2012-10-03 11:29:52",
"modified_by": "Administrator",
"modified": "2012-10-03 11:07:26"
},
@@ -29,11 +29,11 @@
"debit": "amount",
"fiscal_year": "parent:fiscal_year",
"against": "parent:credit_to",
"aging_date": "parent:aging_date",
"voucher_type": "parent:doctype",
"credit": "value:0",
"table_field": "entries",
"transaction_date": "parent:voucher_date",
"voucher_type": "parent:doctype",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
@@ -47,11 +47,11 @@
"debit": "value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0",
"fiscal_year": "parent:fiscal_year",
"against": "parent:credit_to",
"aging_date": "parent:aging_date",
"voucher_type": "parent:doctype",
"credit": "value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0",
"table_field": "purchase_tax_details",
"transaction_date": "parent:voucher_date",
"voucher_type": "parent:doctype",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
@@ -65,10 +65,10 @@
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "credit_to",
"aging_date": "aging_date",
"voucher_type": "doctype",
"credit": "ded_amount",
"transaction_date": "voucher_date",
"voucher_type": "doctype",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
@@ -77,16 +77,16 @@
{
"account": "credit_to",
"doctype": "GL Mapper Detail",
"credit": "total_amount_to_pay",
"against_voucher": "name",
"against_voucher_type": "value:'Purchase Invoice'",
"company": "company",
"debit": "value:0",
"fiscal_year": "fiscal_year",
"against": "against_expense_account",
"aging_date": "aging_date",
"against_voucher": "name",
"transaction_date": "voucher_date",
"voucher_type": "doctype",
"credit": "total_amount_to_pay",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",

View File

@@ -1 +1,81 @@
[{'doc_type': 'Sales Invoice', 'modified_by': 'Administrator', 'name': 'Sales Invoice', 'parent': None, 'creation': '2009-03-12 12:09:24', 'modified': '2010-05-17 08:59:14', 'module': 'Accounts', 'doctype': 'GL Mapper', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}, {'creation': '2009-03-12 12:09:24', 'voucher_type': 'parent:doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': 'cost_center', 'voucher_no': 'parent:name', 'modified_by': 'Administrator', 'against_voucher': None, 'table_field': 'entries', 'transaction_date': 'parent:voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Sales Invoice', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'income_account', 'name': 'GLMDetail00006', 'idx': 1, 'against_voucher_type': None, 'modified': '2010-05-17 08:59:14', 'against': 'parent:debit_to', 'credit': 'amount', 'parenttype': 'GL Mapper', 'is_opening': 'parent:is_opening', 'posting_date': 'parent:posting_date', 'parentfield': 'fields'}, {'creation': '2009-03-12 12:09:24', 'voucher_type': 'parent:doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': 'cost_center_other_charges', 'voucher_no': 'parent:name', 'modified_by': 'Administrator', 'against_voucher': None, 'table_field': 'other_charges', 'transaction_date': 'parent:voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Sales Invoice', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'account_head', 'name': 'GLMDetail00007', 'idx': 2, 'against_voucher_type': None, 'modified': '2010-05-17 08:59:14', 'against': 'parent:debit_to', 'credit': 'tax_amount', 'parenttype': 'GL Mapper', 'is_opening': 'parent:is_opening', 'posting_date': 'parent:posting_date', 'parentfield': 'fields'}, {'creation': '2009-03-12 12:09:24', 'voucher_type': 'doctype', 'doctype': 'GL Mapper Detail', 'owner': 'Administrator', 'cost_center': '', 'voucher_no': 'name', 'modified_by': 'Administrator', 'against_voucher': 'name', 'table_field': '', 'transaction_date': 'voucher_date', 'debit': 'grand_total', 'docstatus': 0, 'parent': 'Sales Invoice', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'debit_to', 'name': 'GLMDetail00008', 'idx': 3, 'against_voucher_type': "value:'Sales Invoice'", 'modified': '2010-05-17 08:59:14', 'against': 'against_income_account', 'credit': 'value:0', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}]
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2010-08-08 17:09:36",
"modified_by": "Administrator",
"modified": "2012-05-01 09:16:31"
},
{
"doc_type": "Receivable Voucher",
"name": "__common__",
"doctype": "GL Mapper"
},
{
"name": "__common__",
"parent": "Sales Invoice",
"doctype": "GL Mapper Detail",
"parenttype": "GL Mapper",
"parentfield": "fields"
},
{
"name": "Sales Invoice",
"doctype": "GL Mapper"
},
{
"account": "income_account",
"doctype": "GL Mapper Detail",
"company": "parent:company",
"debit": "value:0",
"fiscal_year": "parent:fiscal_year",
"against": "parent:debit_to",
"voucher_type": "parent:doctype",
"credit": "amount",
"table_field": "entries",
"transaction_date": "parent:voucher_date",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
"voucher_no": "parent:name",
"cost_center": "cost_center"
},
{
"account": "account_head",
"doctype": "GL Mapper Detail",
"company": "parent:company",
"debit": "value:0",
"fiscal_year": "parent:fiscal_year",
"against": "parent:debit_to",
"voucher_type": "parent:doctype",
"credit": "tax_amount",
"table_field": "other_charges",
"transaction_date": "parent:voucher_date",
"aging_date": "parent:aging_date",
"is_opening": "parent:is_opening",
"remarks": "parent:remarks",
"posting_date": "parent:posting_date",
"voucher_no": "parent:name",
"cost_center": "cost_center_other_charges"
},
{
"account": "debit_to",
"doctype": "GL Mapper Detail",
"credit": "value:0",
"against_voucher_type": "value:'Sales Invoice'",
"company": "company",
"debit": "grand_total",
"fiscal_year": "fiscal_year",
"against": "against_income_account",
"voucher_type": "doctype",
"against_voucher": "name",
"table_field": "",
"transaction_date": "voucher_date",
"aging_date": "aging_date",
"is_opening": "is_opening",
"remarks": "remarks",
"posting_date": "posting_date",
"voucher_no": "name",
"cost_center": ""
}
]

View File

@@ -20,11 +20,6 @@ from webnotes.utils import flt
from webnotes.model.code import get_obj
from accounts.utils import get_balance_on
install_docs = [
{"doctype":"Role", "role_name":"Accounts Manager", "name":"Accounts Manager"},
{"doctype":"Role", "role_name":"Accounts User", "name":"Accounts User"}
]
@webnotes.whitelist()
def get_default_bank_account():
"""

View File

@@ -2,20 +2,20 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-11-16 10:32:50",
"creation": "2013-01-17 12:30:10",
"modified_by": "Administrator",
"modified": "2012-12-03 11:26:49"
"modified": "2013-01-17 13:16:31"
},
{
"in_create": 1,
"allow_rename": 1,
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
"search_fields": "debit_or_credit, group_or_ledger",
"module": "Accounts",
"document_type": "Master",
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
"name": "__common__",
"allow_rename": 1,
"doctype": "DocType",
"allow_copy": 1
"allow_copy": 1,
"document_type": "Master",
"name": "__common__"
},
{
"name": "__common__",
@@ -28,8 +28,8 @@
"name": "__common__",
"parent": "Account",
"amend": 0,
"submit": 0,
"doctype": "DocPerm",
"submit": 0,
"read": 1,
"parenttype": "DocType",
"parentfield": "permissions"
@@ -139,32 +139,28 @@
"doctype": "DocField",
"label": "Parent Account",
"oldfieldname": "parent_account",
"trigger": "Client",
"options": "Account",
"fieldname": "parent_account",
"fieldtype": "Link",
"search_index": 1,
"options": "Account",
"permlevel": 0
},
{
"description": "Setting Account Type helps in selecting this Account in transactions.",
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Account Type",
"oldfieldname": "account_type",
"permlevel": 0,
"trigger": "Client",
"options": "\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable",
"fieldname": "account_type",
"fieldtype": "Select",
"search_index": 0,
"in_filter": 1,
"options": "\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable"
"permlevel": 0,
"in_filter": 1
},
{
"description": "Rate at which this tax is applied",
"oldfieldtype": "Currency",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Rate",
"oldfieldname": "tax_rate",
@@ -177,7 +173,6 @@
{
"description": "If the account is frozen, entries are allowed for the \"Account Manager\" only.",
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Frozen",
"oldfieldname": "freeze_account",
@@ -189,7 +184,6 @@
{
"print_hide": 1,
"oldfieldtype": "Int",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Credit Days",
"oldfieldname": "credit_days",
@@ -212,7 +206,6 @@
{
"description": "If this Account represents a Customer, Supplier or Employee, set it here.",
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Master Type",
"oldfieldname": "master_type",
@@ -226,98 +219,127 @@
"doctype": "DocField",
"label": "Master Name",
"oldfieldname": "master_name",
"trigger": "Client",
"options": "[Select]",
"fieldname": "master_name",
"fieldtype": "Link",
"options": "[Select]",
"permlevel": 0
},
{
"read_only": 1,
"print_hide": 1,
"doctype": "DocField",
"label": "Lft",
"fieldname": "lft",
"fieldtype": "Int",
"hidden": 1,
"permlevel": 0
},
{
"read_only": 1,
"print_hide": 1,
"doctype": "DocField",
"label": "Rgt",
"fieldname": "rgt",
"fieldtype": "Int",
"hidden": 1,
"permlevel": 0
},
{
"read_only": 1,
"print_hide": 1,
"doctype": "DocField",
"label": "Old Parent",
"fieldname": "old_parent",
"fieldtype": "Data",
"hidden": 1,
"permlevel": 0
},
{
"create": 0,
"doctype": "DocPerm",
"write": 1,
"cancel": 0,
"role": "Auditor",
"cancel": 0,
"permlevel": 0
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Auditor",
"cancel": 0,
"permlevel": 2
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Auditor",
"cancel": 0,
"permlevel": 1
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Sales User",
"cancel": 0,
"permlevel": 0
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Purchase User",
"cancel": 0,
"permlevel": 0
},
{
"create": 0,
"doctype": "DocPerm",
"write": 1,
"cancel": 0,
"role": "Accounts User",
"cancel": 0,
"permlevel": 0
},
{
"create": 1,
"doctype": "DocPerm",
"write": 1,
"cancel": 1,
"role": "Accounts Manager",
"cancel": 1,
"permlevel": 0
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Accounts User",
"cancel": 0,
"permlevel": 1
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Accounts Manager",
"cancel": 0,
"permlevel": 1
},
{
"create": 0,
"doctype": "DocPerm",
"write": 1,
"cancel": 0,
"role": "Accounts Manager",
"cancel": 0,
"permlevel": 2
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Accounts User",
"cancel": 0,
"permlevel": 2
}
]

View File

@@ -18,11 +18,7 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt, getdate
from webnotes.model.doc import make_autoname
from webnotes.model.wrapper import getlist, copy_doclist
from webnotes import msgprint
sql = webnotes.conn.sql
from webnotes.model.wrapper import getlist
class DocType:
def __init__(self,d,dl):
@@ -31,53 +27,57 @@ class DocType:
def autoname(self):
self.doc.name = make_autoname(self.doc.naming_series + '.#####')
def validate(self):
"""Validate invoice that c-form is applicable
and no other c-form is received for that"""
for d in getlist(self.doclist, 'invoice_details'):
inv = webnotes.conn.sql("""select c_form_applicable, c_form_no from
`tabSales Invoice` where name = %s""", d.invoice_no)
if not inv:
webnotes.msgprint("Invoice: %s is not exists in the system, please check." %
d.invoice_no, raise_exception=1)
elif inv[0][0] != 'Yes':
webnotes.msgprint("C-form is not applicable for Invoice: %s" %
d.invoice_no, raise_exception=1)
elif inv[0][1] and inv[0][1] != self.doc.name:
webnotes.msgprint("""Invoice %s is tagged in another C-form: %s.
If you want to change C-form no for this invoice,
please remove invoice no from the previous c-form and then try again""" %
(d.invoice_no, inv[0][1]), raise_exception=1)
def on_update(self):
""" Update C-Form No on invoices"""
if len(getlist(self.doclist, 'invoice_details')):
inv = "'" + "', '".join([d.invoice_no for d in getlist(self.doclist, 'invoice_details')]) + "'"
sql("""update `tabSales Invoice` set c_form_no = '%s', modified ='%s'
where name in (%s)"""%(self.doc.name, self.doc.modified, inv))
sql("""update `tabSales Invoice` set c_form_no = '', modified = %s where name not
in (%s) and ifnull(c_form_no, '') = %s""", (self.doc.modified, self.doc.name, inv))
inv = [d.invoice_no for d in getlist(self.doclist, 'invoice_details')]
if inv:
webnotes.conn.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s
where name in (%s)""" % ('%s', '%s', ', '.join(['%s'] * len(inv))),
tuple([self.doc.name, self.doc.modified] + inv))
webnotes.conn.sql("""update `tabSales Invoice` set c_form_no = '', modified = %s
where name not in (%s) and ifnull(c_form_no, '') = %s""" %
('%s', ', '.join(['%s']*len(inv)), '%s'),
tuple([self.doc.modified] + inv + [self.doc.name]))
else:
msgprint("Please enter atleast 1 invoice in the table below", raise_exception=1)
webnotes.msgprint("Please enter atleast 1 invoice in the table", raise_exception=1)
self.calculate_total_invoiced_amount()
self.set_total_invoiced_amount()
def calculate_total_invoiced_amount(self):
total = 0
for d in getlist(self.doclist, 'invoice_details'):
total += flt(d.grand_total)
def set_total_invoiced_amount(self):
total = sum([flt(d.total) for d in getlist(self.doclist, 'invoice_details')])
webnotes.conn.set(self.doc, 'total_invoiced_amount', total)
def get_invoice_details(self, invoice_no):
""" Pull details from invoices for referrence """
inv = sql("""select posting_date, territory, net_total, grand_total from
`tabSales Invoice` where name = %s""", invoice_no)
ret = {
inv = webnotes.conn.sql("""select posting_date, territory, net_total, grand_total
from `tabSales Invoice` where name = %s""", invoice_no)
return {
'invoice_date' : inv and getdate(inv[0][0]).strftime('%Y-%m-%d') or '',
'territory' : inv and inv[0][1] or '',
'net_total' : inv and flt(inv[0][2]) or '',
'grand_total' : inv and flt(inv[0][3]) or ''
}
return ret
def validate_invoice(self):
"""Validate invoice that c-form is applicable and no other c-form is
received for that"""
for d in getlist(self.doclist, 'invoice_details'):
inv = sql("""select c_form_applicable, c_form_no from
`tabSales Invoice` where name = %s""", invoice_no)
if not inv:
msgprint("Invoice: %s is not exists in the system, please check." % d.invoice_no, raise_exception=1)
elif inv[0][0] != 'Yes':
msgprint("C-form is not applicable for Invoice: %s" % d.invoice_no, raise_exception=1)
elif inv[0][1] and inv[0][1] != self.doc.name:
msgprint("""Invoice %s is tagged in another C-form: %s. \nIf you want to change C-form no for this invoice,
please remove invoice no from the previous c-form and then try again""" % (d.invoice_no, inv[0][1]), raise_exception=1)
}

View File

@@ -46,9 +46,6 @@ class DocType:
return flt(bal)
# Add a new account
# -----------------
def add_ac(self,arg):
arg = eval(arg)
ac = Document('Account')
@@ -104,20 +101,28 @@ class DocType:
# Make a dictionary(le) for every gl entry and append to a list(self.entries)
#----------------------------------------------------------------------------
def make_single_entry(self,parent,d,le_map,cancel, merge_entries):
if self.get_val(le_map['account'], d, parent) and (self.get_val(le_map['debit'], d, parent) or self.get_val(le_map['credit'], d, parent)):
flist = ['account','cost_center','against','debit','credit','remarks','voucher_type','voucher_no','posting_date','fiscal_year','against_voucher','against_voucher_type','company','is_opening', 'aging_date']
if self.get_val(le_map['account'], d, parent) and \
(self.get_val(le_map['debit'], d, parent) \
or self.get_val(le_map['credit'], d, parent)):
flist = ['account', 'cost_center', 'against', 'debit', 'credit', 'remarks',
'voucher_type', 'voucher_no', 'posting_date', 'fiscal_year', 'against_voucher',
'against_voucher_type', 'company', 'is_opening', 'aging_date']
# Check budget before gl entry
#check budget only if account is expense account
is_expense_acct = webnotes.conn.sql("select name from tabAccount where is_pl_account='Yes' and debit_or_credit='Debit' and name=%s",self.get_val(le_map['account'], d, parent))
is_expense_acct = webnotes.conn.sql("""select name from tabAccount
where is_pl_account='Yes' and debit_or_credit='Debit'
and name=%s""",self.get_val(le_map['account'], d, parent))
if is_expense_acct and self.get_val(le_map['cost_center'], d, parent):
get_obj('Budget Control').check_budget([self.get_val(le_map[k], d, parent) for k in flist if k in ['account','cost_center','debit','credit','posting_date','fiscal_year','company']],cancel)
get_obj('Budget Control').check_budget([self.get_val(le_map[k], d, parent)
for k in flist if k in ['account', 'cost_center', 'debit',
'credit', 'posting_date', 'fiscal_year', 'company']],cancel)
# Create new GL entry object and map values
le = Document('GL Entry')
for k in flist:
le.fields[k] = self.get_val(le_map[k], d, parent)
# if there is already an entry in this account then just add it to that entry
same_head = self.check_if_in_list(le)
if same_head and merge_entries:
@@ -126,6 +131,7 @@ class DocType:
same_head.credit = flt(same_head.credit) + flt(le.credit)
else:
self.entries.append(le)
def manage_debit_credit(self, cancel):
total_debit, total_credit = 0, 0
@@ -183,7 +189,9 @@ class DocType:
if le_map['table_field']:
for d in getlist(doclist,le_map['table_field']):
# purchase_tax_details is the table of other charges in purchase cycle
if le_map['table_field'] != 'purchase_tax_details' or (le_map['table_field'] == 'purchase_tax_details' and d.fields.get('category') != 'Valuation'):
if le_map['table_field'] != 'purchase_tax_details' or \
(le_map['table_field'] == 'purchase_tax_details' and \
d.fields.get('category') != 'Valuation'):
self.make_single_entry(doc,d,le_map,cancel, merge_entries)
else:
self.make_single_entry(None,doc,le_map,cancel, merge_entries)
@@ -191,8 +199,6 @@ class DocType:
# save entries
self.save_entries(cancel, adv_adj, update_outstanding)
# set as cancelled
if cancel:
vt = self.get_val(le_map['voucher_type'], doc, doc)
@@ -209,7 +215,7 @@ class DocType:
and (t2.against_invoice is null or t2.against_invoice = '')
and (t2.against_jv is null or t2.against_jv = '')
and t2.account = '%s' and t2.is_advance = 'Yes' and t1.docstatus = 1
order by t1.voucher_date """ % (dr_or_cr,account_head))
order by t1.posting_date""" % (dr_or_cr,account_head))
# clear advance table
obj.doclist = obj.doc.clear_table(obj.doclist,table_field_name)
# Create advance table
@@ -300,9 +306,6 @@ class DocType:
return
######################################################################################################################
#------------------------------------------
def reconcile_against_document(self, args):
"""
Cancel JV, Update aginst document, split if required and resubmit jv
@@ -330,7 +333,6 @@ class DocType:
jv_obj = get_obj('Journal Voucher', d['voucher_no'], with_children =1)
self.make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel = 0, adv_adj =1)
#------------------------------------------
def update_against_doc(self, d, jv_obj):
"""
Updates against document, if partial amount splits into rows
@@ -338,9 +340,10 @@ class DocType:
webnotes.conn.sql("""
update `tabJournal Voucher Detail` t1, `tabJournal Voucher` t2
set t1.%(dr_or_cr)s = '%(allocated_amt)s', t1.%(against_fld)s = '%(against_voucher)s', t2.modified = now()
set t1.%(dr_or_cr)s = '%(allocated_amt)s',
t1.%(against_fld)s = '%(against_voucher)s', t2.modified = now()
where t1.name = '%(voucher_detail_no)s' and t1.parent = t2.name""" % d)
if d['allocated_amt'] < d['unadjusted_amt']:
jvd = webnotes.conn.sql("select cost_center, balance, against_account, is_advance from `tabJournal Voucher Detail` where name = '%s'" % d['voucher_detail_no'])
# new entry with balance amount
@@ -355,7 +358,6 @@ class DocType:
ch.docstatus = 1
ch.save(1)
#------------------------------------------
def check_if_jv_modified(self, args):
"""
check if there is already a voucher reference

View File

@@ -15,8 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
cur_frm.cscript.onload = function(doc, cdt, cdn) {
if (!doc.voucher_date) doc.voucher_date = dateutil.obj_to_str(new Date());
cur_frm.cscript.load_defaults(doc, cdt, cdn);
}

View File

@@ -2,14 +2,14 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-03 17:26:38",
"creation": "2013-01-17 12:30:11",
"modified_by": "Administrator",
"modified": "2012-12-04 18:47:42"
"modified": "2013-01-17 14:27:43"
},
{
"is_submittable": 1,
"autoname": "naming_series:",
"name": "__common__",
"is_submittable": 1,
"search_fields": "voucher_type,posting_date, due_date, cheque_no",
"module": "Accounts",
"doctype": "DocType",
@@ -47,7 +47,6 @@
"description": "To manage multiple series please go to Setup > Manage Series",
"no_copy": 1,
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Series",
"oldfieldname": "naming_series",
@@ -103,8 +102,8 @@
},
{
"print_hide": 0,
"allow_on_submit": 1,
"oldfieldtype": "Table",
"allow_on_submit": 1,
"doctype": "DocField",
"label": "Entries",
"oldfieldname": "entries",
@@ -163,7 +162,6 @@
"oldfieldtype": "Button",
"doctype": "DocField",
"label": "Make Difference Entry",
"trigger": "Client",
"fieldname": "get_balance",
"fieldtype": "Button",
"permlevel": 0
@@ -179,15 +177,14 @@
"description": "eg. Cheque Number",
"no_copy": 1,
"oldfieldtype": "Data",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Reference Number",
"oldfieldname": "cheque_no",
"fieldname": "cheque_no",
"fieldtype": "Data",
"search_index": 1,
"in_filter": 1,
"permlevel": 0
"permlevel": 0,
"in_filter": 1
},
{
"no_copy": 1,
@@ -291,12 +288,10 @@
"print_hide": 1,
"default": "No",
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Is Opening",
"oldfieldname": "is_opening",
"permlevel": 0,
"trigger": "Client",
"fieldname": "is_opening",
"fieldtype": "Select",
"search_index": 1,
@@ -308,7 +303,6 @@
"description": "For opening invoice entry, this date will reflect in the period-wise aging report.",
"no_copy": 0,
"oldfieldtype": "Date",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Aging Date",
"oldfieldname": "aging_date",
@@ -320,7 +314,6 @@
"print_hide": 1,
"default": "Accounts Receivable",
"depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Write Off Based On",
"options": "Accounts Receivable\nAccounts Payable",
@@ -332,7 +325,6 @@
{
"print_hide": 1,
"depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Write Off Amount <=",
"fieldname": "write_off_amount",
@@ -343,30 +335,11 @@
{
"print_hide": 1,
"depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Get Outstanding Invoices",
"trigger": "Server",
"options": "get_outstanding_invoices",
"fieldname": "get_outstanding_invoices",
"fieldtype": "Button",
"options": "get_outstanding_invoices",
"permlevel": 0
},
{
"print_hide": 0,
"description": "Date of entry (not posting to ledgers)",
"default": "Today",
"oldfieldtype": "Date",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Voucher Date",
"oldfieldname": "voucher_date",
"no_copy": 1,
"fieldname": "voucher_date",
"fieldtype": "Date",
"search_index": 1,
"reqd": 1,
"in_filter": 1,
"permlevel": 0
},
{
@@ -442,13 +415,11 @@
"print_hide": 1,
"no_copy": 1,
"oldfieldtype": "Link",
"colour": "White:FFF",
"allow_on_submit": 1,
"doctype": "DocField",
"label": "Select Print Heading",
"oldfieldname": "select_print_heading",
"permlevel": 0,
"trigger": "Client",
"fieldname": "select_print_heading",
"fieldtype": "Link",
"options": "Print Heading",
@@ -493,16 +464,14 @@
"print_hide": 1,
"no_copy": 1,
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Supplier Account",
"oldfieldname": "supplier_account",
"permlevel": 0,
"trigger": "Client",
"options": "Account",
"fieldname": "supplier_account",
"fieldtype": "Link",
"hidden": 0,
"options": "Account"
"permlevel": 0
},
{
"amend": 1,
@@ -510,8 +479,8 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"cancel": 1,
"role": "Accounts User",
"cancel": 1,
"permlevel": 0
},
{
@@ -520,8 +489,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Accounts User",
"cancel": 0,
"permlevel": 1
},
{
@@ -530,8 +499,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Accounts Manager",
"cancel": 0,
"permlevel": 1
},
{
@@ -540,8 +509,8 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"cancel": 1,
"role": "Accounts Manager",
"cancel": 1,
"permlevel": 0
},
{
@@ -550,8 +519,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Auditor",
"cancel": 0,
"permlevel": 0
},
{
@@ -560,8 +529,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Auditor",
"cancel": 0,
"permlevel": 1
}
]

View File

@@ -18,40 +18,37 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
from webnotes.model import db_exists
from webnotes.model.doc import addchild
from webnotes.model.wrapper import getlist, copy_doclist
from webnotes.model.wrapper import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint
sql = webnotes.conn.sql
class DocType:
def __init__(self, doc, doclist):
self.doc = doc
self.doclist = doclist
self.acc_type = self.doc.account and sql("select debit_or_credit from `tabAccount` where name = %s", self.doc.account)[0][0].lower() or ''
self.acc_type = self.doc.account and webnotes.conn.sql("""select debit_or_credit
from `tabAccount` where name = %s""", self.doc.account)[0][0].lower() or ''
self.dt = {
'Sales Invoice': 'Sales Invoice',
'Purchase Invoice': 'Purchase Invoice',
'Journal Voucher': 'Journal Voucher'
}
#--------------------------------------------------
def get_voucher_details(self):
tot_amt = sql("""
tot_amt = webnotes.conn.sql("""
select sum(%s) from `tabGL Entry` where
voucher_type = %s and voucher_no = %s
and account = %s and ifnull(is_cancelled, 'No') = 'No'
"""% (self.acc_type, '%s', '%s', '%s'), (self.dt[self.doc.voucher_type], self.doc.voucher_no, self.doc.account))
and account = %s and ifnull(is_cancelled, 'No') = 'No'""" %
(self.acc_type, '%s', '%s', '%s'),
(self.dt[self.doc.voucher_type], self.doc.voucher_no, self.doc.account))
outstanding = sql("""
outstanding = webnotes.conn.sql("""
select sum(%s) - sum(%s) from `tabGL Entry` where
against_voucher = %s and voucher_no != %s
and account = %s and ifnull(is_cancelled, 'No') = 'No'
""" % ((self.acc_type == 'debit' and 'credit' or 'debit'), self.acc_type, '%s', '%s', '%s'), (self.doc.voucher_no, self.doc.voucher_no, self.doc.account))
and account = %s and ifnull(is_cancelled, 'No') = 'No'""" %
((self.acc_type == 'debit' and 'credit' or 'debit'), self.acc_type, '%s', '%s', '%s'),
(self.doc.voucher_no, self.doc.voucher_no, self.doc.account))
ret = {
'total_amount': flt(tot_amt[0][0]) or 0,
@@ -60,8 +57,6 @@ class DocType:
return ret
#--------------------------------------------------
def get_payment_entries(self):
"""
Get payment entries for the account and period
@@ -72,7 +67,6 @@ class DocType:
gle = self.get_gl_entries()
self.create_payment_table(gle)
#--------------------------------------------------
def get_gl_entries(self):
self.validate_mandatory()
dc = self.acc_type == 'debit' and 'credit' or 'debit'
@@ -80,41 +74,40 @@ class DocType:
cond = self.doc.from_date and " and t1.posting_date >= '" + self.doc.from_date + "'" or ""
cond += self.doc.to_date and " and t1.posting_date <= '" + self.doc.to_date + "'"or ""
cond += self.doc.amt_greater_than and ' and t2.' + dc+' >= ' + self.doc.amt_greater_than or ''
cond += self.doc.amt_less_than and ' and t2.' + dc+' <= ' + self.doc.amt_less_than or ''
cond += self.doc.amt_greater_than and \
' and t2.' + dc+' >= ' + self.doc.amt_greater_than or ''
cond += self.doc.amt_less_than and \
' and t2.' + dc+' <= ' + self.doc.amt_less_than or ''
gle = sql("""
select t1.name as voucher_no, t1.posting_date, t1.total_debit as total_amt, sum(ifnull(t2.credit, 0)) - sum(ifnull(t2.debit, 0)) as amt_due, t1.remark, t2.against_account, t2.name as voucher_detail_no
gle = webnotes.conn.sql("""
select t1.name as voucher_no, t1.posting_date, t1.total_debit as total_amt,
sum(ifnull(t2.credit, 0)) - sum(ifnull(t2.debit, 0)) as amt_due, t1.remark,
t2.against_account, t2.name as voucher_detail_no
from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2
where t1.name = t2.parent
and t1.docstatus = 1
and t2.account = %s
and ifnull(t2.against_voucher, '')='' and ifnull(t2.against_invoice, '')='' and ifnull(t2.against_jv, '')=''
and t2.%s > 0
%s
group by t1.name, t2.name
"""% ('%s', dc, cond), self.doc.account, as_dict=1)
where t1.name = t2.parent and t1.docstatus = 1 and t2.account = %s
and ifnull(t2.against_voucher, '')='' and ifnull(t2.against_invoice, '')=''
and ifnull(t2.against_jv, '')='' and t2.%s > 0 %s group by t1.name, t2.name """ %
('%s', dc, cond), self.doc.account, as_dict=1)
return gle
#--------------------------------------------------
def create_payment_table(self, gle):
for d in gle:
ch = addchild(self.doc, 'ir_payment_details', 'Payment to Invoice Matching Tool Detail', self.doclist)
ch = addchild(self.doc, 'ir_payment_details',
'Payment to Invoice Matching Tool Detail', self.doclist)
ch.voucher_no = d.get('voucher_no')
ch.posting_date = d.get('posting_date')
ch.amt_due = self.acc_type == 'debit' and flt(d.get('amt_due')) or -1*flt(d.get('amt_due'))
ch.amt_due = self.acc_type == 'debit' and flt(d.get('amt_due')) \
or -1*flt(d.get('amt_due'))
ch.total_amt = flt(d.get('total_amt'))
ch.against_account = d.get('against_account')
ch.remarks = d.get('remark')
ch.voucher_detail_no = d.get('voucher_detail_no')
#--------------------------------------------------
def validate_mandatory(self):
if not self.doc.account:
msgprint("Please select Account first", raise_exception=1)
#--------------------------------------------------
def reconcile(self):
"""
Links booking and payment voucher
@@ -122,7 +115,8 @@ class DocType:
2. split into multiple rows if partially adjusted, assign against voucher
3. submit payment voucher
"""
if not self.doc.voucher_no or not sql("select name from `tab%s` where name = %s" %(self.dt[self.doc.voucher_type], '%s'), self.doc.voucher_no):
if not self.doc.voucher_no or not webnotes.conn.sql("""select name from `tab%s`
where name = %s""" % (self.dt[self.doc.voucher_type], '%s'), self.doc.voucher_no):
msgprint("Please select valid Voucher No to proceed", raise_exception=1)
lst = []
@@ -142,7 +136,6 @@ class DocType:
lst.append(args)
if lst:
get_obj('GL Control').reconcile_against_document(lst)
msgprint("Successfully allocated.")

View File

@@ -43,7 +43,6 @@ $.extend(cur_frm.cscript, new_cscript);
cur_frm.cscript.onload = function(doc,dt,dn) {
if(!doc.voucher_date) set_multiple(dt,dn,{voucher_date:get_today()});
if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});
}

View File

@@ -31,7 +31,6 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js');
cur_frm.cscript.onload = function(doc,dt,dn) {
if(!doc.customer && doc.debit_to) wn.meta.get_docfield(dt, 'debit_to', dn).print_hide = 0;
if (doc.__islocal) {
//if(!doc.voucher_date) set_multiple(dt,dn,{voucher_date:get_today()});
if(!doc.due_date) set_multiple(dt,dn,{due_date:get_today()});
if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});
if(!doc.currency && sys_defaults.currency) set_multiple(dt,dn,{currency:sys_defaults.currency});

View File

@@ -1,17 +0,0 @@
[
"Trial Balance",
"Voucher Import Tool",
"Track separate Income and Expense for product verticals or divisions.",
"Delivered Items To Be Billed",
"Heads (or groups) against which Accounting Entries are made and balances are maintained.",
"Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.#### NoteThe 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.#### Description of Columns1. Calculation Type: - This can be on **Net Total** (that is the sum of basic amount). - **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. - **Actual** (as mentioned).2. Account Head: The Account ledger under which this tax will be booked3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.4. Description: Description of the tax (that will be printed in invoices / quotes).5. Rate: Tax rate.6. Amount: Tax amount.7. Total: Cumulative total to this point.8. 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).9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.",
"Financial Statements",
"General Ledger",
"**Budget Distribution** helps you distribute your budget across months if you have seasonality in your business.To distribute a budget using this distribution, set this **Budget Distribution** in the **Cost Center**",
"Accounts Home",
"Ordered Items To Be Billed",
"**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
"Financial Analytics",
"Accounts Browser",
"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.#### NoteThe 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.#### Description of Columns1. Calculation Type: - This can be on **Net Total** (that is the sum of basic amount). - **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. - **Actual** (as mentioned).2. Account Head: The Account ledger under which this tax will be booked3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.4. Description: Description of the tax (that will be printed in invoices / quotes).5. Rate: Tax rate.6. Amount: Tax amount.7. Total: Cumulative total to this point.8. 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).9. 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.10. Add or Deduct: Whether you want to add or deduct the tax."
]

File diff suppressed because one or more lines are too long

View File

@@ -9,7 +9,6 @@
{
"name": "__common__",
"module": "Accounts",
"show_in_menu": 0,
"page_name": "Accounts Browser",
"doctype": "Page",
"standard": "Yes"

View File

@@ -9,7 +9,6 @@
{
"name": "__common__",
"module": "Accounts",
"show_in_menu": 0,
"page_name": "Financial Statements",
"doctype": "Page",
"standard": "Yes"

View File

@@ -45,7 +45,7 @@ report.get_query = function() {
date_fld = 'transaction_date';
if(based_on == 'Sales Invoice') {
based_on = 'Sales Invoice';
date_fld = 'voucher_date';
date_fld = 'posting_date';
}
sp_cond = '';