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
commit ef02ddfc40
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 = '';

View File

@ -1,7 +0,0 @@
from __future__ import unicode_literals
install_docs = [
{"doctype":"Role", "role_name":"Purchase Manager", "name":"Purchase Manager"},
{"doctype":"Role", "role_name":"Purchase User", "name":"Purchase User"},
{"doctype":"Role", "role_name":"Purchase Master Manager", "name":"Purchase Master Manager"},
{"doctype":"Role", "role_name":"Supplier", "name":"Supplier"}
]

View File

@ -85,7 +85,14 @@ class DocType(TransactionBase):
return g
def add_account(self, ac, par, abbr):
arg = {'account_name':ac,'parent_account':par, 'group_or_ledger':'Group', 'company':self.doc.company,'account_type':'','tax_rate':'0'}
arg = {
'account_name':ac,
'parent_account':par,
'group_or_ledger':'Group',
'company':self.doc.company,
'account_type':'',
'tax_rate':'0'
}
t = get_obj('GL Control').add_ac(cstr(arg))
msgprint("Created Group " + t)

View File

@ -1,5 +0,0 @@
[
"Supplier of Goods or Services.",
"Buying Home",
"Purchase Analytics"
]

View File

@ -1,5 +0,0 @@
{
"Buying Home": "\u0918\u0930 \u0916\u0930\u0940\u0926\u0928\u093e",
"Purchase Analytics": "\u0916\u0930\u0940\u0926 \u0935\u093f\u0936\u094d\u0932\u0947\u0937\u093f\u0915\u0940",
"Supplier of Goods or Services.": "\u0938\u093e\u092e\u093e\u0928 \u092f\u093e \u0938\u0947\u0935\u093e\u0913\u0902 \u0915\u0940 \u092a\u094d\u0930\u0926\u093e\u092f\u0915."
}

View File

@ -1,9 +0,0 @@
[
"Event Updates",
"My Company",
"Desktop",
"Attributions",
"dashboard",
"Activity",
"Latest Updates"
]

View File

@ -1,9 +0,0 @@
{
"Activity": "\u0938\u0915\u094d\u0930\u093f\u092f\u0924\u093e",
"Attributions": "Attributions",
"Desktop": "\u0921\u0947\u0938\u094d\u0915\u091f\u0949\u092a",
"Event Updates": "\u0918\u091f\u0928\u093e \u0905\u0926\u094d\u092f\u0924\u0928",
"Latest Updates": "\u0928\u0935\u0940\u0928\u0924\u092e \u0905\u0926\u094d\u092f\u0924\u0928",
"My Company": "\u092e\u0947\u0930\u0940 \u0915\u0902\u092a\u0928\u0940",
"dashboard": "\u0921\u0948\u0936\u092c\u094b\u0930\u094d\u0921"
}

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Income Tax', 'parent': None, 'description': 'Income Tax', 'creation': '2010-04-02 10:33:23', 'is_active': 'Yes', 'modified': '2010-04-05 12:53:07', 'module': 'Payroll', 'doctype': 'Deduction Type', 'idx': None, 'parenttype': None, 'deduction_name': 'Income Tax', 'trash_reason': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Professional Tax', 'parent': None, 'description': 'Professional Tax', 'creation': '2010-04-02 10:34:14', 'is_active': 'Yes', 'modified': '2010-04-05 12:52:59', 'module': 'Payroll', 'doctype': 'Deduction Type', 'idx': None, 'parenttype': None, 'deduction_name': 'Professional Tax', 'trash_reason': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Provident Fund', 'parent': None, 'description': 'Provident fund', 'creation': '2010-04-02 10:32:23', 'is_active': 'Yes', 'modified': '2010-04-05 12:52:52', 'module': 'Payroll', 'doctype': 'Deduction Type', 'idx': None, 'parenttype': None, 'deduction_name': 'Provident Fund', 'trash_reason': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Basic', 'parent': None, 'description': 'Basic', 'creation': '2010-04-02 10:29:08', 'is_active': 'Yes', 'modified': '2010-04-05 12:52:35', 'earning_name': 'Basic', 'doctype': 'Earning Type', 'taxable': 'Yes', 'idx': None, 'parenttype': None, 'trash_reason': None, 'module': 'Payroll', 'exemption_limit': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'House Rent Allowance', 'parent': None, 'description': 'House Rent Allowance', 'creation': '2010-04-02 10:29:29', 'is_active': 'Yes', 'modified': '2010-04-05 12:33:19', 'earning_name': 'House Rent Allowance', 'doctype': 'Earning Type', 'taxable': 'No', 'idx': None, 'parenttype': None, 'trash_reason': None, 'module': 'Payroll', 'exemption_limit': None, 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Calls', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:38', 'modified': '2010-08-23 18:26:38', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Calls', 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Food', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:30', 'modified': '2010-08-23 18:26:30', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Food', 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Medical', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:49', 'modified': '2010-08-23 18:26:49', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Medical', 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Others', 'parent': None, 'description': None, 'creation': '2010-09-20 12:16:45', 'modified': '2010-09-20 12:16:45', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Others', 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Travel', 'parent': None, 'description': None, 'creation': '2010-09-20 12:16:45', 'modified': '2010-09-20 12:16:45', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Travel', 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'leave_type_name': 'Casual Leave', 'modified_by': 'Administrator', 'name': 'Casual Leave', 'parent': None, 'is_encash': 1, 'creation': '2010-04-02 10:52:32', 'is_active': 'Yes', 'modified': '2010-04-02 10:52:32', 'is_carry_forward': 1, 'doctype': 'Leave Type', 'max_days_allowed': '3', 'idx': None, 'parenttype': None, 'trash_reason': None, 'module': 'Payroll', 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'leave_type_name': 'Compensatory Off', 'modified_by': 'Administrator', 'name': 'Compensatory Off', 'parent': None, 'is_encash': None, 'creation': '2010-04-02 10:59:30', 'is_active': 'Yes', 'modified': '2010-04-02 10:59:30', 'is_carry_forward': None, 'doctype': 'Leave Type', 'max_days_allowed': None, 'idx': None, 'parenttype': None, 'trash_reason': None, 'module': 'Payroll', 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'leave_type_name': 'Leave Without Pay', 'modified_by': 'Administrator', 'name': 'Leave Without Pay', 'parent': None, 'is_encash': None, 'creation': '2010-04-02 10:57:37', 'is_active': 'Yes', 'modified': '2010-04-02 10:57:37', 'is_carry_forward': None, 'doctype': 'Leave Type', 'max_days_allowed': None, 'idx': None, 'parenttype': None, 'trash_reason': None, 'module': 'Payroll', 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'leave_type_name': 'Privilege Leave', 'modified_by': 'Administrator', 'name': 'Privilege Leave', 'parent': None, 'is_encash': 1, 'creation': '2010-04-02 10:53:16', 'is_active': 'Yes', 'modified': '2010-04-02 10:53:16', 'is_carry_forward': None, 'doctype': 'Leave Type', 'max_days_allowed': None, 'idx': None, 'parenttype': None, 'trash_reason': None, 'module': 'Payroll', 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'leave_type_name': 'Sick Leave', 'modified_by': 'Administrator', 'name': 'Sick Leave', 'parent': None, 'is_encash': None, 'creation': '2010-04-02 10:54:12', 'is_active': 'Yes', 'modified': '2010-04-02 10:54:12', 'is_carry_forward': None, 'doctype': 'Leave Type', 'max_days_allowed': None, 'idx': None, 'parenttype': None, 'trash_reason': None, 'module': 'Payroll', 'owner': 'Administrator', 'docstatus': 0, 'parentfield': None}]

View File

@ -1,8 +0,0 @@
from __future__ import unicode_literals
install_docs = [
{"doctype":"Role", "role_name":"Employee", "name":"Employee"},
{"doctype":"Role", "role_name":"HR Manager", "name":"HR Manager"},
{"doctype":"Role", "role_name":"HR User", "name":"HR User"},
{"doctype":"Role", "role_name":"Leave Approver", "name":"Leave Approver"},
{"doctype":"Role", "role_name":"Expense Approver", "name":"Expense Approver"},
]

View File

@ -1,4 +0,0 @@
[
"Apply / Approve Leaves",
"Human Resources Home"
]

View File

@ -1,4 +0,0 @@
{
"Apply / Approve Leaves": "\u092a\u0924\u094d\u0924\u093f\u092f\u093e\u0902 \u0932\u093e\u0917\u0942 / \u0938\u094d\u0935\u0940\u0915\u0943\u0924",
"Human Resources Home": "\u092e\u093e\u0928\u0935 \u0939\u094b\u092e \u0938\u0902\u0938\u093e\u0927\u0928"
}

View File

@ -1,5 +0,0 @@
from __future__ import unicode_literals
install_docs = [
{"doctype":"Role", "role_name":"Manufacturing Manager", "name":"Manufacturing Manager"},
{"doctype":"Role", "role_name":"Manufacturing User", "name":"Manufacturing User"},
]

View File

@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-20 18:14:55",
"creation": "2013-01-16 14:48:56",
"modified_by": "Administrator",
"modified": "2012-12-24 19:37:34"
"modified": "2013-01-17 11:21:46"
},
{
"istable": 1,

View File

@ -16,7 +16,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt, nowdate
from webnotes.utils import cstr, flt, cint, nowdate, add_days
from webnotes.model.doc import addchild, Document
from webnotes.model.wrapper import getlist
from webnotes.model.code import get_obj
@ -275,7 +275,6 @@ class DocType:
and bom_item.item_code = item.name
group by item_code
""", (flt(bom_dict[bom]), bom))
self.make_items_dict(fl_bom_items)
def make_items_dict(self, item_list):
@ -301,60 +300,82 @@ class DocType:
return item_list
def raise_purchase_request(self):
def _get_projected_qty(items):
item_projected_qty = webnotes.conn.sql("""select item_code, sum(projected_qty)
from `tabBin` where item_code in (%s) group by item_code""" %
(", ".join(["%s"]*len(items)),), tuple(items))
return dict(item_projected_qty)
"""
Raise Purchase Request if projected qty is less than qty required
Requested qty should be shortage qty considering minimum order qty
"""
if not self.doc.purchase_request_for_warehouse:
webnotes.msgprint("Please enter Warehouse for which Purchase Request will be raised",
raise_exception=1)
item_dict = self.get_raw_materials()
item_projected_qty = _get_projected_qty(item_dict.keys())
bom_dict = self.get_distinct_items_and_boms()[0]
self.get_raw_materials(bom_dict)
item_projected_qty = self.get_projected_qty()
from accounts.utils import get_fiscal_year
fiscal_year = get_fiscal_year(nowdate())
fiscal_year = get_fiscal_year(nowdate())[0]
items_to_be_requested = []
for item in item_dict:
if flt(item_dict[item][0]) > item_projected_qty[item]:
items_to_be_requested = webnotes._dict()
for item in self.item_dict:
if flt(self.item_dict[item][0]) > item_projected_qty[item]:
# shortage
requested_qty = flt(item_dict[item][0]) - item_projected_qty[item]
requested_qty = flt(self.item_dict[item][0]) - item_projected_qty[item]
# comsider minimum order qty
requested_qty = requested_qty > flt(item_dict[item][3]) and \
requested_qty or flt(item_dict[item][3])
items_to_be_requested.append({
"item_code": item,
"qty": requested_qty,
"description": item_dict[item][1],
"stock_uom": item_dict[item][2]
})
webnotes.errprint(items_to_be_requested)
self.insert_purchase_request(items_to_be_requested, fiscal_year)
requested_qty = requested_qty > flt(self.item_dict[item][3]) and \
requested_qty or flt(self.item_dict[item][3])
items_to_be_requested[item] = requested_qty
def insert_purchase_request(self, items, fiscal_year):
for item in items:
item_wrapper = webnotes.model_wrapper("Item", args.item_code)
pr = [
{
"doctype": "Purchase Request",
"naming_series": "IDT",
"transaction_date": nowdate(),
"status": "Draft",
"company": self.doc.company,
"fiscal_year": fiscal_year,
"requested_by": webnotes.session.user,
"remark": "Automatically raised from Production Planning Tool"
},
{
"doctype": "Purchase Request Item",
"item_code": item.item_code,
"item_name": item_wrapper.doc.item_name,
"description": item.description,
"uom": item.stock_uom,
"item_group": item_wrapper.doc.item_group,
"brand": item_wrapper.doc.brand,
"qty": item.qty,
}
]
self.insert_purchase_request(items_to_be_requested, fiscal_year)
def get_projected_qty(self):
items = self.item_dict.keys()
item_projected_qty = webnotes.conn.sql("""select item_code, sum(projected_qty)
from `tabBin` where item_code in (%s) group by item_code""" %
(", ".join(["%s"]*len(items)),), tuple(items))
return dict(item_projected_qty)
def insert_purchase_request(self, items_to_be_requested, fiscal_year):
purchase_request_list = []
if items_to_be_requested:
for item in items_to_be_requested:
item_wrapper = webnotes.model_wrapper("Item", item)
pr_doclist = [
{
"doctype": "Purchase Request",
"__islocal": 1,
"naming_series": "IDT",
"transaction_date": nowdate(),
"status": "Draft",
"company": self.doc.company,
"fiscal_year": fiscal_year,
"requested_by": webnotes.session.user,
"remark": "Automatically raised from Production Planning Tool"
},
{
"doctype": "Purchase Request Item",
"__islocal": 1,
"parentfield": "indent_details",
"item_code": item,
"item_name": item_wrapper.doc.item_name,
"description": item_wrapper.doc.description,
"uom": item_wrapper.doc.stock_uom,
"item_group": item_wrapper.doc.item_group,
"brand": item_wrapper.doc.brand,
"qty": items_to_be_requested[item],
"schedule_date": add_days(nowdate(), cint(item_wrapper.doc.lead_time_days)),
"warehouse": self.doc.purchase_request_for_warehouse
}
]
pr_wrapper = webnotes.model_wrapper(pr_doclist)
pr_wrapper.ignore_permissions = 1
pr_wrapper.submit()
purchase_request_list.append(pr_wrapper.doc.name)
if purchase_request_list:
pur_req = ["""<a href="#Form/Purchase Request/%s" target="_blank">%s</a>""" % \
(p, p) for p in purchase_request_list]
webnotes.msgprint("Following Purchase Request created successfully: \n%s" %
"\n".join(pur_req))
else:
webnotes.msgprint("Nothing to request")

View File

@ -4,7 +4,7 @@
"docstatus": 0,
"creation": "2013-01-16 14:48:56",
"modified_by": "Administrator",
"modified": "2013-01-16 15:46:26"
"modified": "2013-01-17 11:39:55"
},
{
"read_only": 1,
@ -199,7 +199,14 @@
"fieldtype": "Column Break"
},
{
"description": "Raise Purchase Request automatically for items which are \"Out of Stock\" considering already requested, already ordered qty and minimum order qty",
"doctype": "DocField",
"label": "Purchase Request For Warehouse",
"fieldname": "purchase_request_for_warehouse",
"fieldtype": "Link",
"options": "Warehouse"
},
{
"description": "Items to be requested which are \"Out of Stock\" considering all warehouses based on projected qty and minimum order qty",
"doctype": "DocField",
"label": "Raise Purchase Request",
"fieldname": "raise_purchase_request",

View File

@ -1,3 +0,0 @@
[
"Manufacturing Home"
]

View File

@ -1,3 +0,0 @@
{
"Manufacturing Home": "\u0935\u093f\u0928\u093f\u0930\u094d\u092e\u093e\u0923 \u0939\u094b\u092e"
}

View File

@ -0,0 +1,12 @@
import webnotes
def execute():
webnotes.reload_doc("core", "doctype", "patch_log")
for d in webnotes.conn.sql("""select patch from __PatchLog"""):
webnotes.doc({
"doctype": "Patch Log",
"patch": d[0]
}).insert()
webnotes.conn.commit()
webnotes.conn.sql("drop table __PatchLog")

View File

@ -0,0 +1,27 @@
from __future__ import unicode_literals
import webnotes
def execute():
from webnotes.country_info import get_all
data = get_all()
webnotes.reload_doc("setup", "doctype", "country")
webnotes.reload_doc("setup", "doctype", "currency")
for c in webnotes.conn.sql("""select name from tabCountry"""):
if c[0] in data:
info = webnotes._dict(data[c[0]])
doc = webnotes.doc("Country", c[0])
doc.date_format = info.date_format or "dd-mm-yyyy"
doc.time_zones = "\n".join(info.timezones or [])
doc.save()
if webnotes.conn.exists("Currency", info.currency):
doc = webnotes.doc("Currency", info.currency)
doc.fields.update({
"fraction": info.currency_fraction,
"symbol": info.currency_symbol,
"fraction_units": info.currency_fraction_units
})
doc.save()

View File

@ -1,5 +1,3 @@
import webnotes
def execute():
webnotes.conn.sql("""delete from tabDocPerm where parent='Appraisal'""")
from webnotes.model.sync import sync
sync("hr", "appraisal", force=True)
webnotes.reset_perms("Appraisal")

View File

@ -1,9 +1,3 @@
import webnotes
def execute():
webnotes.conn.sql("""delete from `tabDocPerm` where parent='Custom Script'""")
webnotes.conn.commit()
from webnotes.model.sync import sync
sync("core", "custom_script", force=1)
webnotes.conn.begin()
webnotes.reset_perms("Custom Script")

View File

@ -16,586 +16,139 @@
from __future__ import unicode_literals
patch_list = [
{
'patch_module': 'patches.mar_2012',
'patch_file': 'so_rv_mapper_fix',
'description': 'SO-RV duplicate mapper entry removal'
},
{
'patch_module': 'patches.mar_2012',
'patch_file': 'clean_property_setter',
'description': 'Patch related to property setter cleanup'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'sync_ref_db',
'description': 'Deletes non required doctypes'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'naming_series_patch',
'description': 'Move naming series options into property setter'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'rename_dt',
'description': 'Rename DocType Patch'
},
{
'patch_module': 'patches.mar_2012',
'patch_file': 'cleanup_control_panel',
'description': 'Remove email related fields from Control Panel'
},
{
'patch_module': 'patches.mar_2012',
'patch_file': 'doctype_get_refactor',
'description': 'Patch related to doctype get refactoring'
},
{
'patch_module': 'patches.mar_2012',
'patch_file': 'delete_docformat',
'description': 'Deletes DocFormat from database'
},
{
'patch_module': 'patches.mar_2012',
'patch_file': 'usertags',
'description': 'Adds _user_tags columns to tables'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'reload_c_form',
'description': 'Added attchemnt option and total field'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'after_sync_cleanup',
'description': 'cleanup after sync'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'remove_default_from_rv_detail',
'description': ''
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'update_role_in_address',
'description': 'updated roles in address'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'update_permlevel_in_address',
'description': 'updated permlevel in address'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'update_appraisal_permission',
'description': 'updated permission in appraisal'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'serial_no_fixes',
'description': 'fixes for sle creation while import'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'repost_stock_for_posting_time',
'description': 'repost stock for posting time 00:00:seconds'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'cleanup_property_setter',
'description': 'cleanup_property_setter'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'rename_prev_doctype',
'description': 'rename prev doctype fix'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'cleanup_notification_control',
'description': 'cleanup notification control'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'renamedt_in_custom_search_criteria',
'description': 'raname dt in custom search criteria'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'stock_reco_patch',
'description': 'stock reco patch: store diff info in field'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'reload_reports',
'description': 'reload reports: itemwise sales/delivery details'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'page_role_series_fix',
'description': 'reset series of page role at max'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'reload_sales_invoice_pf',
'description': 'Reload sales invoice print formats'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'std_pf_readonly',
'description': 'Make standard print formats readonly for system manager'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'reload_so_pending_items',
'description': 'reload so pending items'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'customize_form_cleanup',
'description': 'cleanup customize form records'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'cs_server_readonly',
'description': 'Make server custom script readonly for system manager'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'clear_session_cache',
'description': 'clears session cache as shifting to json format'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'same_purchase_rate_patch',
'description': 'Main same rate throughout pur cycle: in global defaults, by default set true'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'create_report_manager_role',
'description': 'Create report manager role if not exists'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'reload_customer_address_contact',
'description': 'Reload report customer address contact'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'profile_perm_patch',
'description': 'Make profile readonly for role All'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'remove_euro_currency',
'description': 'Remove EURO currency and replace with EUR'
},
{
'patch_module': 'patches.may_2012',
'patch_file': 'remove_communication_log',
'description': 'Remove Communication Log and replace it with Communication'
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'barcode_in_feature_setup',
'description': 'Track item by barcode'
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'copy_uom_for_pur_inv_item',
'description': 'Copy uom for pur inv item from PO and PR item table'
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'fetch_organization_from_lead',
'description': 'Fetch organization from lead in quote'
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'reports_list_permission',
'description': 'allow read permission to all for report list'
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'support_ticket_autoreply',
'description': 'New Send Autoreply checkbox in Email Settings'
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'series_unique_patch',
'description': "add unique constraint to series table's name column"
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'set_recurring_type',
'description': "set recurring type as monthly in old"
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'alter_tabsessions',
'description': "alter tabsessions to change user column definition"
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'delete_old_parent_entries',
'description': "delete entries of child table having parent like old_par%% or ''"
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'delete_about_contact',
'description': "delete depracated doctypes of website module"
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'reload_pr_po_mapper',
'description': "order date should be greater than equal to request date"
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'address_contact_perms',
'description': "sync address contact perms"
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'packing_list_cleanup_and_serial_no',
'description': "packing list cleanup and serial no status update"
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'deprecate_import_data_control',
'description': "deprecate doctype - Import Data Control and page - Import Data"
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'default_freeze_account',
'description': "set default freeze_account as 'No' where NULL"
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'update_purchase_tax',
'description': "rename options in purchase taxes and charges"
},
{ 'patch_module': 'patches.june_2012',
'patch_file': 'cms2',
'description': 'cms2 release patches'
},
{ 'patch_module': 'patches.july_2012',
'patch_file': 'auth_table',
'description': 'create new __Auth table'
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'remove_event_role_owner_match',
'description': "Remove Owner match from Event DocType's Permissions"
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'deprecate_bulk_rename',
'description': "Remove Bulk Rename Tool"
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'blog_guest_permission',
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'bin_permission',
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'project_patch_repeat',
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'repost_stock_due_to_wrong_packing_list',
},
{
'patch_module': 'patches.july_2012',
'patch_file': 'supplier_quotation',
},
{
'patch_module': 'patches.august_2012',
'patch_file': 'report_supplier_quotations',
},
{
'patch_module': 'patches.august_2012',
'patch_file': 'task_allocated_to_assigned',
},
{
'patch_module': 'patches.august_2012',
'patch_file': 'change_profile_permission',
},
{
'patch_module': 'patches.august_2012',
'patch_file': 'changed_blog_date_format',
},
{
'patch_module': 'patches.august_2012',
'patch_file': 'repost_billed_amt',
},
{
'patch_module': 'patches.august_2012',
'patch_file': 'remove_cash_flow_statement',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'stock_report_permissions_for_accounts',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'communication_delete_permission',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'all_permissions_patch',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'customer_permission_patch',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'add_stock_ledger_entry_index',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'plot_patch',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'event_permission',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'repost_stock',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'reload_gross_profit',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'rebuild_trees',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'deprecate_account_balance',
},
{
'patch_module': 'patches.september_2012',
'patch_file': 'profile_delete_permission',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'update_permission',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'reload_gl_mapper',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'fix_wrong_vouchers',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'remove_old_customer_contact_address',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'company_fiscal_year_docstatus_patch',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'update_account_property',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'remove_old_trial_bal',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'fix_cancelled_gl_entries',
},
{
'patch_module': 'patches.october_2012',
'patch_file': 'custom_script_delete_permission',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'custom_field_insert_after',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'delete_item_sales_register1',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'rename_employee_leave_balance_report',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'report_permissions',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'customer_issue_allocated_to_assigned',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'reset_appraisal_permissions',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'disable_cancelled_profiles',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'remove_old_unbilled_items_report',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'support_ticket_response_to_communication',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'cancelled_bom_patch',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'communication_sender_and_recipient',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'update_delivered_billed_percentage_for_pos',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'add_theme_to_profile',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'add_employee_field_in_employee',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'leave_application_cleanup',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'production_order_patch',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'gle_floating_point_issue',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'deprecate_tds',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'expense_leave_reload',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'repost_ordered_qty',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'repost_projected_qty',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'reload_debtors_creditors_ledger',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'website_cache_refactor',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'production_cleanup',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'fix_default_print_format',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'file_list_rename',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'replace_createlocal',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'clear_web_cache',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'remove_quotation_next_contact',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'stock_entry_cleanup',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'production_order_naming_series',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'rebuild_item_group_tree',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'address_title',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'delete_form16_print_format',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'remove_project_mapper',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'update_print_width',
},
{
'patch_module': 'patches.january_2013',
'patch_file': 'remove_bad_permissions',
},
{
'patch_module': 'patches.january_2013',
'patch_file': 'deprecate_stock_search_criteria',
},
{
'patch_module': 'patches.january_2013',
'patch_file': 'remove_support_search_criteria',
},
{
'patch_module': 'patches.january_2013',
'patch_file': 'holiday_list_patch',
},
{
'patch_module': 'patches.january_2013',
'patch_file': 'stock_reconciliation_patch',
},
{
'patch_module': 'patches.january_2013',
'patch_file': 'report_permission',
},
{
'patch_module': 'patches.january_2013',
'patch_file': 'give_report_permission_on_read',
},
{
'patch_module': 'patches.january_2013',
'patch_file': 'update_closed_on',
},
"patches.mar_2012.so_rv_mapper_fix",
"patches.mar_2012.clean_property_setter",
"patches.jan_mar_2012.sync_ref_db",
"patches.april_2012.naming_series_patch",
"patches.jan_mar_2012.rename_dt",
"patches.mar_2012.cleanup_control_panel",
"patches.mar_2012.doctype_get_refactor",
"patches.mar_2012.delete_docformat",
"patches.mar_2012.usertags",
"patches.april_2012.reload_c_form",
"patches.april_2012.after_sync_cleanup",
"patches.april_2012.remove_default_from_rv_detail",
"patches.april_2012.update_role_in_address",
"patches.april_2012.update_permlevel_in_address",
"patches.april_2012.update_appraisal_permission",
"patches.april_2012.serial_no_fixes",
"patches.april_2012.repost_stock_for_posting_time",
"patches.may_2012.cleanup_property_setter",
"patches.may_2012.rename_prev_doctype",
"patches.may_2012.cleanup_notification_control",
"patches.may_2012.renamedt_in_custom_search_criteria",
"patches.may_2012.stock_reco_patch",
"patches.may_2012.reload_reports",
"patches.may_2012.page_role_series_fix",
"patches.may_2012.reload_sales_invoice_pf",
"patches.may_2012.std_pf_readonly",
"patches.may_2012.reload_so_pending_items",
"patches.may_2012.customize_form_cleanup",
"patches.may_2012.cs_server_readonly",
"patches.may_2012.clear_session_cache",
"patches.may_2012.same_purchase_rate_patch",
"patches.may_2012.create_report_manager_role",
"patches.may_2012.reload_customer_address_contact",
"patches.may_2012.profile_perm_patch",
"patches.may_2012.remove_euro_currency",
"patches.may_2012.remove_communication_log",
"patches.june_2012.barcode_in_feature_setup",
"patches.june_2012.copy_uom_for_pur_inv_item",
"patches.june_2012.fetch_organization_from_lead",
"patches.june_2012.reports_list_permission",
"patches.june_2012.support_ticket_autoreply",
"patches.june_2012.series_unique_patch",
"patches.june_2012.set_recurring_type",
"patches.june_2012.alter_tabsessions",
"patches.june_2012.delete_old_parent_entries",
"patches.april_2012.delete_about_contact",
"patches.july_2012.reload_pr_po_mapper",
"patches.july_2012.address_contact_perms",
"patches.july_2012.packing_list_cleanup_and_serial_no",
"patches.july_2012.deprecate_import_data_control",
"patches.july_2012.default_freeze_account",
"patches.july_2012.update_purchase_tax",
"patches.june_2012.cms2",
"patches.july_2012.auth_table",
"patches.july_2012.remove_event_role_owner_match",
"patches.july_2012.deprecate_bulk_rename",
"patches.july_2012.blog_guest_permission",
"patches.july_2012.bin_permission",
"patches.july_2012.project_patch_repeat",
"patches.july_2012.repost_stock_due_to_wrong_packing_list",
"patches.july_2012.supplier_quotation",
"patches.august_2012.report_supplier_quotations",
"patches.august_2012.task_allocated_to_assigned",
"patches.august_2012.change_profile_permission",
"patches.august_2012.changed_blog_date_format",
"patches.august_2012.repost_billed_amt",
"patches.august_2012.remove_cash_flow_statement",
"patches.september_2012.stock_report_permissions_for_accounts",
"patches.september_2012.communication_delete_permission",
"patches.september_2012.all_permissions_patch",
"patches.september_2012.customer_permission_patch",
"patches.september_2012.add_stock_ledger_entry_index",
"patches.september_2012.plot_patch",
"patches.september_2012.event_permission",
"patches.september_2012.repost_stock",
"patches.september_2012.reload_gross_profit",
"patches.september_2012.rebuild_trees",
"patches.september_2012.deprecate_account_balance",
"patches.september_2012.profile_delete_permission",
"patches.october_2012.update_permission",
"patches.october_2012.reload_gl_mapper",
"patches.october_2012.fix_wrong_vouchers",
"patches.october_2012.remove_old_customer_contact_address",
"patches.october_2012.company_fiscal_year_docstatus_patch",
"patches.october_2012.update_account_property",
"patches.october_2012.remove_old_trial_bal",
"patches.october_2012.fix_cancelled_gl_entries",
"patches.october_2012.custom_script_delete_permission",
"patches.november_2012.custom_field_insert_after",
"patches.november_2012.delete_item_sales_register1",
"patches.november_2012.rename_employee_leave_balance_report",
"patches.november_2012.report_permissions",
"patches.november_2012.customer_issue_allocated_to_assigned",
"patches.november_2012.reset_appraisal_permissions",
"patches.november_2012.disable_cancelled_profiles",
"patches.november_2012.remove_old_unbilled_items_report",
"patches.november_2012.support_ticket_response_to_communication",
"patches.november_2012.cancelled_bom_patch",
"patches.november_2012.communication_sender_and_recipient",
"patches.november_2012.update_delivered_billed_percentage_for_pos",
"patches.november_2012.add_theme_to_profile",
"patches.november_2012.add_employee_field_in_employee",
"patches.november_2012.leave_application_cleanup",
"patches.november_2012.production_order_patch",
"patches.november_2012.gle_floating_point_issue",
"patches.december_2012.deprecate_tds",
"patches.december_2012.expense_leave_reload",
"patches.december_2012.repost_ordered_qty",
"patches.december_2012.repost_projected_qty",
"patches.december_2012.reload_debtors_creditors_ledger",
"patches.december_2012.website_cache_refactor",
"patches.december_2012.production_cleanup",
"patches.december_2012.fix_default_print_format",
"patches.december_2012.file_list_rename",
"patches.december_2012.replace_createlocal",
"patches.december_2012.clear_web_cache",
"patches.december_2012.remove_quotation_next_contact",
"patches.december_2012.stock_entry_cleanup",
"patches.december_2012.production_order_naming_series",
"patches.december_2012.rebuild_item_group_tree",
"patches.december_2012.address_title",
"patches.december_2012.delete_form16_print_format",
"patches.december_2012.remove_project_mapper",
"patches.december_2012.update_print_width",
"patches.january_2013.remove_bad_permissions",
"patches.january_2013.deprecate_stock_search_criteria",
"patches.january_2013.remove_support_search_criteria",
"patches.january_2013.holiday_list_patch",
"patches.january_2013.stock_reconciliation_patch",
"patches.january_2013.report_permission",
"patches.january_2013.give_report_permission_on_read",
"patches.january_2013.update_closed_on",
"patches.january_2013.change_patch_structure",
"patches.january_2013.update_country_info",
"patches.january_2013.purchase_price_list",
]

View File

@ -1,4 +0,0 @@
from __future__ import unicode_literals
install_docs = [
{"doctype":"Role", "role_name":"Projects User", "name":"Projects User"},
]

View File

@ -1,4 +0,0 @@
[
"Projects Home",
"Projects"
]

View File

@ -1,4 +0,0 @@
{
"Projects": "\u092a\u0930\u093f\u092f\u094b\u091c\u0928\u093e\u0913\u0902",
"Projects Home": "\u092a\u0930\u093f\u092f\u094b\u091c\u0928\u093e\u0913\u0902 \u0918\u0930"
}

View File

@ -37,14 +37,14 @@ $.extend(erpnext.complete_setup, {
{fieldname:'fy_start', label:'Financial Year Start Date', fieldtype:'Select',
description:'Your financial year begins on"', reqd:1,
options: erpnext.complete_setup.fy_start_list.join('\n')},
{fieldname:'country', label: 'Country', reqd:1,
options: "", fieldtype: 'Select'},
{fieldname:'currency', label: 'Default Currency', reqd:1,
options: erpnext.complete_setup.currency_list.join('\n'), fieldtype: 'Select'},
options: "Currency", fieldtype: 'Link'},
{fieldname:'timezone', label: 'Time Zone', reqd:1,
options: "", fieldtype: 'Select'},
{fieldname:'industry', label: 'Industry', reqd:1,
options: erpnext.complete_setup.industry_list.join('\n'), fieldtype: 'Select'},
{fieldname:'country', label: 'Country', reqd:1,
options: erpnext.complete_setup.country_list.join('\n'), fieldtype: 'Select'},
{fieldname:'timezone', label: 'Time Zone', reqd:1,
options: '', fieldtype: 'Select'},
{fieldname:'update', label:'Setup',fieldtype:'Button'},
],
});
@ -54,6 +54,15 @@ $.extend(erpnext.complete_setup, {
$('header').toggle(false); // hide toolbar
}
wn.call({
method:"webnotes.country_info.get_all",
callback: function(data) {
erpnext.country_info = data.message;
d.get_input("country").empty()
.add_options([""].concat(keys(data.message).sort()));
}
})
// on clicking update
d.fields_dict.update.input.onclick = function() {
var data = d.get_values();
@ -74,12 +83,19 @@ $.extend(erpnext.complete_setup, {
var $timezone = $(d.fields_dict.timezone.input);
$timezone.empty();
if(country){
var timezone_list = erpnext.complete_setup.timezone_dict[country];
if(timezone_list.length > 1) {
timezone_list = [""].concat(timezone_list);
var timezone_list = erpnext.country_info[country].timezones;
if(timezone_list.length==0) {
timezone_list = $.map(erpnext.country_info, function(m) {
return m.timezones
});
}
$timezone.add_options(timezone_list);
$timezone.empty().add_options(timezone_list);
console.log(d.get_input("currency"))
d.get_input("currency").val(erpnext.country_info[country].currency);
}
};
// company name already set
@ -104,374 +120,12 @@ $.extend(erpnext.complete_setup, {
},
fy_start_list: ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct'],
currency_list: ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN',
'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR',
'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF',
'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP',
'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF',
'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF',
'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD',
'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR',
'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP',
'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR',
'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY',
'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV',
'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'],
industry_list: ['', 'Aerospace and Defence', 'Agriculture', 'Apparel', 'Automobile',
'Banking', 'Biotechnology', 'Chemical', 'Communications', 'Consulting', 'Customer Service',
'Education', 'Electronics', 'Energy', 'Engineering', 'Entertainment', 'Environmental',
'Finance', 'Food and Beverage', 'Government', 'Healthcare', 'Hospitality',
'Information Technology', 'Insurance', 'Machinery', 'Manufacturing', 'Media',
'Not For Profit', 'Recreation', 'Retail', 'Shipping', 'Technology',
'Telecommunications', 'Transportation', 'Trading', 'Utilities', 'Other'],
country_list: ["", 'Afghanistan', 'Albania', 'Algeria', 'Andorra', 'Angola', 'Antigua and Barbuda',
'Argentina', 'Armenia', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain',
'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bhutan', 'Bolivia',
'Bosnia and Herzegovina', 'Botswana', 'Brazil', 'Brunei Darussalam', 'Bulgaria',
'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde',
'Central African Republic', 'Chad', 'Chile', 'Colombia', 'Comoros', 'Costa Rica',
'Croatia', 'Cuba', 'Cyprus', 'Czech Republic', "C\xc3\xb4te d'Ivoire",
'Democratic Republic of the Congo', 'Denmark', 'Djibouti', 'Dominica',
'Dominican Republic', 'East Timor', 'Ecuador', 'Egypt', 'El Salvador',
'Equatorial Guinea', 'Eritrea', 'Estonia', 'Ethiopia', 'Federated States of Micronesia',
'Fiji', 'Finland', 'France', 'Gabon', 'Georgia', 'Germany', 'Ghana', 'Greece',
'Grenada', 'Guatemala', 'Guinea', 'Guinea-Bissau', 'Guyana', 'Haiti', 'Honduras', 'Hong Kong',
'Hungary', 'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Israel', 'Italy',
'Jamaica', 'Japan', 'Jordan', 'Kazakhstan', 'Kenya', 'Kingdom of the Netherlands',
'Kiribati', 'Kuwait', 'Kyrgyzstan', 'Laos', 'Latvia', 'Lebanon', 'Lesotho', 'Liberia',
'Libya', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Macedonia', 'Madagascar', 'Malawi',
'Malaysia', 'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Mauritania', 'Mauritius',
'Mexico', 'Moldova', 'Monaco', 'Mongolia', 'Montenegro', 'Morocco', 'Mozambique',
'Myanmar', 'Namibia', 'Nauru', 'Nepal', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria',
'North Korea', 'Norway', 'Oman', 'Pakistan', 'Palau', 'Panama', 'Papua New Guinea',
'Paraguay', "China", 'Peru', 'Philippines', 'Poland', 'Portugal',
'Qatar', 'Republic of Ireland', 'Republic of the Congo', 'Romania', 'Russia', 'Rwanda',
'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Vincent and the Grenadines', 'Samoa',
'San Marino', 'Saudi Arabia', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone',
'Singapore', 'Slovakia', 'Slovenia', 'Solomon Islands', 'Somalia', 'South Africa',
'South Korea', 'Spain', 'Sri Lanka', 'Sudan', 'Suriname', 'Swaziland', 'Sweden',
'Switzerland', 'Syria', 'S\xc3\xa3o Tom\xc3\xa9 and Pr\xc3\xadncipe', 'Tajikistan',
'Tanzania', 'Thailand', 'The Gambia', 'Togo', 'Tonga', 'Trinidad and Tobago', 'Tunisia',
'Turkey', 'Turkmenistan', 'Tuvalu', 'Uganda', 'Ukraine', 'United Arab Emirates',
'United Kingdom', 'United States', 'Uruguay', 'Uzbekistan', 'Vanuatu', 'Vatican City',
'Venezuela', 'Vietnam', 'Yemen', 'Zambia', 'Zimbabwe'],
timezone_dict: {
'Afghanistan': ['Asia/Kabul'],
'Albania': ['Europe/Tirane'],
'Algeria': ['Africa/Algiers'],
'Andorra': ['Europe/Andorra'],
'Angola': ['Africa/Luanda'],
'Antigua and Barbuda': ['America/Antigua'],
'Argentina': ['America/Argentina/Buenos_Aires',
'America/Argentina/Cordoba',
'America/Argentina/Jujuy',
'America/Argentina/Tucuman',
'America/Argentina/Catamarca',
'America/Argentina/La_Rioja',
'America/Argentina/San_Juan',
'America/Argentina/Mendoza',
'America/Argentina/Rio_Gallegos',
'America/Argentina/Ushuaia'],
'Armenia': ['Asia/Yerevan'],
'Australia': ['Australia/Lord_Howe',
'Australia/Hobart',
'Australia/Currie',
'Australia/Melbourne',
'Australia/Sydney',
'Australia/Broken_Hill',
'Australia/Brisbane',
'Australia/Lindeman',
'Australia/Adelaide',
'Australia/Darwin',
'Australia/Perth'],
'Austria': ['Europe/Vienna'],
'Azerbaijan': ['Asia/Baku'],
'Bahamas': ['America/Nassau'],
'Bahrain': ['Asia/Bahrain'],
'Bangladesh': ['Asia/Dhaka'],
'Barbados': ['America/Barbados'],
'Belarus': ['Europe/Minsk'],
'Belgium': ['Europe/Brussels'],
'Belize': ['America/Belize'],
'Benin': ['Africa/Porto-Novo'],
'Bhutan': ['Asia/Thimphu'],
'Bolivia': ['America/La_Paz'],
'Bosnia and Herzegovina': ['Europe/Sarajevo'],
'Botswana': ['Africa/Gaborone'],
'Brazil': ['America/Noronha',
'America/Belem',
'America/Fortaleza',
'America/Recife',
'America/Araguaina',
'America/Maceio',
'America/Bahia',
'America/Sao_Paulo',
'America/Campo_Grande',
'America/Cuiaba',
'America/Porto_Velho',
'America/Boa_Vista',
'America/Manaus',
'America/Eirunepe',
'America/Rio_Branco'],
'Brunei Darussalam': ['Asia/Brunei'],
'Bulgaria': ['Europe/Sofia'],
'Burkina Faso': ['Africa/Ouagadougou'],
'Burundi': ['Africa/Bujumbura'],
'Cambodia': ['Asia/Phnom_Penh'],
'Cameroon': ['Africa/Douala'],
'Canada': ['America/St_Johns',
'America/Halifax',
'America/Glace_Bay',
'America/Moncton',
'America/Goose_Bay',
'America/Blanc-Sablon',
'America/Montreal',
'America/Toronto',
'America/Nipigon',
'America/Thunder_Bay',
'America/Pangnirtung',
'America/Iqaluit',
'America/Atikokan',
'America/Rankin_Inlet',
'America/Winnipeg',
'America/Rainy_River',
'America/Cambridge_Bay',
'America/Regina',
'America/Swift_Current',
'America/Edmonton',
'America/Yellowknife',
'America/Inuvik',
'America/Dawson_Creek',
'America/Vancouver',
'America/Whitehorse',
'America/Dawson'],
'Cape Verde': ['Atlantic/Cape_Verde'],
'Central African Republic': ['Africa/Bangui'],
'Chad': ['Africa/Ndjamena'],
'China': ['Asia/Shanghai',
'Asia/Harbin',
'Asia/Chongqing',
'Asia/Urumqi',
'Asia/Kashgar'],
'Chile': ['America/Santiago', 'Pacific/Easter'],
'Colombia': ['America/Bogota'],
'Comoros': ['Indian/Comoro'],
'Costa Rica': ['America/Costa_Rica'],
'Croatia': ['Europe/Zagreb'],
'Cuba': ['America/Havana'],
'Cyprus': ['Asia/Nicosia'],
'Czech Republic': ['Europe/Prague'],
"C\xc3\xb4te d'Ivoire": ['Africa/Abidjan'],
'Democratic Republic of the Congo': ['Africa/Kinshasa', 'Africa/Lubumbashi'],
'Denmark': ['Europe/Copenhagen'],
'Djibouti': ['Africa/Djibouti'],
'Dominica': ['America/Dominica'],
'Dominican Republic': ['America/Santo_Domingo'],
'East Timor': ['Asia/Dili'],
'Ecuador': ['America/Guayaquil', 'Pacific/Galapagos'],
'Egypt': ['Africa/Cairo'],
'El Salvador': ['America/El_Salvador'],
'Equatorial Guinea': ['Africa/Malabo'],
'Eritrea': ['Africa/Asmera'],
'Estonia': ['Europe/Tallinn'],
'Ethiopia': ['Africa/Addis_Ababa'],
'Federated States of Micronesia': ['Pacific/Truk',
'Pacific/Ponape',
'Pacific/Kosrae'],
'Fiji': ['Pacific/Fiji'],
'Finland': ['Europe/Helsinki'],
'France': ['Europe/Paris'],
'Gabon': ['Africa/Libreville'],
'Georgia': ['Asia/Tbilisi'],
'Germany': ['Europe/Berlin'],
'Ghana': ['Africa/Accra'],
'Greece': ['Europe/Athens'],
'Grenada': ['America/Grenada'],
'Guatemala': ['America/Guatemala'],
'Guinea': ['Africa/Conakry'],
'Guinea-Bissau': ['Africa/Bissau'],
'Guyana': ['America/Guyana'],
'Haiti': ['America/Guatemala'],
'Honduras': ['America/Tegucigalpa'],
'Hong Kong': ['Asia/Hong_Kong'],
'Hungary': ['Europe/Budapest'],
'Iceland': ['Atlantic/Reykjavik'],
'India': ['Asia/Calcutta'],
'Indonesia': ['Asia/Jakarta',
'Asia/Pontianak',
'Asia/Makassar',
'Asia/Jayapura'],
'Iran': ['Asia/Tehran'],
'Iraq': ['Asia/Baghdad'],
'Israel': ['Asia/Jerusalem'],
'Italy': ['Europe/Rome'],
'Jamaica': ['America/Jamaica'],
'Japan': ['Asia/Tokyo'],
'Jordan': ['Asia/Amman'],
'Kazakhstan': ['Asia/Almaty',
'Asia/Qyzylorda',
'Asia/Aqtobe',
'Asia/Aqtau',
'Asia/Oral'],
'Kenya': ['Africa/Nairobi'],
'Kingdom of the Netherlands': ['Europe/Amsterdam'],
'Kiribati': ['Pacific/Tarawa', 'Pacific/Enderbury', 'Pacific/Kiritimati'],
'Kuwait': ['Asia/Kuwait'],
'Kyrgyzstan': ['Asia/Bishkek'],
'Laos': ['Asia/Vientiane'],
'Latvia': ['Europe/Riga'],
'Lebanon': ['Asia/Beirut'],
'Lesotho': ['Africa/Maseru'],
'Liberia': ['Africa/Monrovia'],
'Libya': ['Africa/Tripoli'],
'Liechtenstein': ['Europe/Vaduz'],
'Lithuania': ['Europe/Vilnius'],
'Luxembourg': ['Europe/Luxembourg'],
'Macedonia': ['Europe/Skopje'],
'Madagascar': ['Indian/Antananarivo'],
'Malawi': ['Africa/Blantyre'],
'Malaysia': ['Asia/Kuala_Lumpur', 'Asia/Kuching'],
'Maldives': ['Indian/Maldives'],
'Mali': ['Africa/Bamako'],
'Malta': ['Europe/Malta'],
'Marshall Islands': ['Pacific/Majuro', 'Pacific/Kwajalein'],
'Mauritania': ['Africa/Nouakchott'],
'Mauritius': ['Indian/Mauritius'],
'Mexico': ['America/Mexico_City',
'America/Cancun',
'America/Merida',
'America/Monterrey',
'America/Mazatlan',
'America/Chihuahua',
'America/Hermosillo',
'America/Tijuana'],
'Moldova': ['Europe/Chisinau'],
'Monaco': ['Europe/Monaco'],
'Mongolia': ['Asia/Ulaanbaatar', 'Asia/Hovd', 'Asia/Choibalsan'],
'Montenegro': ['Europe/Podgorica'],
'Morocco': ['Africa/Casablanca'],
'Mozambique': ['Africa/Maputo'],
'Myanmar': ['Asia/Rangoon'],
'Namibia': ['Africa/Windhoek'],
'Nauru': ['Pacific/Nauru'],
'Nepal': ['Asia/Katmandu'],
'New Zealand': ['Pacific/Auckland', 'Pacific/Chatham'],
'Nicaragua': ['America/Managua'],
'Niger': ['Africa/Niamey'],
'Nigeria': ['Africa/Lagos'],
'North Korea': ['Asia/Pyongyang'],
'Norway': ['Europe/Oslo'],
'Oman': ['Asia/Muscat'],
'Pakistan': ['Asia/Karachi'],
'Palau': ['Pacific/Palau'],
'Panama': ['America/Panama'],
'Papua New Guinea': ['Pacific/Port_Moresby'],
'Paraguay': ['America/Asuncion'],
'Peru': ['America/Lima'],
'Philippines': ['Asia/Manila'],
'Poland': ['Europe/Warsaw'],
'Portugal': ['Europe/Lisbon', 'Atlantic/Madeira', 'Atlantic/Azores'],
'Qatar': ['Asia/Qatar'],
'Republic of Ireland': ['Europe/Dublin'],
'Republic of the Congo': ['Africa/Brazzaville'],
'Romania': ['Europe/Bucharest'],
'Russia': ['Europe/Kaliningrad',
'Europe/Moscow',
'Europe/Volgograd',
'Europe/Samara',
'Asia/Yekaterinburg',
'Asia/Omsk',
'Asia/Novosibirsk',
'Asia/Krasnoyarsk',
'Asia/Irkutsk',
'Asia/Yakutsk',
'Asia/Vladivostok',
'Asia/Sakhalin',
'Asia/Magadan',
'Asia/Kamchatka',
'Asia/Anadyr'],
'Rwanda': ['Africa/Kigali'],
'Saint Kitts and Nevis': ['America/St_Kitts'],
'Saint Lucia': ['America/St_Lucia'],
'Saint Vincent and the Grenadines': ['America/St_Vincent'],
'Samoa': ['Pacific/Apia'],
'San Marino': ['Europe/San_Marino'],
'Saudi Arabia': ['Asia/Riyadh'],
'Senegal': ['Africa/Dakar'],
'Serbia': ['Europe/Belgrade'],
'Seychelles': ['Indian/Mahe'],
'Sierra Leone': ['Africa/Freetown'],
'Singapore': ['Asia/Singapore'],
'Slovakia': ['Europe/Bratislava'],
'Slovenia': ['Europe/Ljubljana'],
'Solomon Islands': ['Pacific/Guadalcanal'],
'Somalia': ['Africa/Mogadishu'],
'South Africa': ['Africa/Johannesburg'],
'South Korea': ['Asia/Seoul'],
'Spain': ['Europe/Madrid', 'Africa/Ceuta', 'Atlantic/Canary'],
'Sri Lanka': ['Asia/Colombo'],
'Sudan': ['Africa/Khartoum'],
'Suriname': ['America/Paramaribo'],
'Swaziland': ['Africa/Mbabane'],
'Sweden': ['Europe/Stockholm'],
'Switzerland': ['Europe/Zurich'],
'Syria': ['Asia/Damascus'],
'S\xc3\xa3o Tom\xc3\xa9 and Pr\xc3\xadncipe': ['Africa/Sao_Tome'],
'Tajikistan': ['Asia/Dushanbe'],
'Tanzania': ['Africa/Dar_es_Salaam'],
'Thailand': ['Asia/Bangkok'],
'The Gambia': ['Africa/Banjul'],
'Togo': ['Africa/Lome'],
'Tonga': ['Pacific/Tongatapu'],
'Trinidad and Tobago': ['America/Port_of_Spain'],
'Tunisia': ['Africa/Tunis'],
'Turkey': ['Europe/Istanbul'],
'Turkmenistan': ['Asia/Ashgabat'],
'Tuvalu': ['Pacific/Funafuti'],
'Uganda': ['Africa/Kampala'],
'Ukraine': ['Europe/Kiev',
'Europe/Uzhgorod',
'Europe/Zaporozhye',
'Europe/Simferopol'],
'United Arab Emirates': ['Asia/Dubai'],
'United Kingdom': ['Europe/London'],
'United States': ['America/New_York',
'America/Detroit',
'America/Kentucky/Louisville',
'America/Kentucky/Monticello',
'America/Indiana/Indianapolis',
'America/Indiana/Marengo',
'America/Indiana/Knox',
'America/Indiana/Vevay',
'America/Chicago',
'America/Indiana/Vincennes',
'America/Indiana/Petersburg',
'America/Menominee',
'America/North_Dakota/Center',
'America/North_Dakota/New_Salem',
'America/Denver',
'America/Boise',
'America/Shiprock',
'America/Phoenix',
'America/Los_Angeles',
'America/Anchorage',
'America/Juneau',
'America/Yakutat',
'America/Nome',
'America/Adak',
'Pacific/Honolulu'],
'Uruguay': ['America/Montevideo'],
'Uzbekistan': ['Asia/Samarkand', 'Asia/Tashkent'],
'Vanuatu': ['Pacific/Efate'],
'Vatican City': ['Europe/Vatican'],
'Venezuela': ['America/Caracas'],
'Vietnam': ['Asia/Saigon'],
'Yemen': ['Asia/Aden'],
'Zambia': ['Africa/Lusaka'],
'Zimbabwe': ['Africa/Harare'],
},
industry_list: ['', 'Aerospace and Defence', 'Agriculture', 'Apparel', 'Automobile',
'Banking', 'Biotechnology', 'Chemical', 'Communications', 'Consulting', 'Customer Service',
'Education', 'Electronics', 'Energy', 'Engineering', 'Entertainment', 'Environmental',
'Finance', 'Food and Beverage', 'Government', 'Healthcare', 'Hospitality',
'Information Technology', 'Insurance', 'Machinery', 'Manufacturing', 'Media',
'Not For Profit', 'Recreation', 'Retail', 'Shipping', 'Technology',
'Telecommunications', 'Transportation', 'Trading', 'Utilities', 'Other'],
});

View File

@ -53,9 +53,9 @@ erpnext.utils.lead_query = function() {
// searches for customer
erpnext.utils.customer_query = function() {
if(sys_defaults.cust_master_name == "Customer Name") {
var fields = ["name", "customer_group", "country", "territory"];
var fields = ["name", "customer_group", "territory"];
} else {
var fields = ["name", "customer_name", "customer_group", "country", "territory"];
var fields = ["name", "customer_name", "customer_group", "territory"];
}
return "select " + fields.join(", ") + " from `tabCustomer` where docstatus < 2 and \

View File

@ -1,8 +0,0 @@
from __future__ import unicode_literals
install_docs = [
{"doctype":"Role", "role_name":"Customer", "name":"Customer"},
{"doctype":"Role", "role_name":"Partner", "name":"Partner"},
{"doctype":"Role", "role_name":"Sales Manager", "name":"Sales Manager"},
{"doctype":"Role", "role_name":"Sales Master Manager", "name":"Sales Master Manager"},
{"doctype":"Role", "role_name":"Sales User", "name":"Sales User"},
]

View File

@ -123,7 +123,7 @@ class DocType(TransactionBase):
abbr = self.get_company_abbr()
if not sql("select name from tabAccount where name=%s", (self.doc.name + " - " + abbr)):
parent_account = self.get_receivables_group()
arg = {'account_name':self.doc.name,'parent_account': parent_account, 'group_or_ledger':'Ledger', 'company':self.doc.company,'account_type':'','tax_rate':'0','master_type':'Customer','master_name':self.doc.name,'address':self.doc.address}
arg = {'account_name':self.doc.name,'parent_account': parent_account, 'group_or_ledger':'Ledger', 'company':self.doc.company,'account_type':'','tax_rate':'0','master_type':'Customer','master_name':self.doc.name}
# create
ac = get_obj('GL Control').add_ac(cstr(arg))
@ -172,11 +172,6 @@ class DocType(TransactionBase):
pass
def on_update(self):
# create customer addr
#self.create_customer_address()
# create customer contact
#self.create_customer_contact()
# update lead status
self.update_lead_status()
# create account head
self.create_account_head()

View File

@ -299,7 +299,7 @@ cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query=
and si_item.item_code = item.name \
and si.docstatus = 1 \
and si.customer = \"%(cust)s\" \
order by si.voucher_date desc \
order by si.posting_date desc \
limit 1 \
) as sales_rate, \
item.item_name, item.description \

View File

@ -1,11 +0,0 @@
[
"Sales Orders Pending To Be Delivered",
"Customer Addresses And Contacts",
"Buyer of Goods and Services.",
"Sales Dashboard",
"Potential Sales Deal",
"Selling Home",
"Sales Analytics",
"Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ",
"Sales Browser"
]

View File

@ -1,11 +0,0 @@
{
"Buyer of Goods and Services.": "\u0938\u093e\u092e\u093e\u0928 \u0914\u0930 \u0938\u0947\u0935\u093e\u0913\u0902 \u0915\u0947 \u0916\u0930\u0940\u0926\u093e\u0930.",
"Customer Addresses And Contacts": "\u0917\u094d\u0930\u093e\u0939\u0915 \u0915\u0947 \u092a\u0924\u0947 \u0914\u0930 \u0938\u0902\u092a\u0930\u094d\u0915",
"Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ": "\u092c\u093f\u0915\u094d\u0930\u0940 \u0905\u092d\u093f\u092f\u093e\u0928 \u0915\u093e \u091f\u094d\u0930\u0948\u0915 \u0930\u0916\u0947\u0902. \u092c\u093f\u0915\u094d\u0930\u0940\u0938\u0942\u0924\u094d\u0930, \u0915\u094b\u091f\u0947\u0936\u0928, \u0905\u092d\u093f\u092f\u093e\u0928 \u0938\u0947 \u092c\u093f\u0915\u094d\u0930\u0940 \u0906\u0926\u0947\u0936 \u0906\u0926\u093f \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0928\u093f\u0935\u0947\u0936 \u092a\u0930 \u0935\u093e\u092a\u0938\u0940 \u0917\u0947\u091c \u091f\u094d\u0930\u0948\u0915 \u0930\u0916\u0947\u0902.",
"Potential Sales Deal": "\u0938\u0902\u092d\u093e\u0935\u093f\u0924 \u092c\u093f\u0915\u094d\u0930\u0940 \u0938\u094c\u0926\u093e",
"Sales Analytics": "\u092c\u093f\u0915\u094d\u0930\u0940 \u0935\u093f\u0936\u094d\u0932\u0947\u0937\u093f\u0915\u0940",
"Sales Browser": "\u092c\u093f\u0915\u094d\u0930\u0940 \u092c\u094d\u0930\u093e\u0909\u091c\u093c\u0930",
"Sales Dashboard": "\u092c\u093f\u0915\u094d\u0930\u0940 \u0921\u0948\u0936\u092c\u094b\u0930\u094d\u0921",
"Sales Orders Pending To Be Delivered": "\u0935\u093f\u0915\u094d\u0930\u092f \u0906\u0926\u0947\u0936 \u0926\u093f\u092f\u093e \u091c\u093e \u0932\u0902\u092c\u093f\u0924",
"Selling Home": "\u0918\u0930 \u092c\u0947\u091a\u0928\u093e"
}

View File

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

View File

@ -1,5 +0,0 @@
from __future__ import unicode_literals
install_docs = [
{'doctype':'Role', 'role_name': 'System Manager', 'name': 'System Manager'},
{'doctype':'Role', 'role_name': 'Analytics', 'name': 'Analytics'}
]

View File

@ -162,7 +162,6 @@ class DocType:
ac = Document('Account')
for d in self.fld_dict.keys():
ac.fields[d] = (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.doc.abbr or lst[self.fld_dict[d]]
ac.old_parent = ''
ac_obj = get_obj(doc=ac)
ac_obj.doc.freeze_account='No'
ac_obj.doc.master_type = ''
@ -199,7 +198,7 @@ class DocType:
# ---------------------------------------------------
def create_default_cost_center(self):
glc = get_obj('GL Control')
cc_list = [{'cost_center_name':'Root','company_name':self.doc.name,'company_abbr':self.doc.abbr,'group_or_ledger':'Group','parent_cost_center':'','old_parent':''}, {'cost_center_name':'Default CC Ledger','company_name':self.doc.name,'company_abbr':self.doc.abbr,'group_or_ledger':'Ledger','parent_cost_center':'Root - ' + self.doc.abbr,'old_parent':''}]
cc_list = [{'cost_center_name':'Root','company_name':self.doc.name,'company_abbr':self.doc.abbr,'group_or_ledger':'Group','parent_cost_center':''}, {'cost_center_name':'Default CC Ledger','company_name':self.doc.name,'company_abbr':self.doc.abbr,'group_or_ledger':'Ledger','parent_cost_center':'Root - ' + self.doc.abbr}]
for c in cc_list:
glc.add_cc(str(c))

View File

@ -2,35 +2,24 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-03-27 14:36:19",
"creation": "2013-01-17 17:02:24",
"modified_by": "Administrator",
"modified": "2012-03-27 14:36:19"
"modified": "2013-01-17 17:04:08"
},
{
"section_style": "Simple",
"in_create": 0,
"module": "Setup",
"server_code_error": " ",
"document_type": "Master",
"read_only": 0,
"autoname": "field:country_name",
"name": "__common__",
"colour": "White:FFF",
"in_create": 0,
"doctype": "DocType",
"show_in_menu": 0,
"version": 11
"module": "Setup",
"document_type": "Master",
"name": "__common__"
},
{
"parent": "Country",
"oldfieldtype": "Data",
"oldfieldname": "country_name",
"reqd": 1,
"name": "__common__",
"parent": "Country",
"doctype": "DocField",
"label": "Country Name",
"parenttype": "DocType",
"fieldname": "country_name",
"fieldtype": "Data",
"permlevel": 0,
"parentfield": "fields"
},
@ -49,12 +38,33 @@
"name": "Country",
"doctype": "DocType"
},
{
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "Country Name",
"oldfieldname": "country_name",
"fieldname": "country_name",
"fieldtype": "Data",
"reqd": 1
},
{
"doctype": "DocField",
"label": "Date Format",
"fieldname": "date_format",
"fieldtype": "Data"
},
{
"doctype": "DocField",
"label": "Time Zones",
"fieldname": "time_zones",
"fieldtype": "Text"
},
{
"amend": 0,
"cancel": 0,
"role": "Sales Master Manager",
"doctype": "DocPerm",
"submit": 0
"submit": 0,
"role": "Sales Master Manager",
"cancel": 0
},
{
"role": "Purchase Master Manager",
@ -67,8 +77,5 @@
{
"role": "HR Manager",
"doctype": "DocPerm"
},
{
"doctype": "DocField"
}
]

View File

@ -2,36 +2,24 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-07-03 13:30:55",
"creation": "2013-01-17 12:30:28",
"modified_by": "Administrator",
"modified": "2012-07-11 16:11:45"
"modified": "2013-01-17 16:24:59"
},
{
"section_style": "Simple",
"description": "**Currency** Master",
"module": "Setup",
"allow_trash": 1,
"server_code_error": " ",
"in_create": 0,
"read_only": 0,
"autoname": "field:currency_name",
"name": "__common__",
"colour": "White:FFF",
"in_create": 0,
"description": "**Currency** Master",
"doctype": "DocType",
"show_in_menu": 0,
"version": 1
"module": "Setup",
"name": "__common__"
},
{
"parent": "Currency",
"oldfieldtype": "Data",
"oldfieldname": "currency_name",
"reqd": 1,
"name": "__common__",
"parent": "Currency",
"doctype": "DocField",
"label": "Currency Name",
"parenttype": "DocType",
"fieldname": "currency_name",
"fieldtype": "Data",
"permlevel": 0,
"parentfield": "fields"
},
@ -39,9 +27,7 @@
"name": "__common__",
"parent": "Currency",
"read": 1,
"create": 1,
"doctype": "DocPerm",
"write": 1,
"parenttype": "DocType",
"permlevel": 0,
"parentfield": "permissions"
@ -51,25 +37,44 @@
"doctype": "DocType"
},
{
"cancel": 1,
"role": "Accounts Manager",
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "Currency Name",
"oldfieldname": "currency_name",
"fieldname": "currency_name",
"fieldtype": "Data",
"reqd": 1
},
{
"doctype": "DocField",
"label": "Fraction",
"fieldname": "fraction",
"fieldtype": "Data"
},
{
"doctype": "DocField",
"label": "Fraction Units",
"fieldname": "fraction_units",
"fieldtype": "Int"
},
{
"doctype": "DocField",
"label": "Symbol",
"fieldname": "symbol",
"fieldtype": "Data"
},
{
"amend": 0,
"create": 1,
"doctype": "DocPerm",
"submit": 0,
"write": 1,
"report": 1,
"role": "System Manager",
"cancel": 1
},
{
"role": "All",
"doctype": "DocPerm"
},
{
"amend": 0,
"cancel": 1,
"role": "Sales Master Manager",
"doctype": "DocPerm",
"submit": 0
},
{
"amend": 0,
"cancel": 0,
"role": "Purchase Master Manager",
"doctype": "DocPerm",
"submit": 0
},
{
"doctype": "DocField"
}
]

View File

@ -50,33 +50,37 @@ class DocType:
master_dict = {'Fiscal Year':{
'year': curr_fiscal_year,
'year_start_date': fy_start_date,
'company': args.get('company_name')}}
}}
self.create_records(master_dict)
# Company
master_dict = {'Company':{'company_name':args.get('company_name'),
'abbr':args.get('company_abbr'),
'default_currency':args.get('currency')
}}
master_dict = {'Company': {
'company_name':args.get('company_name'),
'abbr':args.get('company_abbr'),
'default_currency':args.get('currency')
}}
self.create_records(master_dict)
def_args = {'current_fiscal_year':curr_fiscal_year,
'default_currency': args.get('currency'),
'default_company':args.get('company_name'),
'default_valuation_method':'FIFO',
'default_stock_uom':'Nos',
'date_format':'dd-mm-yyyy',
'default_currency_format':'Lacs',
'so_required':'No',
'dn_required':'No',
'po_required':'No',
'pr_required':'No',
'emp_created_by':'Naming Series',
'cust_master_name':'Customer Name',
'supp_master_name':'Supplier Name',
'default_currency_format': \
(args.get('currency')=='INR') and 'Lacs' or 'Millions'
}
def_args = {
'current_fiscal_year':curr_fiscal_year,
'default_currency': args.get('currency'),
"default_fraction_currency": webnotes.conn.get_value("Currency",
args.get("currency"), "fraction"),
'default_company':args.get('company_name'),
'default_valuation_method':'FIFO',
'default_stock_uom':'Nos',
'date_format': webnotes.conn.get_value("Country",
args.get("country"), "date_format"),
'so_required':'No',
'dn_required':'No',
'po_required':'No',
'pr_required':'No',
'emp_created_by':'Naming Series',
'cust_master_name':'Customer Name',
'supp_master_name':'Supplier Name',
'default_currency_format': \
(args.get('currency')=='INR') and 'Lacs' or 'Millions'
}
# Set
self.set_defaults(def_args)
@ -185,8 +189,6 @@ class DocType:
return fy, stdt, abbr
# Create Company and Fiscal Year
# -------------------------------
def create_records(self, master_dict):
for d in master_dict.keys():
rec = Document(d)
@ -234,18 +236,12 @@ class DocType:
on duplicate key update `password`=password(%s)""",
(user_email, pwd, pwd))
self.add_roles(pr)
def add_roles(self, pr):
roles_list = ['Accounts Manager', 'Accounts User', 'Blogger', 'HR Manager', 'HR User', 'Maintenance User', 'Maintenance Manager', 'Material Manager', 'Material User', 'Material Master Manager', 'Manufacturing Manager', 'Manufacturing User', 'Projects User', 'Purchase Manager', 'Purchase User', 'Purchase Master Manager', 'Quality Manager', 'Sales Manager', 'Sales User', 'Sales Master Manager', 'Support Manager', 'Support Team', 'System Manager', 'Website Manager']
for r in roles_list:
d = addchild(pr, 'userroles', 'UserRole')
d.role = r
d.save(1)
# Add roles to Administrator profile
pr = Document('Profile','Administrator')
for r in roles_list:
d = addchild(pr,'userroles', 'UserRole')
d.role = r
d.save(1)
self.add_all_roles_to(pr.name)
def add_all_roles_to(name):
profile = webnotes.doc("Profile", name)
for role in webnotes.conn.sql("""select name from tabRole"""):
if role[0] not in ["Administrator", "Guest", "All", "Customer", "Supplier", "Partner"]:
d = profile.addchild("userroles", "UserRole")
d.role = role[0]
d.insert()

View File

@ -1,18 +0,0 @@
[
"Item Classification",
"Webforms",
"Modules Setup",
"Email Settings for Outgoing and Incoming Emails.",
"Standard Terms and Conditions that can be added to Sales and Purchases.Examples:1. Validity of the offer.1. Payment Terms (In Advance, On Credit, part advance etc).1. What is extra (or payable by the Customer).1. Safety / usage warning.1. Warranty if any.1. Returns Policy.1. Terms of shipping, if applicable.1. Ways of addressing disputes, indemnity, liability, etc.1. Address and Contact of your Company.",
"Price List Master",
"**Currency** Master",
"Send automatic emails to Contacts on Submitting transactions.",
"Setup",
"Send regular summary reports via Email.",
"A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.",
"Classification of Customers by region",
"Set prefix for numbering series on your transactions",
"All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.",
"Permission Engine",
"Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization."
]

View File

@ -1,18 +0,0 @@
{
"**Currency** Master": "** \u092e\u0941\u0926\u094d\u0930\u093e ** \u092e\u093e\u0938\u094d\u091f\u0930",
"A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.": "\u090f\u0915 \u0924\u0940\u0938\u0930\u0947 \u092a\u0915\u094d\u0937 \u0915\u0947 \u0935\u093f\u0924\u0930\u0915 / \u0921\u0940\u0932\u0930 / \u0915\u092e\u0940\u0936\u0928 \u090f\u091c\u0947\u0902\u091f / \u0938\u0939\u092c\u0926\u094d\u0927 / \u092a\u0941\u0928\u0930\u094d\u0935\u093f\u0915\u094d\u0930\u0947\u0924\u093e \u091c\u094b \u090f\u0915 \u0906\u092f\u094b\u0917 \u0915\u0947 \u0932\u093f\u090f \u0915\u0902\u092a\u0928\u093f\u092f\u094b\u0902 \u0915\u0947 \u0909\u0924\u094d\u092a\u093e\u0926\u094b\u0902 \u0915\u094b \u092c\u0947\u091a\u0924\u093e \u0939\u0948.",
"All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.": "\u0938\u092d\u0940 \u092c\u093f\u0915\u094d\u0930\u0940 \u0932\u0947\u0928\u0926\u0947\u0928 \u0915\u0908 ** \u092c\u093f\u0915\u094d\u0930\u0940 \u0935\u094d\u092f\u0915\u094d\u0924\u093f\u092f\u094b\u0902 ** \u0907\u0924\u0928\u0940 \u0939\u0948 \u0915\u093f \u0906\u092a \u0938\u0947\u091f \u0914\u0930 \u0932\u0915\u094d\u0937\u094d\u092f\u094b\u0902 \u0915\u0940 \u0928\u093f\u0917\u0930\u093e\u0928\u0940 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0915\u0947 \u0916\u093f\u0932\u093e\u092b \u091a\u093f\u0939\u094d\u0928\u093f\u0924 \u0915\u093f\u092f\u093e \u091c\u093e \u0938\u0915\u0924\u093e \u0939\u0948.",
"Classification of Customers by region": "\u0917\u094d\u0930\u093e\u0939\u0915 \u0915\u0947 \u0915\u094d\u0937\u0947\u0924\u094d\u0930 \u0926\u094d\u0935\u093e\u0930\u093e \u0935\u0930\u094d\u0917\u0940\u0915\u0930\u0923",
"Email Settings for Outgoing and Incoming Emails.": "\u0928\u093f\u0935\u0930\u094d\u0924\u092e\u093e\u0928 \u0914\u0930 \u0906\u0928\u0947 \u0935\u093e\u0932\u0940 \u0908\u092e\u0947\u0932 \u0915\u0947 \u0932\u093f\u090f \u0908\u092e\u0947\u0932 \u0938\u0947\u091f\u093f\u0902\u0917\u094d\u0938.",
"Item Classification": "\u0906\u0907\u091f\u092e \u0935\u0930\u094d\u0917\u0940\u0915\u0930\u0923",
"Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.": "\u0915\u093e\u0928\u0942\u0928\u0940 \u0938\u0902\u0917\u0920\u0928 \u0938\u0947 \u0938\u0902\u092c\u0902\u0927\u093f\u0924 \u0916\u093e\u0924\u094b\u0902 \u0915\u0940 \u090f\u0915 \u0905\u0932\u0917 \u091a\u093e\u0930\u094d\u091f \u0915\u0947 \u0938\u093e\u0925 \u0907\u0915\u093e\u0908 / \u0938\u0939\u093e\u092f\u0915.",
"Modules Setup": "\u092e\u0949\u0921\u094d\u092f\u0942\u0932 \u0938\u0947\u091f\u0905\u092a",
"Permission Engine": "\u0905\u0928\u0941\u092e\u0924\u093f \u0907\u0902\u091c\u0928",
"Price List Master": "\u092e\u0942\u0932\u094d\u092f \u0938\u0942\u091a\u0940 \u092e\u093e\u0938\u094d\u091f\u0930",
"Send automatic emails to Contacts on Submitting transactions.": "\u0932\u0947\u0928\u0926\u0947\u0928 \u092d\u0947\u091c\u0928\u0947 \u092a\u0930 \u0938\u0902\u092a\u0930\u094d\u0915 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0938\u094d\u0935\u0924: \u0908\u092e\u0947\u0932 \u092d\u0947\u091c\u0947\u0902.",
"Send regular summary reports via Email.": "\u0908\u092e\u0947\u0932 \u0915\u0947 \u092e\u093e\u0927\u094d\u092f\u092e \u0938\u0947 \u0928\u093f\u092f\u092e\u093f\u0924 \u0930\u0942\u092a \u0938\u0947 \u0938\u093e\u0930\u093e\u0902\u0936 \u0930\u093f\u092a\u094b\u0930\u094d\u091f \u092d\u0947\u091c\u0947\u0902.",
"Set prefix for numbering series on your transactions": "\u0905\u092a\u0928\u0947 \u0932\u0947\u0928\u0926\u0947\u0928 \u092a\u0930 \u0936\u094d\u0930\u0943\u0902\u0916\u0932\u093e \u0928\u0902\u092c\u0930\u093f\u0902\u0917 \u0915\u0947 \u0932\u093f\u090f \u0909\u092a\u0938\u0930\u094d\u0917 \u0938\u0947\u091f",
"Setup": "\u0935\u094d\u092f\u0935\u0938\u094d\u0925\u093e",
"Standard Terms and Conditions that can be added to Sales and Purchases.Examples:1. Validity of the offer.1. Payment Terms (In Advance, On Credit, part advance etc).1. What is extra (or payable by the Customer).1. Safety / usage warning.1. Warranty if any.1. Returns Policy.1. Terms of shipping, if applicable.1. Ways of addressing disputes, indemnity, liability, etc.1. Address and Contact of your Company.": "1: \u092e\u093e\u0928\u0915 \u0928\u093f\u092f\u092e\u094b\u0902 \u0914\u0930 \u0936\u0930\u094d\u0924\u094b\u0902 \u0915\u093f \u092c\u093f\u0915\u094d\u0930\u0940 \u0914\u0930 Purchases.Examples \u0915\u0947 \u0932\u093f\u090f \u091c\u094b\u0921\u093c\u093e \u091c\u093e \u0938\u0915\u0924\u093e \u0939\u0948. Offer.1 \u0915\u0940 \u0935\u0948\u0927\u0924\u093e. \u092d\u0941\u0917\u0924\u093e\u0928 (\u090f\u0921\u0935\u093e\u0902\u0938 \u092e\u0947\u0902, \u0915\u094d\u0930\u0947\u0921\u093f\u091f, \u092d\u093e\u0917 \u0905\u0917\u094d\u0930\u093f\u092e \u0906\u0926\u093f) \u0936\u0930\u094d\u0924\u0947\u0902 .1. \u0915\u094d\u092f\u093e (\u092f\u093e \u0917\u094d\u0930\u093e\u0939\u0915 \u0926\u094d\u0935\u093e\u0930\u093e \u0926\u0947\u092f) \u0905\u0924\u093f\u0930\u093f\u0915\u094d\u0924 .1 \u0939\u0948. / \u0938\u0941\u0930\u0915\u094d\u0937\u093e warning.1 \u0909\u092a\u092f\u094b\u0917. \u0935\u093e\u0930\u0902\u091f\u0940 \u0905\u0917\u0930 any.1. Policy.1 \u0926\u0947\u0924\u093e \u0939\u0948. \u0936\u093f\u092a\u093f\u0902\u0917 \u0915\u0947 applicable.1 \u0905\u0917\u0930 \u0936\u0930\u094d\u0924\u0947\u0902. \u0935\u093f\u0935\u093e\u0926\u094b\u0902 \u0915\u094b \u0938\u0902\u092c\u094b\u0927\u093f\u0924 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0924\u0930\u0940\u0915\u0947, \u0915\u094d\u0937\u0924\u093f\u092a\u0942\u0930\u094d\u0924\u093f, \u0926\u093e\u092f\u093f\u0924\u094d\u0935, etc.1. \u092a\u0924\u093e \u0939\u0948 \u0914\u0930 \u0905\u092a\u0928\u0940 \u0915\u0902\u092a\u0928\u0940 \u0915\u0947 \u0938\u0902\u092a\u0930\u094d\u0915 \u0915\u0930\u0947\u0902.",
"Webforms": "WebForms"
}

180
startup/install.py Normal file
View File

@ -0,0 +1,180 @@
from __future__ import unicode_literals
import webnotes
def pre_import():
webnotes.conn.begin()
make_modules()
make_roles()
webnotes.conn.commit()
webnotes.reload_doc("utilities", "doctype", "gl_mapper")
webnotes.reload_doc("utilities", "doctype", "gl_mapper_detail")
def make_modules():
modules = [
" Home", " System", " Utilities", " Website", " Setup",
" Selling", " Buying", " Projects", " Accounts", " Stock",
" Support", " HR", " Manufacturing"]
for m in modules:
doc = webnotes.doc(fielddata = {
"doctype": "Module Def",
"module_name": m,
"disabled":"No"
})
doc.insert()
def make_roles():
roles = [
"Accounts Manager", "Accounts User", "Analytics", "Auditor",
"Blogger", "Customer", "Employee", "Expense Approver",
"HR Manager", "HR User", "Leave Approver", "Maintenance Manager",
"Maintenance User", "Manufacturing Manager", "Manufacturing User",
"Material Manager", "Material Master Manager", "Material User",
"Partner", "Projects User", "Purchase Manager", "Purchase Master Manager",
"Purchase User", "Quality Manager", "Sales Manager",
"Sales Master Manager", "Sales User", "Supplier", "Support Manager",
"Support Team"]
for r in roles:
doc = webnotes.doc(fielddata = {
"doctype":"Role",
"role_name": r
})
doc.insert()
def post_import():
webnotes.conn.begin()
# feature setup
import_defaults()
import_country_and_currency()
# home page
webnotes.conn.set_value('Control Panel', None, 'home_page', 'desktop')
# features
feature_setup()
# all roles to Administrator
from setup.doctype.setup_control.setup_control import add_all_roles_to
add_all_roles_to("Administrator")
webnotes.conn.commit()
def feature_setup():
"""save global defaults and features setup"""
doc = webnotes.doc("Features Setup", "Features Setup")
# store value as 1 for all these fields
flds = ['fs_item_serial_nos', 'fs_item_batch_nos', 'fs_brands', 'fs_item_barcode',
'fs_item_advanced', 'fs_packing_details', 'fs_item_group_in_details',
'fs_exports', 'fs_imports', 'fs_discounts', 'fs_purchase_discounts',
'fs_after_sales_installations', 'fs_projects', 'fs_sales_extras',
'fs_recurring_invoice', 'fs_pos', 'fs_manufacturing', 'fs_quality',
'fs_page_break', 'fs_more_info'
]
doc.fields.update(dict(zip(flds, [1]*len(flds))))
doc.save()
def import_country_and_currency():
from webnotes.country_info import get_all
data = get_all()
for name in data:
country = webnotes._dict(data[name])
webnotes.doc({
"doctype": "Country",
"country_name": name,
"date_format": country.date_format or "dd-mm-yyyy",
"time_zones": "\n".join(country.timezones or [])
}).insert()
if country.currency:
webnotes.doc({
"doctype": "Currency",
"currency_name": country.currency,
"fraction": country.currency_fraction,
"symbol": country.currency_symbol,
"fraction_units": country.currency_fraction_units
}).insert()
def import_defaults():
records = [
# item group
{'doctype': 'Item Group', 'item_group_name': 'All Item Groups', 'is_group': 'Yes', 'name': 'All Item Groups', 'parent_item_group': ''},
{'doctype': 'Item Group', 'item_group_name': 'Default', 'is_group': 'No', 'name': 'Default', 'parent_item_group': 'All Item Groups'},
# deduction type
{'doctype': 'Deduction Type', 'name': 'Income Tax', 'description': 'Income Tax', 'deduction_name': 'Income Tax'},
{'doctype': 'Deduction Type', 'name': 'Professional Tax', 'description': 'Professional Tax', 'deduction_name': 'Professional Tax'},
{'doctype': 'Deduction Type', 'name': 'Provident Fund', 'description': 'Provident fund', 'deduction_name': 'Provident Fund'},
# earning type
{'doctype': 'Earning Type', 'name': 'Basic', 'description': 'Basic', 'earning_name': 'Basic', 'taxable': 'Yes'},
{'doctype': 'Earning Type', 'name': 'House Rent Allowance', 'description': 'House Rent Allowance', 'earning_name': 'House Rent Allowance', 'taxable': 'No'},
# expense claim type
{'doctype': 'Expense Claim Type', 'name': 'Calls', 'expense_type': 'Calls'},
{'doctype': 'Expense Claim Type', 'name': 'Food', 'expense_type': 'Food'},
{'doctype': 'Expense Claim Type', 'name': 'Medical', 'expense_type': 'Medical'},
{'doctype': 'Expense Claim Type', 'name': 'Others', 'expense_type': 'Others'},
{'doctype': 'Expense Claim Type', 'name': 'Travel', 'expense_type': 'Travel'},
# leave type
{'doctype': 'Leave Type', 'leave_type_name': 'Casual Leave', 'name': 'Casual Leave', 'is_encash': 1, 'is_carry_forward': 1, 'max_days_allowed': '3', },
{'doctype': 'Leave Type', 'leave_type_name': 'Compensatory Off', 'name': 'Compensatory Off', 'is_encash': 0, 'is_carry_forward': 0, },
{'doctype': 'Leave Type', 'leave_type_name': 'Sick Leave', 'name': 'Sick Leave', 'is_encash': 0, 'is_carry_forward': 0, },
{'doctype': 'Leave Type', 'leave_type_name': 'Privilege Leave', 'name': 'Privilege Leave', 'is_encash': 0, 'is_carry_forward': 0, },
{'doctype': 'Leave Type', 'leave_type_name': 'Leave Without Pay', 'name': 'Leave Without Pay', 'is_encash': 0, 'is_carry_forward': 0, 'is_lwp':1},
# territory
{'doctype': 'Territory', 'territory_name': 'All Territories', 'is_group': 'Yes', 'name': 'All Territories', 'parent_territory': ''},
{'doctype': 'Territory', 'territory_name': 'Default', 'is_group': 'No', 'name': 'Default', 'parent_territory': 'All Territories'},
# customer group
{'doctype': 'Customer Group', 'customer_group_name': 'All Customer Groups', 'is_group': 'Yes', 'name': 'All Customer Groups', 'parent_customer_group': ''},
{'doctype': 'Customer Group', 'customer_group_name': 'Default Customer Group', 'is_group': 'No', 'name': 'Default Customer Group', 'parent_customer_group': 'All Customer Groups'},
# supplier type
{'doctype': 'Supplier Type', 'name': 'Default Supplier Type', 'supplier_type': 'Default Supplier Type'},
# Price List
{'doctype': 'Price List', 'name': 'Default Price List', 'price_list_name': 'Default Price List'},
{'doctype': 'Price List', 'name': 'Standard', 'price_list_name': 'Standard'},
# warehouse type
{'doctype': 'Warehouse Type', 'name': 'Default Warehouse Type', 'warehouse_type': 'Default Warehouse Type'},
{'doctype': 'Warehouse Type', 'name': 'Fixed Asset', 'warehouse_type': 'Fixed Asset'},
{'doctype': 'Warehouse Type', 'name': 'Reserved', 'warehouse_type': 'Reserved'},
{'doctype': 'Warehouse Type', 'name': 'Rejected', 'warehouse_type': 'Rejected'},
{'doctype': 'Warehouse Type', 'name': 'Sample', 'warehouse_type': 'Sample'},
{'doctype': 'Warehouse Type', 'name': 'Stores', 'warehouse_type': 'Stores'},
{'doctype': 'Warehouse Type', 'name': 'WIP Warehouse', 'warehouse_type': 'WIP Warehouse'},
# warehouse
{'doctype': 'Warehouse', 'warehouse_name': 'Default Warehouse', 'name': 'Default Warehouse', 'warehouse_type': 'Default Warehouse Type'},
# Workstation
{'doctype': 'Workstation', 'name': 'Default Workstation', 'workstation_name': 'Default Workstation', 'warehouse': 'Default Warehouse'},
# Sales Person
{'doctype': 'Sales Person', 'name': 'All Sales Persons', 'sales_person_name': 'All Sales Persons', 'is_group': "Yes", "parent_sales_person": ""},
# UOM
{'uom_name': 'Unit', 'doctype': 'UOM', 'name': 'Unit'},
{'uom_name': 'Box', 'doctype': 'UOM', 'name': 'Box'},
{'uom_name': 'Ft', 'doctype': 'UOM', 'name': 'Ft'},
{'uom_name': 'Kg', 'doctype': 'UOM', 'name': 'Kg'},
{'uom_name': 'Ltr', 'doctype': 'UOM', 'name': 'Ltr'},
{'uom_name': 'Meter', 'doctype': 'UOM', 'name': 'Meter'},
{'uom_name': 'Mtr', 'doctype': 'UOM', 'name': 'Mtr'},
{'uom_name': 'Nos', 'doctype': 'UOM', 'name': 'Nos'},
{'uom_name': 'Pair', 'doctype': 'UOM', 'name': 'Pair'},
{'uom_name': 'Set', 'doctype': 'UOM', 'name': 'Set'},
{'uom_name': 'Hour', 'doctype': 'UOM', 'name': 'Hour'},
{'uom_name': 'Minute', 'doctype': 'UOM', 'name': 'Minute'},
]
for r in records:
doc = webnotes.doc(r)
doc.insert()

View File

@ -1 +0,0 @@
[{'creation': '2010-07-16 11:03:21', 'doctype': 'Item Group', 'lft': 1, 'owner': 'harshada@webnotestech.com', 'rgt': 286, 'company_abbr': None, 'docstatus': 0, 'item_group_name': 'All Item Groups', 'description': None, 'parent': None, 'is_group': 'Yes', 'company': None, 'show_in_catalogue': None, 'group_or_ledger': None, 'modified_by': 'harshada@webnotestech.com', 'group_name': None, 'trash_reason': None, 'name': 'All Item Groups', 'idx': None, 'modified': '2010-07-16 11:03:21', 'parent_item_group': '', 'old_parent': '', 'parenttype': None, 'parentfield': None}]

View File

@ -1 +0,0 @@
[{'creation': '2010-07-05 16:08:14', 'doctype': 'Item Group', 'lft': 76, 'owner': 'nabin@webnotestech.com', 'rgt': 77, 'company_abbr': None, 'docstatus': 0, 'item_group_name': 'Default', 'description': None, 'parent': None, 'is_group': 'No', 'company': None, 'show_in_catalogue': None, 'group_or_ledger': None, 'modified_by': 'nabin@webnotestech.com', 'group_name': None, 'trash_reason': None, 'name': 'Default', 'idx': None, 'modified': '2010-07-05 16:08:14', 'parent_item_group': 'All Item Groups', 'old_parent': '', 'parenttype': None, 'parentfield': None}]

View File

@ -4,4 +4,7 @@ install_docs = [
{"doctype":"Role", "role_name":"Material Master Manager", "name":"Material Master Manager"},
{"doctype":"Role", "role_name":"Material User", "name":"Material User"},
{"doctype":"Role", "role_name":"Quality Manager", "name":"Quality Manager"},
{"doctype":"Item Group", "item_group_name":"All Item Groups", "is_group":"Yes"},
{"doctype":"Item Group", "item_group_name":"Default",
"parent_item_group":"All Item Groups", "is_group":"No"},
]

View File

@ -77,7 +77,7 @@ class DocType:
def update_website(self):
from website.utils import update_page_name
update_page_name(self.doc, self.doc.item_name)
update_page_name(self.doc, self.doc.name + " " + self.doc.item_name)
from website.helpers.product import invalidate_cache_for
invalidate_cache_for(self.doc.item_group)

View File

@ -117,7 +117,7 @@ class DocType:
from `tabDelivery Note Item` dni
where parent=%s and item_code in (%s)
group by item_code""" % ("%s", ", ".join(["%s"]*len(items))),
tuple([self.doc.delivery_note] + items), as_dict=1, debug=1)
tuple([self.doc.delivery_note] + items), as_dict=1)
ps_item_qty = dict([[d.item_code, d.qty] for d in self.doclist])
@ -170,9 +170,6 @@ class DocType:
webnotes.msgprint("Invalid new packed quantity for item %s. \
Please try again or contact support@erpnext.com" % item['item_code'], raise_exception=1)
delivery_note_item = webnotes.conn.get_value("Delivery Note Item", {
"parent": self.doc.delivery_note, "item_code": item["item_code"]})
webnotes.conn.sql("""\
UPDATE `tabDelivery Note Item`
SET packed_qty = %s

View File

@ -211,7 +211,6 @@ cur_frm.cscript.make_jv = function(doc, dr_or_cr, children) {
jv.fiscal_year = sys_defaults.fiscal_year;
jv.is_opening = 'No';
jv.posting_date = doc.return_date;
jv.voucher_date = dateutil.obj_to_str(new Date());
// Add children
if(children) {

View File

@ -1,18 +0,0 @@
[
"Ordered Items To Be Delivered",
"A logical Warehouse against which stock entries are made.",
"For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes",
"Featured Item in Item Group",
"Stock Analytics",
"Distinct unit of an Item",
"Stock Home",
"Item-Wise Price List",
"Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. The package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".For Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.Note: BOM = Bill of Materials",
"Stock Level",
"Table for Item that will be shown in Web Site",
"Stock Ageing",
"Stock Balance",
"A Product or a Service that is bought, sold or kept in stock.",
"Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.",
"Stock Ledger"
]

View File

@ -1,18 +0,0 @@
{
"A Product or a Service that is bought, sold or kept in stock.": "\u090f\u0915 \u0909\u0924\u094d\u092a\u093e\u0926 \u092f\u093e \u0938\u0947\u0935\u093e \u0939\u0948 \u0915\u093f \u0916\u0930\u0940\u0926\u093e \u0939\u0948, \u092c\u0947\u091a\u093e \u092f\u093e \u0938\u094d\u091f\u0949\u0915 \u092e\u0947\u0902 \u0930\u0916\u093e.",
"A logical Warehouse against which stock entries are made.": "\u090f\u0915 \u0924\u093e\u0930\u094d\u0915\u093f\u0915 \u0935\u0947\u092f\u0930\u0939\u093e\u0909\u0938 \u0915\u0947 \u0916\u093f\u0932\u093e\u092b \u091c\u094b \u0936\u0947\u092f\u0930 \u092a\u094d\u0930\u0935\u093f\u0937\u094d\u091f\u093f\u092f\u094b\u0902 \u092c\u0928\u093e \u0930\u0939\u0947 \u0939\u0948\u0902.",
"Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. The package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".For Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.Note: BOM = Bill of Materials": "** \u0906\u0907\u091f\u092e \u0915\u0947 \u0938\u0915\u0932 \u0938\u092e\u0942\u0939 \u092e\u0947\u0902 \u090f\u0915 \u0914\u0930 \u0906\u0907\u091f\u092e ** **. \u092f\u0939 \u0909\u092a\u092f\u094b\u0917\u0940 \u0939\u0948 \u0905\u0917\u0930 \u0906\u092a \u090f\u0915 \u092a\u0948\u0915\u0947\u091c \u092e\u0947\u0902 ** \u0915\u0941\u091b ** \u0906\u0907\u091f\u092e bundling \u0939\u0948\u0902 \u0914\u0930 \u0906\u092a \u092a\u0948\u0915 ** \u0914\u0930 \u0928\u0939\u0940\u0902 \u0915\u0941\u0932 ** \u0906\u0907\u091f\u092e ** ** \u0906\u0907\u091f\u092e \u0915\u0947 \u0938\u094d\u091f\u0949\u0915 \u0915\u094b \u092c\u0928\u093e\u090f \u0930\u0916\u0928\u0947. \u092a\u0948\u0915\u0947\u091c ** \u0906\u0907\u091f\u092e ** \u0939\u0948 &quot;\u0938\u094d\u091f\u0949\u0915 \u0906\u0907\u091f\u092e \u0939\u0948&quot; &quot;\u0928\u0939\u0940\u0902&quot; \u0915\u0947 \u0930\u0942\u092a \u092e\u0947\u0902 \u0914\u0930 \u0915\u0947 \u0930\u0942\u092a \u092e\u0947\u0902 &quot;\u0939\u093e\u0901&quot; &quot;\u092c\u093f\u0915\u094d\u0930\u0940 \u0906\u0907\u091f\u092e \u0939\u0948,&quot; \u0909\u0926\u093e\u0939\u0930\u0923 \u0915\u0947 \u0932\u093f\u090f: \u092f\u0926\u093f \u0906\u092a \u0932\u0948\u092a\u091f\u0949\u092a \u0914\u0930 Backpacks \u092c\u0947\u091a \u0930\u0939\u0947 \u0939\u0948\u0902 \u0914\u0930 \u0905\u0932\u0917 \u0938\u0947 \u090f\u0915 \u0935\u093f\u0936\u0947\u0937 \u092e\u0942\u0932\u094d\u092f \u0939\u0948 \u0905\u0917\u0930 \u0917\u094d\u0930\u093e\u0939\u0915 \u0926\u094b\u0928\u094b\u0902 \u0916\u0930\u0940\u0926\u0924\u093e BOM = \u0935\u093f\u0927\u0947\u092f\u0915 \u0915\u0940 \u0938\u093e\u092e\u0917\u094d\u0930\u0940:, \u0924\u094b \u090f\u0915 \u0928\u092f\u093e \u0932\u0948\u092a\u091f\u0949\u092a + \u092c\u0948\u0917 \u092c\u093f\u0915\u094d\u0930\u0940 \u092c\u0940\u0913\u090f\u092e Item.Note \u0939\u094b\u0917\u093e",
"Distinct unit of an Item": "\u090f\u0915 \u0906\u0907\u091f\u092e \u0915\u0940 \u0905\u0932\u0917 \u0907\u0915\u093e\u0908",
"Featured Item in Item Group": "\u0906\u0907\u091f\u092e \u0938\u092e\u0942\u0939 \u092e\u0947\u0902 \u091a\u093f\u0924\u094d\u0930\u093f\u0924 \u0906\u0907\u091f\u092e",
"For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes": "\u0917\u094d\u0930\u093e\u0939\u0915\u094b\u0902 \u0915\u0940 \u0938\u0941\u0935\u093f\u0927\u093e \u0915\u0947 \u0932\u093f\u090f \u0907\u0928 \u0915\u094b\u0921 \u092a\u094d\u0930\u093f\u0902\u091f \u0938\u094d\u0935\u0930\u0942\u092a\u094b\u0902 \u092e\u0947\u0902 \u091a\u093e\u0932\u093e\u0928 \u0914\u0930 \u0935\u093f\u0924\u0930\u0923 \u0928\u094b\u091f \u0915\u0940 \u0924\u0930\u0939 \u0907\u0938\u094d\u0924\u0947\u092e\u093e\u0932 \u0915\u093f\u092f\u093e \u091c\u093e \u0938\u0915\u0924\u093e \u0939\u0948",
"Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.": "\u0926\u093f\u092f\u093e \u091c\u093e \u0938\u0902\u0915\u0941\u0932 \u0915\u0947 \u0932\u093f\u090f \u0928\u093f\u0915\u0932 \u091c\u093e\u0924\u093e \u0939\u0948 \u092a\u0948\u0915\u093f\u0902\u0917 \u0909\u0924\u094d\u092a\u0928\u094d\u0928 \u0915\u0930\u0924\u093e \u0939\u0948. \u092a\u0948\u0915\u0947\u091c \u0938\u0902\u0916\u094d\u092f\u093e, \u092a\u0948\u0915\u0947\u091c \u0938\u093e\u092e\u0917\u094d\u0930\u0940 \u0914\u0930 \u0905\u092a\u0928\u0947 \u0935\u091c\u0928 \u0915\u094b \u0938\u0942\u091a\u093f\u0924 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0915\u093f\u092f\u093e \u091c\u093e\u0924\u093e \u0939\u0948.",
"Item-Wise Price List": "\u0906\u0907\u091f\u092e \u0935\u093e\u0930 \u092e\u0942\u0932\u094d\u092f \u0938\u0942\u091a\u0940",
"Ordered Items To Be Delivered": "\u0939\u093f\u0938\u093e\u092c \u0938\u0947 \u0926\u093f\u092f\u093e \u091c\u093e \u0906\u0907\u091f\u092e",
"Stock Ageing": "\u0938\u094d\u091f\u0949\u0915 \u092c\u0942\u0922\u093c\u0947",
"Stock Analytics": "\u0938\u094d\u091f\u0949\u0915 \u0935\u093f\u0936\u094d\u0932\u0947\u0937\u093f\u0915\u0940",
"Stock Balance": "\u092c\u093e\u0915\u0940 \u0938\u094d\u091f\u093e\u0915",
"Stock Home": "\u0938\u094d\u091f\u0949\u0915 \u0939\u094b\u092e",
"Stock Ledger": "\u0938\u094d\u091f\u0949\u0915 \u0932\u0947\u091c\u0930",
"Stock Level": "\u0938\u094d\u091f\u0949\u0915 \u0938\u094d\u0924\u0930",
"Table for Item that will be shown in Web Site": "\u091f\u0947\u092c\u0932 \u0906\u0907\u091f\u092e \u0915\u0947 \u0932\u093f\u090f \u0939\u0948 \u0915\u093f \u0935\u0947\u092c \u0938\u093e\u0907\u091f \u092e\u0947\u0902 \u0926\u093f\u0916\u093e\u092f\u093e \u091c\u093e\u090f\u0917\u093e"
}

View File

@ -54,16 +54,13 @@ def update_entries_after(args, verbose=1):
if not validate_negative_stock(qty_after_transaction, sle):
qty_after_transaction += flt(sle.actual_qty)
continue
if sle.serial_no:
valuation_rate = get_serialized_values(qty_after_transaction, sle,
valuation_rate)
valuation_rate = get_serialized_values(qty_after_transaction, sle, valuation_rate)
elif valuation_method == "Moving Average":
valuation_rate = get_moving_average_values(qty_after_transaction, sle,
valuation_rate)
valuation_rate = get_moving_average_values(qty_after_transaction, sle, valuation_rate)
else:
valuation_rate = get_fifo_values(qty_after_transaction, sle,
stock_queue)
valuation_rate = get_fifo_values(qty_after_transaction, sle, stock_queue)
qty_after_transaction += flt(sle.actual_qty)

View File

@ -111,7 +111,7 @@ def get_fifo_rate(previous_stock_queue, qty):
else:
outgoing_cost = 0
qty_to_pop = abs(qty)
while qty_to_pop:
while qty_to_pop and previous_stock_queue:
batch = previous_stock_queue[0]
if 0 < batch[0] <= qty_to_pop:
# if batch qty > 0
@ -124,8 +124,8 @@ def get_fifo_rate(previous_stock_queue, qty):
outgoing_cost += flt(qty_to_pop) * flt(batch[1])
batch[0] -= qty_to_pop
qty_to_pop = 0
return outgoing_cost / abs(qty)
# if queue gets blank and qty_to_pop remaining, get average rate of full queue
return outgoing_cost / abs(qty) - qty_to_pop
def get_valid_serial_nos(sr_nos, qty=0, item_code=''):
"""split serial nos, validate and return list of valid serial nos"""

View File

@ -1,5 +0,0 @@
[
"Create and Send Newsletters",
"Support Analytics",
"Support Home"
]

View File

@ -1,5 +0,0 @@
{
"Create and Send Newsletters": "\u0938\u092e\u093e\u091a\u093e\u0930\u092a\u0924\u094d\u0930\u093f\u0915\u093e\u090f\u0901 \u092c\u0928\u093e\u090f\u0901 \u0914\u0930 \u092d\u0947\u091c\u0947\u0902",
"Support Analytics": "\u0938\u092e\u0930\u094d\u0925\u0928 \u0935\u093f\u0936\u094d\u0932\u0947\u0937\u093f\u0915\u0940",
"Support Home": "\u0938\u092e\u0930\u094d\u0925\u0928 \u092e\u0941\u0916"
}

View File

@ -1,11 +0,0 @@
[
"Users",
"To Do",
"Markdown Reference",
"Messages",
"question-view",
"WIP Monitor",
"questions",
"Calendar",
"Trash"
]

View File

@ -1,11 +0,0 @@
{
"Calendar": "\u0915\u0948\u0932\u0947\u0902\u0921\u0930",
"Markdown Reference": "Markdown \u0938\u0902\u0926\u0930\u094d\u092d",
"Messages": "\u0938\u0902\u0926\u0947\u0936",
"To Do": "\u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0915\u094d\u092f\u093e",
"Trash": "\u0915\u091a\u0930\u093e \u092a\u0947\u091f\u0940",
"Users": "\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e",
"WIP Monitor": "WIP \u092e\u0949\u0928\u093f\u091f\u0930",
"question-view": "\u0938\u0935\u093e\u0932 \u0926\u0943\u0936\u094d\u092f",
"questions": "\u0938\u0935\u093e\u0932\u094b\u0902"
}

View File

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

View File

@ -1,15 +0,0 @@
[
"Settings for Product Catalog on the website",
"",
"Settings for Contact Us Page",
"Cross Listing of Item in multiple groups",
"A Product is shown on the website and is linked to an item.",
"Product Category for website",
"Slideshow like display for the website",
"Page to show on the website",
"Settings for the About Us Page",
"Website Home",
"Unsubscribe",
"Set your background color, font and image (tiled)",
"Script to attach to all web pages."
]

View File

@ -1,14 +0,0 @@
{
"A Product is shown on the website and is linked to an item.": "\u090f\u0915 \u0909\u0924\u094d\u092a\u093e\u0926 \u0915\u0940 \u0935\u0947\u092c\u0938\u093e\u0907\u091f \u092a\u0930 \u0926\u093f\u0916\u093e\u092f\u093e \u091c\u093e\u0924\u093e \u0939\u0948 \u0914\u0930 \u090f\u0915 \u0906\u0907\u091f\u092e \u0915\u0947 \u0932\u093f\u090f \u091c\u0941\u0921\u093c\u093e \u0939\u0941\u0906 \u0939\u0948.",
"Cross Listing of Item in multiple groups": "\u0915\u0908 \u0938\u092e\u0942\u0939\u094b\u0902 \u092e\u0947\u0902 \u0906\u0907\u091f\u092e \u0932\u093f\u0938\u094d\u091f\u093f\u0902\u0917 \u092a\u093e\u0930",
"Page to show on the website": "\u0935\u0947\u092c\u0938\u093e\u0907\u091f \u092a\u0930 \u0926\u093f\u0916\u093e\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f",
"Product Category for website": "\u0935\u0947\u092c\u0938\u093e\u0907\u091f \u0915\u0947 \u0932\u093f\u090f \u0909\u0924\u094d\u092a\u093e\u0926 \u0936\u094d\u0930\u0947\u0923\u0940",
"Script to attach to all web pages.": "\u0938\u094d\u0915\u094d\u0930\u093f\u092a\u094d\u091f \u0938\u092d\u0940 \u0935\u0947\u092c \u092a\u0943\u0937\u094d\u0920\u094b\u0902 \u0915\u0947 \u0932\u093f\u090f \u0926\u0947\u0924\u0947 \u0939\u0948\u0902.",
"Set your background color, font and image (tiled)": "\u0905\u092a\u0928\u0940 \u092a\u0943\u0937\u094d\u0920\u092d\u0942\u092e\u093f \u0930\u0902\u0917, \u092b\u093c\u0949\u0928\u094d\u091f \u0914\u0930 \u091b\u0935\u093f (\u091f\u093e\u0907\u0932\u094b\u0902) \u0938\u0947\u091f",
"Settings for Contact Us Page": "\u0939\u092e\u0938\u0947 \u0938\u0902\u092a\u0930\u094d\u0915 \u0915\u0930\u0947\u0902 \u092a\u0943\u0937\u094d\u0920 \u0915\u0947 \u0932\u093f\u090f \u0938\u0947\u091f\u093f\u0902\u0917\u094d\u0938",
"Settings for Product Catalog on the website": "\u0935\u0947\u092c\u0938\u093e\u0907\u091f \u092a\u0930 \u0909\u0924\u094d\u092a\u093e\u0926 \u0915\u0948\u091f\u0932\u0949\u0917 \u0915\u0947 \u0932\u093f\u090f \u0938\u0947\u091f\u093f\u0902\u0917\u094d\u0938",
"Settings for the About Us Page": "\u0939\u092e\u093e\u0930\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902 \u092a\u0943\u0937\u094d\u0920 \u0915\u0947 \u0932\u093f\u090f \u0938\u0947\u091f\u093f\u0902\u0917\u094d\u0938",
"Slideshow like display for the website": "\u0935\u0947\u092c\u0938\u093e\u0907\u091f \u0915\u0947 \u0932\u093f\u090f \u092a\u094d\u0930\u0926\u0930\u094d\u0936\u0928 \u0915\u0940 \u0924\u0930\u0939 \u0938\u094d\u0932\u093e\u0907\u0921 \u0936\u094b",
"Unsubscribe": "\u0938\u0926\u0938\u094d\u092f\u0924\u093e \u0930\u0926\u094d\u0926 \u0915\u0930\u0947\u0902",
"Website Home": "\u0935\u0947\u092c\u0938\u093e\u0907\u091f \u0915\u0947 \u0939\u094b\u092e"
}

View File

@ -97,7 +97,14 @@ def page_name(title):
import re
name = title.lower()
name = re.sub('[~!@#$%^&*()<>,."\']', '', name)
return '-'.join(name.split()[:8])
name = re.sub('[:/]', '-', name)
name = '-'.join(name.split())
# replace repeating hyphens
name = re.sub(r"(-)\1+", r"\1", name)
return name
def update_page_name(doc, title):
"""set page_name and check if it is unique"""