rename dt first cut
This commit is contained in:
parent
37fb9c8f27
commit
fedfd89e4a
@ -1 +1 @@
|
||||
[{'modified_by': 'Administrator', 'name': 'Payable Voucher', 'parent': None, 'dt_label': 'Purchase Invoice', 'creation': '2010-06-10 10:44:55', 'modified': '2010-06-10 10:44:55', 'module': 'Accounts', 'doctype': 'DocType Label', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'dt': 'Payable Voucher', 'parentfield': None}]
|
||||
[{'modified_by': 'Administrator', 'name': 'Purchase Invoice', 'parent': None, 'dt_label': 'Purchase Invoice', 'creation': '2010-06-10 10:44:55', 'modified': '2010-06-10 10:44:55', 'module': 'Accounts', 'doctype': 'DocType Label', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'dt': 'Purchase Invoice', 'parentfield': None}]
|
@ -1 +1 @@
|
||||
[{'modified_by': 'Administrator', 'name': 'Receivable Voucher', 'parent': None, 'dt_label': 'Sales Invoice', 'creation': '2010-06-10 10:44:40', 'modified': '2010-06-10 10:44:40', 'module': 'Accounts', 'doctype': 'DocType Label', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'dt': 'Receivable Voucher', 'parentfield': None}]
|
||||
[{'modified_by': 'Administrator', 'name': 'Sales Invoice', 'parent': None, 'dt_label': 'Sales Invoice', 'creation': '2010-06-10 10:44:40', 'modified': '2010-06-10 10:44:40', 'module': 'Accounts', 'doctype': 'DocType Label', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'dt': 'Sales Invoice', 'parentfield': None}]
|
@ -1,4 +1,4 @@
|
||||
# DocType Mapper, Delivery Note-Receivable Voucher
|
||||
# DocType Mapper, Delivery Note-Sales Invoice
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -14,7 +14,7 @@
|
||||
{
|
||||
'doctype': 'Table Mapper Detail',
|
||||
'name': '__common__',
|
||||
'parent': 'Delivery Note-Receivable Voucher',
|
||||
'parent': 'Delivery Note-Sales Invoice',
|
||||
'parentfield': 'table_mapper_details',
|
||||
'parenttype': 'DocType Mapper'
|
||||
},
|
||||
@ -23,7 +23,7 @@
|
||||
{
|
||||
'doctype': 'Field Mapper Detail',
|
||||
'name': '__common__',
|
||||
'parent': 'Delivery Note-Receivable Voucher',
|
||||
'parent': 'Delivery Note-Sales Invoice',
|
||||
'parentfield': 'field_mapper_details',
|
||||
'parenttype': 'DocType Mapper'
|
||||
},
|
||||
@ -35,13 +35,13 @@
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'ref_doc_submitted': 1,
|
||||
'to_doctype': 'Receivable Voucher'
|
||||
'to_doctype': 'Sales Invoice'
|
||||
},
|
||||
|
||||
# DocType Mapper, Delivery Note-Receivable Voucher
|
||||
# DocType Mapper, Delivery Note-Sales Invoice
|
||||
{
|
||||
'doctype': u'DocType Mapper',
|
||||
'name': 'Delivery Note-Receivable Voucher'
|
||||
'name': 'Delivery Note-Sales Invoice'
|
||||
},
|
||||
|
||||
# Field Mapper Detail
|
||||
@ -149,7 +149,7 @@
|
||||
'doctype': 'Table Mapper Detail',
|
||||
'from_table': 'Delivery Note',
|
||||
'match_id': 0,
|
||||
'to_table': 'Receivable Voucher',
|
||||
'to_table': 'Sales Invoice',
|
||||
'validation_logic': 'docstatus=1'
|
||||
},
|
||||
|
||||
@ -157,10 +157,10 @@
|
||||
{
|
||||
'doctype': 'Table Mapper Detail',
|
||||
'from_field': 'delivery_note_details',
|
||||
'from_table': 'Delivery Note Detail',
|
||||
'from_table': 'Delivery Note Item',
|
||||
'match_id': 1,
|
||||
'to_field': 'entries',
|
||||
'to_table': 'RV Detail',
|
||||
'to_table': 'Sales Invoice Item',
|
||||
'validation_logic': '(ifnull(amount, 0) = 0 or amount > ifnull(billed_amt, 0)) and docstatus = 1'
|
||||
},
|
||||
|
||||
@ -168,10 +168,10 @@
|
||||
{
|
||||
'doctype': 'Table Mapper Detail',
|
||||
'from_field': 'other_charges',
|
||||
'from_table': 'RV Tax Detail',
|
||||
'from_table': 'Sales Taxes and Charges',
|
||||
'match_id': 2,
|
||||
'to_field': 'other_charges',
|
||||
'to_table': 'RV Tax Detail',
|
||||
'to_table': 'Sales Taxes and Charges',
|
||||
'validation_logic': 'name is not null'
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
# DocType Mapper, Project-Receivable Voucher
|
||||
# DocType Mapper, Project-Sales Invoice
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -16,10 +16,10 @@
|
||||
'from_table': 'Project',
|
||||
'match_id': 0,
|
||||
'name': '__common__',
|
||||
'parent': 'Project-Receivable Voucher',
|
||||
'parent': 'Project-Sales Invoice',
|
||||
'parentfield': 'table_mapper_details',
|
||||
'parenttype': 'DocType Mapper',
|
||||
'to_table': 'Receivable Voucher',
|
||||
'to_table': 'Sales Invoice',
|
||||
'validation_logic': 'name is not null'
|
||||
},
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
'map': 'Yes',
|
||||
'match_id': 0,
|
||||
'name': '__common__',
|
||||
'parent': 'Project-Receivable Voucher',
|
||||
'parent': 'Project-Sales Invoice',
|
||||
'parentfield': 'field_mapper_details',
|
||||
'parenttype': 'DocType Mapper',
|
||||
'to_field': 'customer'
|
||||
@ -43,13 +43,13 @@
|
||||
'from_doctype': 'Project',
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'to_doctype': 'Receivable Voucher'
|
||||
'to_doctype': 'Sales Invoice'
|
||||
},
|
||||
|
||||
# DocType Mapper, Project-Receivable Voucher
|
||||
# DocType Mapper, Project-Sales Invoice
|
||||
{
|
||||
'doctype': 'DocType Mapper',
|
||||
'name': 'Project-Receivable Voucher'
|
||||
'name': 'Project-Sales Invoice'
|
||||
},
|
||||
|
||||
# Field Mapper Detail
|
@ -1,4 +1,4 @@
|
||||
# DocType Mapper, Purchase Order-Payable Voucher
|
||||
# DocType Mapper, Purchase Order-Purchase Invoice
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -14,7 +14,7 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'name': '__common__',
|
||||
'parent': u'Purchase Order-Payable Voucher',
|
||||
'parent': u'Purchase Order-Purchase Invoice',
|
||||
'parentfield': u'table_mapper_details',
|
||||
'parenttype': u'DocType Mapper'
|
||||
},
|
||||
@ -23,7 +23,7 @@
|
||||
{
|
||||
'doctype': u'Field Mapper Detail',
|
||||
'name': '__common__',
|
||||
'parent': u'Purchase Order-Payable Voucher',
|
||||
'parent': u'Purchase Order-Purchase Invoice',
|
||||
'parentfield': u'field_mapper_details',
|
||||
'parenttype': u'DocType Mapper'
|
||||
},
|
||||
@ -35,13 +35,13 @@
|
||||
'module': u'Accounts',
|
||||
'name': '__common__',
|
||||
'ref_doc_submitted': 1,
|
||||
'to_doctype': u'Payable Voucher'
|
||||
'to_doctype': u'Purchase Invoice'
|
||||
},
|
||||
|
||||
# DocType Mapper, Purchase Order-Payable Voucher
|
||||
# DocType Mapper, Purchase Order-Purchase Invoice
|
||||
{
|
||||
'doctype': u'DocType Mapper',
|
||||
'name': u'Purchase Order-Payable Voucher'
|
||||
'name': u'Purchase Order-Purchase Invoice'
|
||||
},
|
||||
|
||||
# Field Mapper Detail
|
||||
@ -130,7 +130,7 @@
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_table': u'Purchase Order',
|
||||
'match_id': 0,
|
||||
'to_table': u'Payable Voucher',
|
||||
'to_table': u'Purchase Invoice',
|
||||
'validation_logic': u'docstatus =1'
|
||||
},
|
||||
|
||||
@ -138,10 +138,10 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_field': u'po_details',
|
||||
'from_table': u'PO Detail',
|
||||
'from_table': u'Purchase Order Item',
|
||||
'match_id': 1,
|
||||
'to_field': u'entries',
|
||||
'to_table': u'PV Detail',
|
||||
'to_table': u'Purchase Invoice Item',
|
||||
'validation_logic': u'ifnull(billed_qty,0) < qty and docstatus = 1'
|
||||
},
|
||||
|
||||
@ -149,10 +149,10 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_field': u'purchase_tax_details',
|
||||
'from_table': u'Purchase Tax Detail',
|
||||
'from_table': u'Purchase Taxes and Charges',
|
||||
'match_id': 2,
|
||||
'to_field': u'purchase_tax_details',
|
||||
'to_table': u'Purchase Tax Detail',
|
||||
'to_table': u'Purchase Taxes and Charges',
|
||||
'validation_logic': u'docstatus =1'
|
||||
}
|
||||
]
|
@ -1,4 +1,4 @@
|
||||
# DocType Mapper, Purchase Receipt-Payable Voucher
|
||||
# DocType Mapper, Purchase Receipt-Purchase Invoice
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -14,7 +14,7 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'name': '__common__',
|
||||
'parent': u'Purchase Receipt-Payable Voucher',
|
||||
'parent': u'Purchase Receipt-Purchase Invoice',
|
||||
'parentfield': u'table_mapper_details',
|
||||
'parenttype': u'DocType Mapper'
|
||||
},
|
||||
@ -23,7 +23,7 @@
|
||||
{
|
||||
'doctype': u'Field Mapper Detail',
|
||||
'name': '__common__',
|
||||
'parent': u'Purchase Receipt-Payable Voucher',
|
||||
'parent': u'Purchase Receipt-Purchase Invoice',
|
||||
'parentfield': u'field_mapper_details',
|
||||
'parenttype': u'DocType Mapper'
|
||||
},
|
||||
@ -35,13 +35,13 @@
|
||||
'module': u'Accounts',
|
||||
'name': '__common__',
|
||||
'ref_doc_submitted': 1,
|
||||
'to_doctype': u'Payable Voucher'
|
||||
'to_doctype': u'Purchase Invoice'
|
||||
},
|
||||
|
||||
# DocType Mapper, Purchase Receipt-Payable Voucher
|
||||
# DocType Mapper, Purchase Receipt-Purchase Invoice
|
||||
{
|
||||
'doctype': u'DocType Mapper',
|
||||
'name': u'Purchase Receipt-Payable Voucher'
|
||||
'name': u'Purchase Receipt-Purchase Invoice'
|
||||
},
|
||||
|
||||
# Field Mapper Detail
|
||||
@ -156,10 +156,10 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_field': u'purchase_receipt_details',
|
||||
'from_table': u'Purchase Receipt Detail',
|
||||
'from_table': u'Purchase Receipt Item',
|
||||
'match_id': 1,
|
||||
'to_field': u'entries',
|
||||
'to_table': u'PV Detail',
|
||||
'to_table': u'Purchase Invoice Item',
|
||||
'validation_logic': u'ifnull(billed_qty,0) < qty'
|
||||
},
|
||||
|
||||
@ -168,7 +168,7 @@
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_table': u'Purchase Receipt',
|
||||
'match_id': 0,
|
||||
'to_table': u'Payable Voucher',
|
||||
'to_table': u'Purchase Invoice',
|
||||
'validation_logic': u'docstatus=1'
|
||||
},
|
||||
|
||||
@ -176,10 +176,10 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_field': u'purchase_tax_details',
|
||||
'from_table': u'Purchase Tax Detail',
|
||||
'from_table': u'Purchase Taxes and Charges',
|
||||
'match_id': 2,
|
||||
'to_field': u'purchase_tax_details',
|
||||
'to_table': u'Purchase Tax Detail',
|
||||
'to_table': u'Purchase Taxes and Charges',
|
||||
'validation_logic': u'docstatus=1'
|
||||
}
|
||||
]
|
@ -1,4 +1,4 @@
|
||||
# DocType Mapper, Sales Order-Receivable Voucher
|
||||
# DocType Mapper, Sales Order-Sales Invoice
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -14,7 +14,7 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'name': '__common__',
|
||||
'parent': u'Sales Order-Receivable Voucher',
|
||||
'parent': u'Sales Order-Sales Invoice',
|
||||
'parentfield': u'table_mapper_details',
|
||||
'parenttype': u'DocType Mapper'
|
||||
},
|
||||
@ -23,7 +23,7 @@
|
||||
{
|
||||
'doctype': u'Field Mapper Detail',
|
||||
'name': '__common__',
|
||||
'parent': u'Sales Order-Receivable Voucher',
|
||||
'parent': u'Sales Order-Sales Invoice',
|
||||
'parentfield': u'field_mapper_details',
|
||||
'parenttype': u'DocType Mapper'
|
||||
},
|
||||
@ -35,13 +35,13 @@
|
||||
'module': u'Accounts',
|
||||
'name': '__common__',
|
||||
'ref_doc_submitted': 1,
|
||||
'to_doctype': u'Receivable Voucher'
|
||||
'to_doctype': u'Sales Invoice'
|
||||
},
|
||||
|
||||
# DocType Mapper, Sales Order-Receivable Voucher
|
||||
# DocType Mapper, Sales Order-Sales Invoice
|
||||
{
|
||||
'doctype': u'DocType Mapper',
|
||||
'name': u'Sales Order-Receivable Voucher'
|
||||
'name': u'Sales Order-Sales Invoice'
|
||||
},
|
||||
|
||||
# Field Mapper Detail
|
||||
@ -151,7 +151,7 @@
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_table': u'Sales Order',
|
||||
'match_id': 0,
|
||||
'to_table': u'Receivable Voucher',
|
||||
'to_table': u'Sales Invoice',
|
||||
'validation_logic': u'docstatus=1'
|
||||
},
|
||||
|
||||
@ -159,10 +159,10 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_field': u'sales_order_detail',
|
||||
'from_table': u'Sales Order Detail',
|
||||
'from_table': u'Sales Order Item',
|
||||
'match_id': 1,
|
||||
'to_field': u'entries',
|
||||
'to_table': u'RV Detail',
|
||||
'to_table': u'Sales Invoice Item',
|
||||
'validation_logic': u'(ifnull(amount, 0) = 0 or amount > ifnull(billed_amt, 0)) and docstatus = 1'
|
||||
},
|
||||
|
||||
@ -170,10 +170,10 @@
|
||||
{
|
||||
'doctype': u'Table Mapper Detail',
|
||||
'from_field': u'other_charges',
|
||||
'from_table': u'RV Tax Detail',
|
||||
'from_table': u'Sales Taxes and Charges',
|
||||
'match_id': 2,
|
||||
'to_field': u'other_charges',
|
||||
'to_table': u'RV Tax Detail',
|
||||
'to_table': u'Sales Taxes and Charges',
|
||||
'validation_logic': u'name is not null'
|
||||
},
|
||||
|
@ -1 +1 @@
|
||||
[{'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 'Payable Voucher') or (d.against_invoice and 'Receivable Voucher') 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'}]
|
||||
[{'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'}]
|
||||
|
@ -1 +1 @@
|
||||
[{'doc_type': 'Payable Voucher', 'modified_by': 'nabin@webnotestech.com', 'name': 'Payable Voucher', 'parent': None, 'creation': '2009-03-12 12:09:24', 'modified': '2010-05-26 16:48:58', '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': None, 'table_field': 'entries', 'transaction_date': 'parent:voucher_date', 'debit': 'amount', 'docstatus': 0, 'parent': 'Payable Voucher', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'expense_head', 'name': 'GLMDetail00002', 'idx': 1, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'parent:credit_to', 'credit': 'value:0', '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', 'voucher_no': 'parent:name', 'modified_by': 'nabin@webnotestech.com', 'against_voucher': None, 'table_field': 'purchase_tax_details', 'transaction_date': 'parent:voucher_date', 'debit': "value:d.fields.get('category') != 'For Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0", 'docstatus': 0, 'parent': 'Payable Voucher', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'account_head', 'name': 'GLMDetail00003', 'idx': 2, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'parent:credit_to', 'credit': "value:d.fields.get('category') != 'For Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0", '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': 'nabin@webnotestech.com', 'against_voucher': None, 'table_field': '', 'transaction_date': 'voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Payable Voucher', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'tax_code', 'name': 'GLMDetail00004', 'idx': 3, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'credit_to', 'credit': 'ded_amount', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': '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': 'nabin@webnotestech.com', 'against_voucher': 'name', 'table_field': '', 'transaction_date': 'voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Payable Voucher', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'credit_to', 'name': 'GLMDetail00005', 'idx': 4, 'against_voucher_type': "value:'Payable Voucher'", 'modified': '2010-05-26 16:48:58', 'against': 'against_expense_account', 'credit': 'total_amount_to_pay', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}]
|
||||
[{'doc_type': 'Purchase Invoice', 'modified_by': 'nabin@webnotestech.com', 'name': 'Purchase Invoice', 'parent': None, 'creation': '2009-03-12 12:09:24', 'modified': '2010-05-26 16:48:58', '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': None, 'table_field': 'entries', 'transaction_date': 'parent:voucher_date', 'debit': 'amount', 'docstatus': 0, 'parent': 'Purchase Invoice', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'expense_head', 'name': 'GLMDetail00002', 'idx': 1, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'parent:credit_to', 'credit': 'value:0', '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', 'voucher_no': 'parent:name', 'modified_by': 'nabin@webnotestech.com', 'against_voucher': None, 'table_field': 'purchase_tax_details', 'transaction_date': 'parent:voucher_date', 'debit': "value:d.fields.get('category') != 'For Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0", 'docstatus': 0, 'parent': 'Purchase Invoice', 'company': 'parent:company', 'aging_date': 'parent:aging_date', 'fiscal_year': 'parent:fiscal_year', 'is_advance': None, 'remarks': 'parent:remarks', 'account': 'account_head', 'name': 'GLMDetail00003', 'idx': 2, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'parent:credit_to', 'credit': "value:d.fields.get('category') != 'For Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0", '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': 'nabin@webnotestech.com', 'against_voucher': None, 'table_field': '', 'transaction_date': 'voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Purchase Invoice', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'tax_code', 'name': 'GLMDetail00004', 'idx': 3, 'against_voucher_type': None, 'modified': '2010-05-26 16:48:58', 'against': 'credit_to', 'credit': 'ded_amount', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': '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': 'nabin@webnotestech.com', 'against_voucher': 'name', 'table_field': '', 'transaction_date': 'voucher_date', 'debit': 'value:0', 'docstatus': 0, 'parent': 'Purchase Invoice', 'company': 'company', 'aging_date': 'aging_date', 'fiscal_year': 'fiscal_year', 'is_advance': None, 'remarks': 'remarks', 'account': 'credit_to', 'name': 'GLMDetail00005', 'idx': 4, 'against_voucher_type': "value:'Purchase Invoice'", 'modified': '2010-05-26 16:48:58', 'against': 'against_expense_account', 'credit': 'total_amount_to_pay', 'parenttype': 'GL Mapper', 'is_opening': 'is_opening', 'posting_date': 'posting_date', 'parentfield': 'fields'}]
|
@ -1 +1 @@
|
||||
[{'doc_type': 'Receivable Voucher', 'modified_by': 'Administrator', 'name': 'Receivable Voucher', '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': 'Receivable Voucher', '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': 'Receivable Voucher', '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': 'Receivable Voucher', '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:'Receivable Voucher'", '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'}]
|
||||
[{'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'}]
|
@ -12,9 +12,9 @@
|
||||
|
||||
# These values are common for all Print Format
|
||||
{
|
||||
'doc_type': u'Receivable Voucher',
|
||||
'doc_type': u'Sales Invoice',
|
||||
'doctype': 'Print Format',
|
||||
'html': u'<html>\n<head>\n<!--Other charges function-->\n<script>\nvar make_row = function(title,val,bold){\nvar bstart = \'<b>\'; var bend = \'</b>\';\nreturn \'<tr><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:20%">\'+doc.currency+\'</td>\'\n +\'<td style="width:30%;text-align:right">\'+(val?val:\'0.00\')+\'</td>\'\n +\'</tr>\'\n}\nvar make_row1 = function(title,val,bold){\n var bstart = \'<b>\'; var bend = \'</b>\';\n \n return \'<tr style="font-family:courier new; line-height:150%"><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:50%;text-align:right">\'+(bold?bstart:\'\')+(val?val:\'0.00\')+(bold?bend:\'\')+\'</td>\'\n +\'</tr>\'\n}\n\nfunction get_letter_head() {\n // add letter head\n var cp = wn.boot.control_panel;\n if(doc.letter_head)\n var lh= cstr(_p.letter_heads[doc.letter_head]);\n else if(cp.letter_head)\n var lh= cp.letter_head;\n else \n var lh= \'\';\n \n return lh;\n}\n\nfunction get_tax_details(){\n var cl = getchildren(\'RV Tax Detail\',doc.name,\'other_charges\');\n var out = \'\';\n\n out += \'<div><table style="float: right;">\';\n for(var i=0;i<cl.length;i++){\n if(cl[i].tax_amount) {\n out += make_row1(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);\n }\n }\n out += make_row1(\'TOTAL\',doc.currency + " " + fmt_money(convert_rate(doc.grand_total)),1);\n out +=\'</table></div>\';\n return out;\n}\n\nfunction convert_rate(val){ \n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n}\n</script>\n<style>\n table, td, tr, div, span {\n font-family: courier new;\n line-height: 200%;\n }\n</style>\n</head>\n\n<body>\n<table width="100%" style="font-family: courier new; line-height:200%">\n<tr>\n <td align="left">NO: <script>doc.name</script></td>\n <td align="right">DATE: <script>date.str_to_user(doc.posting_date)</script></td>\n</tr>\n<tr>\n <td>M/s <script>doc.contact_display</script></td>\n</tr>\n</table>\n<!--Item Table-->\n<div>\n<script>\nvar t = print_table(\'Receivable Voucher\', doc.name, \'entries\', \'RV Detail\',\n [\'description\',\'qty\',\'export_rate\',\'export_amount\'], [\'ITEM\', \'QTY\',\'RATE\',\'AMOUNT\'],\n [\'35%\',\'20%\',\'20%\',\'25%\']);\nif(t.appendChild) { // single\n out = t.innerHTML.replace(/style="/gi,\'style="font-family:courier new;line-height:150%;\');\n} else { //multiple\n out = \'<table class="None" border="0px" width="100%" style="border:0px; font-family:courier-new">\';\n\n for(var i=0;i<t.length;i++) {\n if(i==0) {\n out += \'<tr>\' + t[i].childNodes[0].childNodes[0].childNodes[0].innerHTML\n .replace(/style="border: 1px solid rgb\\(0, 0, 0\\);/gi,\'style="font-family:courier new;\')\n + \'</tr>\';\n }\n out += \'<tr>\' + t[i].childNodes[0].childNodes[0].childNodes[1].innerHTML\n .replace(/style="border: 1px solid rgb\\(0, 0, 0\\);/gi,\'style="font-family:courier new;\')\n + \'</tr>\';\n }\n out += \'</table>\';\n}\nout;\n</script>\n</div>\n<!--Tax table-->\n<div><script>get_tax_details();</script></div><br />\n<table style="font-family:courier new;">\n <tr><td><b><script>doc.terms</script></b></td></tr>\n <tr><td nowrap><b>For <script>doc.company</script></b></td></tr>\n <tr><td> </td></tr>\n <tr><td nowrap><b>Signatory</b></td></tr>\n</table>\n</body>\n</html>\n',
|
||||
'html': u'<html>\n<head>\n<!--Other charges function-->\n<script>\nvar make_row = function(title,val,bold){\nvar bstart = \'<b>\'; var bend = \'</b>\';\nreturn \'<tr><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:20%">\'+doc.currency+\'</td>\'\n +\'<td style="width:30%;text-align:right">\'+(val?val:\'0.00\')+\'</td>\'\n +\'</tr>\'\n}\nvar make_row1 = function(title,val,bold){\n var bstart = \'<b>\'; var bend = \'</b>\';\n \n return \'<tr style="font-family:courier new; line-height:150%"><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:50%;text-align:right">\'+(bold?bstart:\'\')+(val?val:\'0.00\')+(bold?bend:\'\')+\'</td>\'\n +\'</tr>\'\n}\n\nfunction get_letter_head() {\n // add letter head\n var cp = wn.boot.control_panel;\n if(doc.letter_head)\n var lh= cstr(_p.letter_heads[doc.letter_head]);\n else if(cp.letter_head)\n var lh= cp.letter_head;\n else \n var lh= \'\';\n \n return lh;\n}\n\nfunction get_tax_details(){\n var cl = getchildren(\'Sales Taxes and Charges\',doc.name,\'other_charges\');\n var out = \'\';\n\n out += \'<div><table style="float: right;">\';\n for(var i=0;i<cl.length;i++){\n if(cl[i].tax_amount) {\n out += make_row1(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);\n }\n }\n out += make_row1(\'TOTAL\',doc.currency + " " + fmt_money(convert_rate(doc.grand_total)),1);\n out +=\'</table></div>\';\n return out;\n}\n\nfunction convert_rate(val){ \n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n}\n</script>\n<style>\n table, td, tr, div, span {\n font-family: courier new;\n line-height: 200%;\n }\n</style>\n</head>\n\n<body>\n<table width="100%" style="font-family: courier new; line-height:200%">\n<tr>\n <td align="left">NO: <script>doc.name</script></td>\n <td align="right">DATE: <script>date.str_to_user(doc.posting_date)</script></td>\n</tr>\n<tr>\n <td>M/s <script>doc.contact_display</script></td>\n</tr>\n</table>\n<!--Item Table-->\n<div>\n<script>\nvar t = print_table(\'Sales Invoice\', doc.name, \'entries\', \'Sales Invoice Item\',\n [\'description\',\'qty\',\'export_rate\',\'export_amount\'], [\'ITEM\', \'QTY\',\'RATE\',\'AMOUNT\'],\n [\'35%\',\'20%\',\'20%\',\'25%\']);\nif(t.appendChild) { // single\n out = t.innerHTML.replace(/style="/gi,\'style="font-family:courier new;line-height:150%;\');\n} else { //multiple\n out = \'<table class="None" border="0px" width="100%" style="border:0px; font-family:courier-new">\';\n\n for(var i=0;i<t.length;i++) {\n if(i==0) {\n out += \'<tr>\' + t[i].childNodes[0].childNodes[0].childNodes[0].innerHTML\n .replace(/style="border: 1px solid rgb\\(0, 0, 0\\);/gi,\'style="font-family:courier new;\')\n + \'</tr>\';\n }\n out += \'<tr>\' + t[i].childNodes[0].childNodes[0].childNodes[1].innerHTML\n .replace(/style="border: 1px solid rgb\\(0, 0, 0\\);/gi,\'style="font-family:courier new;\')\n + \'</tr>\';\n }\n out += \'</table>\';\n}\nout;\n</script>\n</div>\n<!--Tax table-->\n<div><script>get_tax_details();</script></div><br />\n<table style="font-family:courier new;">\n <tr><td><b><script>doc.terms</script></b></td></tr>\n <tr><td nowrap><b>For <script>doc.company</script></b></td></tr>\n <tr><td> </td></tr>\n <tr><td nowrap><b>Signatory</b></td></tr>\n</table>\n</body>\n</html>\n',
|
||||
'module': u'Accounts',
|
||||
'name': '__common__',
|
||||
'standard': u'Yes'
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -72,9 +72,9 @@ def get_invoice_details(doc, children, fiscal_year):
|
||||
}, { ... }, ...]
|
||||
"""
|
||||
if doc.get('return_type')=='Sales Return':
|
||||
obj = get_obj('Receivable Voucher', doc.get('sales_invoice_no'), with_children=1)
|
||||
obj = get_obj('Sales Invoice', doc.get('sales_invoice_no'), with_children=1)
|
||||
else:
|
||||
obj = get_obj('Payable Voucher', doc.get('purchase_invoice_no'), with_children=1)
|
||||
obj = get_obj('Purchase Invoice', doc.get('purchase_invoice_no'), with_children=1)
|
||||
if not obj.doc.docstatus==1: return
|
||||
|
||||
# Build invoice account jv detail record
|
||||
@ -205,14 +205,14 @@ def get_delivery_note_details(doc, children, fiscal_year):
|
||||
|
||||
dn_obj = get_obj('Delivery Note', doc['delivery_note_no'], with_children=1)
|
||||
|
||||
inv_list = get_inv_list('tabRV Detail', 'delivery_note', doc['delivery_note_no'])
|
||||
inv_list = get_inv_list('tabSales Invoice Item', 'delivery_note', doc['delivery_note_no'])
|
||||
|
||||
if inv_list:
|
||||
jv_details_list = get_jv_details_from_inv_list(doc, children, fiscal_year, inv_list, jv_details_list)
|
||||
|
||||
if not (inv_list and jv_details_list):
|
||||
so_list = get_prev_doc_list(dn_obj, 'Sales Order')
|
||||
inv_list = get_inv_list('tabRV Detail', 'sales_order', so_list)
|
||||
inv_list = get_inv_list('tabSales Invoice Item', 'sales_order', so_list)
|
||||
if inv_list:
|
||||
jv_details_list = get_jv_details_from_inv_list(doc, children, fiscal_year, inv_list, jv_details_list)
|
||||
|
||||
@ -228,14 +228,14 @@ def get_purchase_receipt_details(doc, children, fiscal_year):
|
||||
|
||||
pr_obj = get_obj('Purchase Receipt', doc['purchase_receipt_no'], with_children=1)
|
||||
|
||||
inv_list = get_inv_list('tabPV Detail', 'purchase_receipt', doc['purchase_receipt_no'])
|
||||
inv_list = get_inv_list('tabPurchase Invoice Item', 'purchase_receipt', doc['purchase_receipt_no'])
|
||||
|
||||
if inv_list:
|
||||
jv_details_list = get_jv_details_from_inv_list(doc, children, fiscal_year, inv_list, jv_details_list)
|
||||
|
||||
if not (inv_list and jv_details_list):
|
||||
po_list = get_prev_doc_list(pr_obj, 'Purchase Order')
|
||||
inv_list = get_inv_list('tabPV Detail', 'purchase_order', po_list)
|
||||
inv_list = get_inv_list('tabPurchase Invoice Item', 'purchase_order', po_list)
|
||||
if inv_list:
|
||||
jv_details_list = get_jv_details_from_inv_list(doc, children, fiscal_year, inv_list, jv_details_list)
|
||||
|
||||
|
@ -223,7 +223,7 @@ class DocType:
|
||||
# ==================================================================
|
||||
def get_authorized_user(self):
|
||||
# Check logged-in user is authorized
|
||||
if get_value('Manage Account', None, 'credit_controller') in webnotes.user.get_roles():
|
||||
if get_value('Global Defaults', None, 'credit_controller') in webnotes.user.get_roles():
|
||||
return 1
|
||||
|
||||
# Check Credit limit for customer
|
||||
|
@ -17,7 +17,7 @@
|
||||
//c-form js file
|
||||
// -----------------------------
|
||||
cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = function(doc) {
|
||||
return 'SELECT `tabReceivable Voucher`.`name` FROM `tabReceivable Voucher` WHERE `tabReceivable Voucher`.`company` = "' +doc.company+'" AND `tabReceivable Voucher`.%(key)s LIKE "%s" AND `tabReceivable Voucher`.`customer` = "' + doc.customer + '" AND `tabReceivable Voucher`.`docstatus` = 1 and `tabReceivable Voucher`.`c_form_applicable` = "Yes" and ifnull(`tabReceivable Voucher`.c_form_no, "") = "" ORDER BY `tabReceivable Voucher`.`name` ASC LIMIT 50';
|
||||
return 'SELECT `tabSales Invoice`.`name` FROM `tabSales Invoice` WHERE `tabSales Invoice`.`company` = "' +doc.company+'" AND `tabSales Invoice`.%(key)s LIKE "%s" AND `tabSales Invoice`.`customer` = "' + doc.customer + '" AND `tabSales Invoice`.`docstatus` = 1 and `tabSales Invoice`.`c_form_applicable` = "Yes" and ifnull(`tabSales Invoice`.c_form_no, "") = "" ORDER BY `tabSales Invoice`.`name` ASC LIMIT 50';
|
||||
}
|
||||
|
||||
cur_frm.cscript.invoice_no = function(doc, cdt, cdn) {
|
||||
|
@ -39,9 +39,9 @@ class DocType:
|
||||
|
||||
if len(getlist(self.doclist, 'invoice_details')):
|
||||
inv = "'" + "', '".join([d.invoice_no for d in getlist(self.doclist, 'invoice_details')]) + "'"
|
||||
sql("""update `tabReceivable Voucher` set c_form_no = '%s', modified ='%s'
|
||||
sql("""update `tabSales Invoice` set c_form_no = '%s', modified ='%s'
|
||||
where name in (%s)"""%(self.doc.name, self.doc.modified, inv))
|
||||
sql("""update `tabReceivable Voucher` set c_form_no = '', modified = %s where name not
|
||||
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))
|
||||
else:
|
||||
msgprint("Please enter atleast 1 invoice in the table below", raise_exception=1)
|
||||
@ -51,7 +51,7 @@ class DocType:
|
||||
""" Pull details from invoices for referrence """
|
||||
|
||||
inv = sql("""select posting_date, territory, net_total, grand_total from
|
||||
`tabReceivable Voucher` where name = %s""", invoice_no)
|
||||
`tabSales Invoice` where name = %s""", invoice_no)
|
||||
ret = {
|
||||
'invoice_date' : inv and getdate(inv[0][0]).strftime('%Y-%m-%d') or '',
|
||||
'territory' : inv and inv[0][1] or '',
|
||||
@ -67,7 +67,7 @@ class DocType:
|
||||
|
||||
for d in getlist(self.doclist, 'invoice_details'):
|
||||
inv = sql("""select c_form_applicable, c_form_no from
|
||||
`tabReceivable Voucher` where name = %s""", invoice_no)
|
||||
`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':
|
||||
|
@ -43,7 +43,7 @@
|
||||
'fieldname': u'invoice_no',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Invoice No',
|
||||
'options': u'Receivable Voucher',
|
||||
'options': u'Sales Invoice',
|
||||
'permlevel': 0,
|
||||
'width': u'160px'
|
||||
},
|
||||
|
@ -178,8 +178,8 @@ class DocType:
|
||||
# ====================================================================================
|
||||
def clear_outstanding(self):
|
||||
# clear o/s of current year
|
||||
sql("update `tabPayable Voucher` set outstanding_amount = 0 where fiscal_year=%s and company=%s", (self.doc.name, self.doc.company))
|
||||
sql("update `tabReceivable Voucher` set outstanding_amount = 0 where fiscal_year=%s and company=%s", (self.doc.name, self.doc.company))
|
||||
sql("update `tabPurchase Invoice` set outstanding_amount = 0 where fiscal_year=%s and company=%s", (self.doc.name, self.doc.company))
|
||||
sql("update `tabSales Invoice` set outstanding_amount = 0 where fiscal_year=%s and company=%s", (self.doc.name, self.doc.company))
|
||||
|
||||
# Update Voucher Outstanding
|
||||
def update_voucher_outstanding(self):
|
||||
@ -190,7 +190,7 @@ class DocType:
|
||||
# get voucher balance
|
||||
bal = sql("select sum(debit)-sum(credit) from `tabGL Entry` where against_voucher=%s and against_voucher_type=%s and ifnull(is_cancelled, 'No') = 'No'", (d[0], d[1]))
|
||||
bal = bal and flt(bal[0][0]) or 0.0
|
||||
if d[1] == 'Payable Voucher':
|
||||
if d[1] == 'Purchase Invoice':
|
||||
bal = -bal
|
||||
# set voucher balance
|
||||
sql("update `tab%s` set outstanding_amount=%s where name='%s'"% (d[1], bal, d[0]))
|
||||
|
@ -279,7 +279,7 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'return_details',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Return Details',
|
||||
'label': u'Sales and Purchase Return Items',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
@ -297,7 +297,7 @@ class DocType:
|
||||
add.remarks = d[1]
|
||||
add.advance_amount = flt(d[2])
|
||||
add.allocate_amount = 0
|
||||
if table_name == 'Advance Allocation Detail':
|
||||
if table_name == 'Purchase Invoice Advance':
|
||||
add.tds_amount = flt(d[4])
|
||||
|
||||
# Clear rows which is not adjusted
|
||||
@ -319,7 +319,7 @@ class DocType:
|
||||
get_obj(dt='GL Control').make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel =1, adv_adj =1)
|
||||
|
||||
# update ref in JV Detail
|
||||
webnotes.conn.sql("update `tabJournal Voucher Detail` set %s = '%s' where name = '%s'" % (doctype=='Payable Voucher' and 'against_voucher' or 'against_invoice', cstr(against_document_no), d.jv_detail_no))
|
||||
webnotes.conn.sql("update `tabJournal Voucher Detail` set %s = '%s' where name = '%s'" % (doctype=='Purchase Invoice' and 'against_voucher' or 'against_invoice', cstr(against_document_no), d.jv_detail_no))
|
||||
|
||||
# re-submit JV
|
||||
jv_obj = get_obj('Journal Voucher', d.journal_voucher, with_children =1)
|
||||
@ -351,7 +351,7 @@ class DocType:
|
||||
balance = flt(advance) - flt(allocate)
|
||||
|
||||
# update old entry
|
||||
webnotes.conn.sql("update `tabJournal Voucher Detail` set %s = '%s', %s = '%s' where name = '%s'" % (dr_or_cr, flt(allocate), doctype == "Payable Voucher" and 'against_voucher' or 'against_invoice',cstr(against_document_no), jv_detail_no))
|
||||
webnotes.conn.sql("update `tabJournal Voucher Detail` set %s = '%s', %s = '%s' where name = '%s'" % (dr_or_cr, flt(allocate), doctype == "Purchase Invoice" and 'against_voucher' or 'against_invoice',cstr(against_document_no), jv_detail_no))
|
||||
|
||||
# new entry with balance amount
|
||||
add = addchild(jv_obj.doc, 'entries', 'Journal Voucher Detail', 1, jv_obj.doclist)
|
||||
@ -390,8 +390,8 @@ class DocType:
|
||||
|
||||
against_fld = {
|
||||
'Journal Voucher' : 'against_jv',
|
||||
'Receivable Voucher' : 'against_invoice',
|
||||
'Payable Voucher' : 'against_voucher'
|
||||
'Sales Invoice' : 'against_invoice',
|
||||
'Purchase Invoice' : 'against_voucher'
|
||||
}
|
||||
|
||||
d['against_fld'] = against_fld[d['against_voucher_type']]
|
||||
@ -462,7 +462,7 @@ class DocType:
|
||||
# Get Balance from GL Entries
|
||||
bal = webnotes.conn.sql("select sum(debit)-sum(credit) from `tabGL Entry` where against_voucher=%s and against_voucher_type=%s", (voucher_obj.doc.name , voucher_obj.doc.doctype))
|
||||
bal = bal and flt(bal[0][0]) or 0.0
|
||||
if cstr(voucher_obj.doc.doctype) == 'Payable Voucher':
|
||||
if cstr(voucher_obj.doc.doctype) == 'Purchase Invoice':
|
||||
bal = -bal
|
||||
|
||||
# Check outstanding Amount
|
||||
@ -520,11 +520,11 @@ def manage_recurring_invoices():
|
||||
Create recurring invoices on specific date by copying the original one
|
||||
and notify the concerned people
|
||||
"""
|
||||
rv = webnotes.conn.sql("""select name, recurring_id from `tabReceivable Voucher` where ifnull(convert_into_recurring_invoice, 0) = 1
|
||||
rv = webnotes.conn.sql("""select name, recurring_id from `tabSales Invoice` where ifnull(convert_into_recurring_invoice, 0) = 1
|
||||
and next_date = %s and next_date <= end_date and docstatus=1 order by next_date desc""", nowdate())
|
||||
for d in rv:
|
||||
if not webnotes.conn.sql("""select name from `tabReceivable Voucher` where posting_date = %s and recurring_id = %s and docstatus=1""", (nowdate(), d[1])):
|
||||
prev_rv = get_obj('Receivable Voucher', d[0], with_children=1)
|
||||
if not webnotes.conn.sql("""select name from `tabSales Invoice` where posting_date = %s and recurring_id = %s and docstatus=1""", (nowdate(), d[1])):
|
||||
prev_rv = get_obj('Sales Invoice', d[0], with_children=1)
|
||||
new_rv = create_new_invoice(prev_rv)
|
||||
|
||||
send_notification(new_rv)
|
||||
|
@ -114,9 +114,9 @@ class DocType:
|
||||
#----------------------------------------------------------------------------------------------
|
||||
def check_freezing_date(self, adv_adj):
|
||||
if not adv_adj:
|
||||
acc_frozen_upto = get_value('Manage Account', None, 'acc_frozen_upto')
|
||||
acc_frozen_upto = get_value('Global Defaults', None, 'acc_frozen_upto')
|
||||
if acc_frozen_upto:
|
||||
bde_auth_role = get_value( 'Manage Account', None,'bde_auth_role')
|
||||
bde_auth_role = get_value( 'Global Defaults', None,'bde_auth_role')
|
||||
if getdate(self.doc.posting_date) <= getdate(acc_frozen_upto) and not bde_auth_role in webnotes.user.get_roles():
|
||||
msgprint("You are not authorized to do/modify back dated accounting entries before %s." % getdate(acc_frozen_upto).strftime('%d-%m-%Y'), raise_exception=1)
|
||||
|
||||
@ -234,12 +234,12 @@ class DocType:
|
||||
bal = flt(sql("select sum(debit)-sum(credit) from `tabGL Entry` where against_voucher=%s and against_voucher_type=%s and ifnull(is_cancelled,'No') = 'No'", (self.doc.against_voucher, self.doc.against_voucher_type))[0][0] or 0.0)
|
||||
tds = 0
|
||||
|
||||
if self.doc.against_voucher_type=='Payable Voucher':
|
||||
if self.doc.against_voucher_type=='Purchase Invoice':
|
||||
# amount to debit
|
||||
bal = -bal
|
||||
|
||||
# Check if tds applicable
|
||||
tds = sql("select total_tds_on_voucher from `tabPayable Voucher` where name = '%s'" % self.doc.against_voucher)
|
||||
tds = sql("select total_tds_on_voucher from `tabPurchase Invoice` where name = '%s'" % self.doc.against_voucher)
|
||||
tds = tds and flt(tds[0][0]) or 0
|
||||
|
||||
# Validation : Outstanding can not be negative
|
||||
@ -257,7 +257,7 @@ class DocType:
|
||||
#check for user role Freezed
|
||||
master_type=sql("select master_type, master_name from `tabAccount` where name='%s' " %self.doc.account)
|
||||
tot_outstanding = 0 #needed when there is no GL Entry in the system for that acc head
|
||||
if (self.doc.voucher_type=='Journal Voucher' or self.doc.voucher_type=='Receivable Voucher') and (master_type and master_type[0][0]=='Customer' and master_type[0][1]):
|
||||
if (self.doc.voucher_type=='Journal Voucher' or self.doc.voucher_type=='Sales Invoice') and (master_type and master_type[0][0]=='Customer' and master_type[0][1]):
|
||||
dbcr = sql("select sum(debit),sum(credit) from `tabGL Entry` where account = '%s' and is_cancelled='No'" % self.doc.account)
|
||||
if dbcr:
|
||||
tot_outstanding = flt(dbcr[0][0])-flt(dbcr[0][1])+flt(self.doc.debit)-flt(self.doc.credit)
|
||||
|
@ -207,7 +207,7 @@
|
||||
'label': u'Voucher Type',
|
||||
'oldfieldname': u'voucher_type',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'Journal Voucher\nReceivable Voucher\nPayable Voucher',
|
||||
'options': u'Journal Voucher\nSales Invoice\nPurchase Invoice',
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
|
@ -69,12 +69,12 @@ cur_frm.fields_dict["entries"].grid.get_field("cost_center").get_query = functio
|
||||
// ---------------------------------
|
||||
cur_frm.fields_dict['entries'].grid.get_field('against_voucher').get_query = function(doc) {
|
||||
var d = locals[this.doctype][this.docname];
|
||||
return "SELECT `tabPayable Voucher`.name, `tabPayable Voucher`.credit_to, `tabPayable Voucher`.outstanding_amount,`tabPayable Voucher`.bill_no, `tabPayable Voucher`.bill_date FROM `tabPayable Voucher` WHERE `tabPayable Voucher`.credit_to='"+d.account+"' AND `tabPayable Voucher`.outstanding_amount > 0 AND `tabPayable Voucher`.docstatus = 1 AND `tabPayable Voucher`.%(key)s LIKE '%s' ORDER BY `tabPayable Voucher`.name DESC LIMIT 200";
|
||||
return "SELECT `tabPurchase Invoice`.name, `tabPurchase Invoice`.credit_to, `tabPurchase Invoice`.outstanding_amount,`tabPurchase Invoice`.bill_no, `tabPurchase Invoice`.bill_date FROM `tabPurchase Invoice` WHERE `tabPurchase Invoice`.credit_to='"+d.account+"' AND `tabPurchase Invoice`.outstanding_amount > 0 AND `tabPurchase Invoice`.docstatus = 1 AND `tabPurchase Invoice`.%(key)s LIKE '%s' ORDER BY `tabPurchase Invoice`.name DESC LIMIT 200";
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['entries'].grid.get_field('against_invoice').get_query = function(doc) {
|
||||
var d = locals[this.doctype][this.docname];
|
||||
return "SELECT `tabReceivable Voucher`.name, `tabReceivable Voucher`.debit_to, `tabReceivable Voucher`.outstanding_amount FROM `tabReceivable Voucher` WHERE `tabReceivable Voucher`.debit_to='"+d.account+"' AND `tabReceivable Voucher`.outstanding_amount > 0 AND `tabReceivable Voucher`.docstatus = 1 AND `tabReceivable Voucher`.%(key)s LIKE '%s' ORDER BY `tabReceivable Voucher`.name DESC LIMIT 200";
|
||||
return "SELECT `tabSales Invoice`.name, `tabSales Invoice`.debit_to, `tabSales Invoice`.outstanding_amount FROM `tabSales Invoice` WHERE `tabSales Invoice`.debit_to='"+d.account+"' AND `tabSales Invoice`.outstanding_amount > 0 AND `tabSales Invoice`.docstatus = 1 AND `tabSales Invoice`.%(key)s LIKE '%s' ORDER BY `tabSales Invoice`.name DESC LIMIT 200";
|
||||
}
|
||||
|
||||
// TDS Account Head
|
||||
@ -92,13 +92,13 @@ cur_frm.fields_dict['entries'].grid.onrowadd = function(doc, cdt, cdn){
|
||||
}
|
||||
}
|
||||
|
||||
// Get Outstanding of Payable & Receivable Voucher
|
||||
// Get Outstanding of Payable & Sales Invoice
|
||||
// -----------------------------------------------
|
||||
|
||||
cur_frm.cscript.against_voucher = function(doc,cdt,cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if (d.against_voucher && !flt(d.debit)) {
|
||||
args = {'doctype': 'Payable Voucher', 'docname': d.against_voucher }
|
||||
args = {'doctype': 'Purchase Invoice', 'docname': d.against_voucher }
|
||||
get_server_fields('get_outstanding',docstring(args),'entries',doc,cdt,cdn,1,function(r,rt) { cur_frm.cscript.update_totals(doc); });
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ cur_frm.cscript.against_voucher = function(doc,cdt,cdn) {
|
||||
cur_frm.cscript.against_invoice = function(doc,cdt,cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if (d.against_invoice && !flt(d.credit)) {
|
||||
args = {'doctype': 'Receivable Voucher', 'docname': d.against_invoice }
|
||||
args = {'doctype': 'Sales Invoice', 'docname': d.against_invoice }
|
||||
get_server_fields('get_outstanding',docstring(args),'entries',doc,cdt,cdn,1,function(r,rt) { cur_frm.cscript.update_totals(doc); });
|
||||
}
|
||||
}
|
||||
@ -164,7 +164,7 @@ cur_frm.cscript['Get TDS'] = function(doc, dt, dn) {
|
||||
});
|
||||
}
|
||||
|
||||
// ***************** Get Print Heading based on Receivable Voucher *****************
|
||||
// ***************** Get Print Heading based on Sales Invoice *****************
|
||||
cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
|
||||
return 'SELECT `tabPrint Heading`.name FROM `tabPrint Heading` WHERE `tabPrint Heading`.docstatus !=2 AND `tabPrint Heading`.name LIKE "%s" ORDER BY `tabPrint Heading`.name ASC LIMIT 50';
|
||||
}
|
||||
|
@ -53,9 +53,9 @@ class DocType:
|
||||
def get_outstanding(self, args):
|
||||
args = eval(args)
|
||||
o_s = sql("select outstanding_amount from `tab%s` where name = '%s'" % (args['doctype'],args['docname']))
|
||||
if args['doctype'] == 'Payable Voucher':
|
||||
if args['doctype'] == 'Purchase Invoice':
|
||||
return {'debit': o_s and flt(o_s[0][0]) or 0}
|
||||
if args['doctype'] == 'Receivable Voucher':
|
||||
if args['doctype'] == 'Sales Invoice':
|
||||
return {'credit': o_s and flt(o_s[0][0]) or 0}
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------
|
||||
@ -72,11 +72,11 @@ class DocType:
|
||||
|
||||
for d in getlist(self.doclist, 'entries'):
|
||||
if d.against_invoice and d.credit:
|
||||
currency = sql("select currency from `tabReceivable Voucher` where name = '%s'" % d.against_invoice)
|
||||
currency = sql("select currency from `tabSales Invoice` where name = '%s'" % d.against_invoice)
|
||||
currency = currency and currency[0][0] or ''
|
||||
r.append('%s %s against Invoice: %s' % (cstr(currency), fmt_money(flt(d.credit)), d.against_invoice))
|
||||
if d.against_voucher and d.debit:
|
||||
bill_no = sql("select bill_no, bill_date, currency from `tabPayable Voucher` where name=%s", d.against_voucher)
|
||||
bill_no = sql("select bill_no, bill_date, currency from `tabPurchase Invoice` where name=%s", d.against_voucher)
|
||||
if bill_no and bill_no[0][0] and bill_no[0][0].lower().strip() not in ['na', 'not applicable', 'none']:
|
||||
bill_no = bill_no and bill_no[0]
|
||||
r.append('%s %s against Bill %s dated %s' % (bill_no[2] and cstr(bill_no[2]) or '', fmt_money(flt(d.debit)), bill_no[0], bill_no[1] and formatdate(bill_no[1].strftime('%Y-%m-%d')) or ''))
|
||||
@ -97,7 +97,7 @@ class DocType:
|
||||
self.is_approving_authority = 0
|
||||
|
||||
# Fetch credit controller role
|
||||
approving_authority = sql("select value from `tabSingles` where field='credit_controller' and doctype='Manage Account'")
|
||||
approving_authority = sql("select value from `tabSingles` where field='credit_controller' and doctype='Global Defaults'")
|
||||
approving_authority = approving_authority and approving_authority[0][0] or ''
|
||||
|
||||
# Check logged-in user is authorized
|
||||
@ -155,13 +155,13 @@ class DocType:
|
||||
def check_account_against_entries(self):
|
||||
for d in getlist(self.doclist,'entries'):
|
||||
if d.against_invoice:
|
||||
acc=sql("select debit_to from `tabReceivable Voucher` where name='%s'"%d.against_invoice)
|
||||
acc=sql("select debit_to from `tabSales Invoice` where name='%s'"%d.against_invoice)
|
||||
if acc and acc[0][0] != d.account:
|
||||
msgprint("Debit account is not matching with receivable voucher")
|
||||
raise Exception
|
||||
|
||||
if d.against_voucher:
|
||||
acc=sql("select credit_to from `tabPayable Voucher` where name='%s'"%d.against_voucher)
|
||||
acc=sql("select credit_to from `tabPurchase Invoice` where name='%s'"%d.against_voucher)
|
||||
if acc and acc[0][0] != d.account:
|
||||
msgprint("Credit account is not matching with payable voucher")
|
||||
raise Exception
|
||||
@ -369,9 +369,9 @@ class DocType:
|
||||
def get_values(self):
|
||||
cond = (flt(self.doc.write_off_amount) > 0) and ' and outstanding_amount <= '+self.doc.write_off_amount or ''
|
||||
if self.doc.write_off_based_on == 'Accounts Receivable':
|
||||
return sql("select name, debit_to, outstanding_amount from `tabReceivable Voucher` where docstatus = 1 and company = '%s' and outstanding_amount > 0 %s" % (self.doc.company, cond))
|
||||
return sql("select name, debit_to, outstanding_amount from `tabSales Invoice` where docstatus = 1 and company = '%s' and outstanding_amount > 0 %s" % (self.doc.company, cond))
|
||||
elif self.doc.write_off_based_on == 'Accounts Payable':
|
||||
return sql("select name, credit_to, outstanding_amount from `tabPayable Voucher` where docstatus = 1 and company = '%s' and outstanding_amount > 0 %s" % (self.doc.company, cond))
|
||||
return sql("select name, credit_to, outstanding_amount from `tabPurchase Invoice` where docstatus = 1 and company = '%s' and outstanding_amount > 0 %s" % (self.doc.company, cond))
|
||||
|
||||
|
||||
# -------------------------
|
||||
|
@ -118,7 +118,7 @@
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'against_voucher',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Payable Voucher',
|
||||
'options': u'Purchase Invoice',
|
||||
'permlevel': 0,
|
||||
'search_index': 1,
|
||||
'trigger': u'Client'
|
||||
@ -134,7 +134,7 @@
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'against_invoice',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Receivable Voucher',
|
||||
'options': u'Sales Invoice',
|
||||
'permlevel': 0,
|
||||
'search_index': 1,
|
||||
'trigger': u'Client'
|
||||
|
@ -90,5 +90,5 @@ cur_frm.add_fetch('invoice','grand_total','invoice_amount');
|
||||
|
||||
cur_frm.fields_dict.invoice.get_query=function(doc){
|
||||
|
||||
return "SELECT tv.name FROM `tabReceivable Voucher` tv WHERE debit_to='"+doc.account+"' and tv.%(key)s like '%s' ORDER BY tv.name LIMIT 50"
|
||||
return "SELECT tv.name FROM `tabSales Invoice` tv WHERE debit_to='"+doc.account+"' and tv.%(key)s like '%s' ORDER BY tv.name LIMIT 50"
|
||||
}
|
||||
|
@ -188,7 +188,7 @@
|
||||
'fieldname': u'invoice',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Invoice',
|
||||
'options': u'Receivable Voucher',
|
||||
'options': u'Sales Invoice',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'trigger': u'Client'
|
||||
|
0
erpnext/accounts/doctype/advance_adjustment_detail/__init__.py → erpnext/accounts/doctype/multi_ledger_report/__init__.py
Normal file → Executable file
0
erpnext/accounts/doctype/advance_adjustment_detail/__init__.py → erpnext/accounts/doctype/multi_ledger_report/__init__.py
Normal file → Executable file
@ -1,4 +1,4 @@
|
||||
# DocType, Ledger Balance Export
|
||||
# DocType, Multi Ledger Report
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -32,7 +32,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Ledger Balance Export',
|
||||
'parent': u'Multi Ledger Report',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
@ -43,7 +43,7 @@
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Ledger Balance Export',
|
||||
'parent': u'Multi Ledger Report',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
@ -51,10 +51,10 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocType, Ledger Balance Export
|
||||
# DocType, Multi Ledger Report
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Ledger Balance Export'
|
||||
'name': u'Multi Ledger Report'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@ -108,8 +108,8 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'ledger_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Ledger Details',
|
||||
'options': u'Ledger Detail'
|
||||
'label': u'Multi Ledger Report Details',
|
||||
'options': u'Multi Ledger Report Detail'
|
||||
},
|
||||
|
||||
# DocField
|
0
erpnext/accounts/doctype/advance_allocation_detail/__init__.py → erpnext/accounts/doctype/multi_ledger_report_detail/__init__.py
Normal file → Executable file
0
erpnext/accounts/doctype/advance_allocation_detail/__init__.py → erpnext/accounts/doctype/multi_ledger_report_detail/__init__.py
Normal file → Executable file
@ -1,4 +1,4 @@
|
||||
# DocType, Ledger Detail
|
||||
# DocType, Multi Ledger Report Detail
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -30,7 +30,7 @@
|
||||
'label': u'Account',
|
||||
'name': '__common__',
|
||||
'options': u'Account',
|
||||
'parent': u'Ledger Detail',
|
||||
'parent': u'Multi Ledger Report Detail',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
@ -38,10 +38,10 @@
|
||||
'width': u'300px'
|
||||
},
|
||||
|
||||
# DocType, Ledger Detail
|
||||
# DocType, Multi Ledger Report Detail
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Ledger Detail'
|
||||
'name': u'Multi Ledger Report Detail'
|
||||
},
|
||||
|
||||
# DocField
|
@ -39,8 +39,8 @@ class DocType:
|
||||
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.dt = {
|
||||
'Sales Invoice': 'Receivable Voucher',
|
||||
'Purchase Invoice': 'Payable Voucher',
|
||||
'Sales Invoice': 'Sales Invoice',
|
||||
'Purchase Invoice': 'Purchase Invoice',
|
||||
'Journal Voucher': 'Journal Voucher'
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ class DocType:
|
||||
#--------------------------------------------------
|
||||
def create_payment_table(self, gle):
|
||||
for d in gle:
|
||||
ch = addchild(self.doc, 'ir_payment_details', 'IR Payment Detail', 1, self.doclist)
|
||||
ch = addchild(self.doc, 'ir_payment_details', 'Payment to Invoice Matching Tool Detail', 1, 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'))
|
@ -1,4 +1,4 @@
|
||||
# DocType, Internal Reconciliation
|
||||
# DocType, Payment to Invoice Matching Tool
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -29,7 +29,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Internal Reconciliation',
|
||||
'parent': u'Payment to Invoice Matching Tool',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
@ -38,16 +38,16 @@
|
||||
{
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Internal Reconciliation',
|
||||
'parent': u'Payment to Invoice Matching Tool',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1
|
||||
},
|
||||
|
||||
# DocType, Internal Reconciliation
|
||||
# DocType, Payment to Invoice Matching Tool
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Internal Reconciliation'
|
||||
'name': u'Payment to Invoice Matching Tool'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@ -246,7 +246,7 @@
|
||||
'fieldname': u'ir_payment_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Payment Entries',
|
||||
'options': u'IR Payment Detail',
|
||||
'options': u'Payment to Invoice Matching Tool Detail',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
@ -40,14 +40,14 @@ class TestInternalReco(unittest.TestCase):
|
||||
ir[0].save()
|
||||
for t in ir[1:]:
|
||||
t.save(1)
|
||||
sql("update `tabIR Payment Detail` set voucher_no = '%s', voucher_detail_no = '%s' where parent = 'Internal Reconciliation'" % (jv1[0].name, jv1[1].name))
|
||||
sql("update `tabPayment to Invoice Matching Tool Detail` set voucher_no = '%s', voucher_detail_no = '%s' where parent = 'Payment to Invoice Matching Tool'" % (jv1[0].name, jv1[1].name))
|
||||
|
||||
|
||||
sql("update `tabGL Entry` set voucher_no = %s, against_voucher = %s where voucher_no = 'rv1'", (rv1.name, rv1.name))
|
||||
sql("update `tabSingles` set value = %s where doctype = 'Internal Reconciliation' and field = 'voucher_no'", rv1.name)
|
||||
sql("update `tabSingles` set value = %s where doctype = 'Payment to Invoice Matching Tool' and field = 'voucher_no'", rv1.name)
|
||||
|
||||
|
||||
self.ir = get_obj('Internal Reconciliation', with_children=1)
|
||||
self.ir = get_obj('Payment to Invoice Matching Tool', with_children=1)
|
||||
self.ir.reconcile()
|
||||
|
||||
#===========================
|
||||
@ -73,7 +73,7 @@ class TestInternalReco(unittest.TestCase):
|
||||
"""
|
||||
Check whether Outstanding amount has been properly updated in RV
|
||||
"""
|
||||
amt = sql("select outstanding_amount from `tabReceivable Voucher` where name = '%s'" % rv1.name)[0][0]
|
||||
amt = sql("select outstanding_amount from `tabSales Invoice` where name = '%s'" % rv1.name)[0][0]
|
||||
self.assertTrue(amt == 0)
|
||||
|
||||
#============================
|
||||
@ -86,7 +86,7 @@ class TestInternalReco(unittest.TestCase):
|
||||
# test data
|
||||
#---------------
|
||||
rv1 = Document(fielddata={
|
||||
'doctype':'Receivable Voucher',
|
||||
'doctype':'Sales Invoice',
|
||||
'docstatus':1,
|
||||
'debit_to':'cust1 - c1',
|
||||
'grand_total': 100,
|
||||
@ -126,17 +126,17 @@ jv1 = [Document(fielddata={
|
||||
})]
|
||||
|
||||
ir = [Document(fielddata = {
|
||||
'doctype':'Internal Reconciliation',
|
||||
'name' : 'Internal Reconciliation',
|
||||
'doctype':'Payment to Invoice Matching Tool',
|
||||
'name' : 'Payment to Invoice Matching Tool',
|
||||
'account':'cust1 - c1',
|
||||
'voucher_type' : 'Sales Invoice',
|
||||
'voucher_no': 'rv1'
|
||||
}),
|
||||
Document(fielddata = {
|
||||
'parenttype':'Internal Reconciliation',
|
||||
'parenttype':'Payment to Invoice Matching Tool',
|
||||
'parentfield':'ir_payment_details',
|
||||
'doctype':'IR Payment Detail',
|
||||
'parent': 'Internal Reconciliation',
|
||||
'doctype':'Payment to Invoice Matching Tool Detail',
|
||||
'parent': 'Payment to Invoice Matching Tool',
|
||||
'voucher_no': 'jv1',
|
||||
'name' : '123112',
|
||||
'voucher_detail_no' : 'jvd1',
|
||||
@ -178,8 +178,8 @@ rv_gle = Document(fielddata={
|
||||
'company' : 'comp1',
|
||||
'voucher_no': 'rv1',
|
||||
'against_voucher': 'rv1',
|
||||
'against_voucher_type': 'Receivable Voucher',
|
||||
'voucher_type' : 'Receivable Voucher',
|
||||
'against_voucher_type': 'Sales Invoice',
|
||||
'voucher_type' : 'Sales Invoice',
|
||||
'debit': 100,
|
||||
'credit': 0
|
||||
})
|
@ -1,4 +1,4 @@
|
||||
# DocType, IR Payment Detail
|
||||
# DocType, Payment to Invoice Matching Tool Detail
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -27,15 +27,15 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'IR Payment Detail',
|
||||
'parent': u'Payment to Invoice Matching Tool Detail',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, IR Payment Detail
|
||||
# DocType, Payment to Invoice Matching Tool Detail
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'IR Payment Detail'
|
||||
'name': u'Payment to Invoice Matching Tool Detail'
|
||||
},
|
||||
|
||||
# DocField
|
@ -39,7 +39,7 @@ class DocType:
|
||||
|
||||
#--------------------get naming series from sales invoice-----------------
|
||||
def get_series(self):
|
||||
res = sql("select options from `tabDocField` where parent='Receivable Voucher' and fieldname = 'naming_series'")
|
||||
res = sql("select options from `tabDocField` where parent='Sales Invoice' and fieldname = 'naming_series'")
|
||||
return res and cstr(res[0][0]) or ''
|
||||
|
||||
def validate(self):
|
||||
|
@ -243,7 +243,7 @@
|
||||
'label': u'Charge',
|
||||
'oldfieldname': u'charge',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Other Charges'
|
||||
'options': u'Sales Taxes and Charges Master'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@ -266,7 +266,7 @@
|
||||
'label': u'Terms',
|
||||
'oldfieldname': u'tc_name',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Term'
|
||||
'options': u'Terms and Conditions'
|
||||
},
|
||||
|
||||
# DocField
|
||||
|
0
erpnext/accounts/doctype/ledger_balance_export/__init__.py → erpnext/accounts/doctype/purchase_invoice/__init__.py
Executable file → Normal file
0
erpnext/accounts/doctype/ledger_balance_export/__init__.py → erpnext/accounts/doctype/purchase_invoice/__init__.py
Executable file → Normal file
@ -1,13 +1,13 @@
|
||||
// render
|
||||
wn.doclistviews['Payable Voucher'] = wn.views.ListView.extend({
|
||||
wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d);
|
||||
this.fields = this.fields.concat([
|
||||
'`tabPayable Voucher`.supplier_name',
|
||||
'`tabPayable Voucher`.currency',
|
||||
'IFNULL(`tabPayable Voucher`.grand_total_import, 0) as grand_total_import',
|
||||
'IFNULL(`tabPayable Voucher`.grand_total, 0) as grand_total',
|
||||
'IFNULL(`tabPayable Voucher`.outstanding_amount, 0) as outstanding_amount',
|
||||
'`tabPurchase Invoice`.supplier_name',
|
||||
'`tabPurchase Invoice`.currency',
|
||||
'IFNULL(`tabPurchase Invoice`.grand_total_import, 0) as grand_total_import',
|
||||
'IFNULL(`tabPurchase Invoice`.grand_total, 0) as grand_total',
|
||||
'IFNULL(`tabPurchase Invoice`.outstanding_amount, 0) as outstanding_amount',
|
||||
]);
|
||||
this.stats = this.stats.concat(['company']);
|
||||
},
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
cur_frm.cscript.tname = "PV Detail";
|
||||
cur_frm.cscript.tname = "Purchase Invoice Item";
|
||||
cur_frm.cscript.fname = "entries";
|
||||
cur_frm.cscript.other_fname = "purchase_tax_details";
|
||||
wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
|
||||
@ -86,7 +86,7 @@ cur_frm.cscript.supplier = function(doc,dt,dn) {
|
||||
|
||||
var callback2 = function(r,rt){
|
||||
var doc = locals[cur_frm.doctype][cur_frm.docname];
|
||||
var el = getchildren('PV Detail',doc.name,'entries');
|
||||
var el = getchildren('Purchase Invoice Item',doc.name,'entries');
|
||||
for(var i in el){
|
||||
if(el[i].item_code && (!el[i].expense_head || !el[i].cost_center)){
|
||||
args = {
|
||||
@ -139,7 +139,7 @@ cur_frm.cscript.credit_to = function(doc,dt,dn) {
|
||||
//----------------------------------------------
|
||||
cur_frm.fields_dict['entries'].grid.onrowadd = function(doc, cdt, cdn){
|
||||
|
||||
cl = getchildren('PV Detail', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
cl = getchildren('Purchase Invoice Item', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
acc = '';
|
||||
cc = '';
|
||||
|
||||
@ -177,7 +177,7 @@ cur_frm.cscript['Get Items'] = function(doc, dt, dn) {
|
||||
$c_obj(make_doclist(dt,dn),'pull_details','',callback);
|
||||
}
|
||||
|
||||
// ========== PV Details Table ============
|
||||
// ========== Purchase Invoice Items Table ============
|
||||
|
||||
// Item Code
|
||||
// ----------
|
||||
@ -192,7 +192,7 @@ cur_frm.cscript.item_code = function(doc,cdt,cdn){
|
||||
// --------------------------
|
||||
cur_frm.cscript.rate = function(doc,dt,dn) {
|
||||
//This is done as Purchase tax detail and PV detail both contain the same fieldname 'rate'
|
||||
if(dt != 'Purchase Tax Detail') cur_frm.cscript.calc_amount(doc, 2);
|
||||
if(dt != 'Purchase Taxes and Charges') cur_frm.cscript.calc_amount(doc, 2);
|
||||
}
|
||||
|
||||
// Amount
|
||||
@ -218,7 +218,7 @@ cur_frm.cscript.allocated_amount = function(doc,cdt,cdn){
|
||||
refresh_field('tds_allocated', d.name, 'advance_allocation_details');
|
||||
}
|
||||
tot_tds=0
|
||||
el = getchildren('Advance Allocation Detail',doc.name,'advance_allocation_details')
|
||||
el = getchildren('Purchase Invoice Advance',doc.name,'advance_allocation_details')
|
||||
for(var i in el){
|
||||
tot_tds += el[i].tds_allocated
|
||||
}
|
||||
@ -290,7 +290,7 @@ cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn)
|
||||
}
|
||||
|
||||
|
||||
// ================== PV Details Table ===================
|
||||
// ================== Purchase Invoice Items Table ===================
|
||||
// Expense Head
|
||||
// -------------
|
||||
cur_frm.fields_dict['entries'].grid.get_field("expense_head").get_query = function(doc) {
|
||||
@ -299,7 +299,7 @@ cur_frm.fields_dict['entries'].grid.get_field("expense_head").get_query = functi
|
||||
cur_frm.cscript.expense_head = function(doc, cdt, cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.idx == 1 && d.expense_head){
|
||||
var cl = getchildren('PV Detail', doc.name, 'entries', doc.doctype);
|
||||
var cl = getchildren('Purchase Invoice Item', doc.name, 'entries', doc.doctype);
|
||||
for(var i = 0; i < cl.length; i++){
|
||||
if(!cl[i].expense_head) cl[i].expense_head = d.expense_head;
|
||||
}
|
||||
@ -317,7 +317,7 @@ cur_frm.fields_dict['entries'].grid.get_field("cost_center").get_query = functio
|
||||
cur_frm.cscript.cost_center = function(doc, cdt, cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.idx == 1 && d.cost_center){
|
||||
var cl = getchildren('PV Detail', doc.name, 'entries', doc.doctype);
|
||||
var cl = getchildren('Purchase Invoice Item', doc.name, 'entries', doc.doctype);
|
||||
for(var i = 0; i < cl.length; i++){
|
||||
if(!cl[i].cost_center) cl[i].cost_center = d.cost_center;
|
||||
}
|
||||
@ -341,7 +341,7 @@ cur_frm.cscript.tax_code = function(doc, dt, dn) {
|
||||
// ------------------
|
||||
var calc_total_advance = function(doc,cdt,cdn) {
|
||||
var doc = locals[doc.doctype][doc.name];
|
||||
var el = getchildren('Advance Allocation Detail',doc.name,'advance_allocation_details')
|
||||
var el = getchildren('Purchase Invoice Advance',doc.name,'advance_allocation_details')
|
||||
var tot_tds=0;
|
||||
var total_advance = 0;
|
||||
for(var i in el) {
|
@ -37,7 +37,7 @@ from utilities.transaction_base import TransactionBase
|
||||
class DocType(TransactionBase):
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
self.tname = 'PV Detail'
|
||||
self.tname = 'Purchase Invoice Item'
|
||||
self.fname = 'entries'
|
||||
|
||||
# Autoname
|
||||
@ -95,11 +95,11 @@ class DocType(TransactionBase):
|
||||
def pull_details(self):
|
||||
if self.doc.purchase_receipt_main:
|
||||
self.validate_duplicate_docname('purchase_receipt')
|
||||
self.doclist = get_obj('DocType Mapper', 'Purchase Receipt-Payable Voucher').dt_map('Purchase Receipt', 'Payable Voucher', self.doc.purchase_receipt_main, self.doc, self.doclist, "[['Purchase Receipt', 'Payable Voucher'], ['Purchase Receipt Detail', 'PV Detail'], ['Purchase Tax Detail','Purchase Tax Detail']]")
|
||||
self.doclist = get_obj('DocType Mapper', 'Purchase Receipt-Purchase Invoice').dt_map('Purchase Receipt', 'Purchase Invoice', self.doc.purchase_receipt_main, self.doc, self.doclist, "[['Purchase Receipt', 'Purchase Invoice'], ['Purchase Receipt Item', 'Purchase Invoice Item'], ['Purchase Taxes and Charges','Purchase Taxes and Charges']]")
|
||||
|
||||
elif self.doc.purchase_order_main:
|
||||
self.validate_duplicate_docname('purchase_order')
|
||||
self.doclist = get_obj('DocType Mapper', 'Purchase Order-Payable Voucher').dt_map('Purchase Order', 'Payable Voucher', self.doc.purchase_order_main, self.doc, self.doclist, "[['Purchase Order', 'Payable Voucher'],['PO Detail', 'PV Detail'], ['Purchase Tax Detail','Purchase Tax Detail']]")
|
||||
self.doclist = get_obj('DocType Mapper', 'Purchase Order-Purchase Invoice').dt_map('Purchase Order', 'Purchase Invoice', self.doc.purchase_order_main, self.doc, self.doclist, "[['Purchase Order', 'Purchase Invoice'],['Purchase Order Item', 'Purchase Invoice Item'], ['Purchase Taxes and Charges','Purchase Taxes and Charges']]")
|
||||
|
||||
ret = self.get_credit_to()
|
||||
|
||||
@ -153,7 +153,7 @@ class DocType(TransactionBase):
|
||||
# Advance Allocation
|
||||
# -------------------
|
||||
def get_advances(self):
|
||||
get_obj('GL Control').get_advances( self, self.doc.credit_to, 'Advance Allocation Detail','advance_allocation_details','debit')
|
||||
get_obj('GL Control').get_advances( self, self.doc.credit_to, 'Purchase Invoice Advance','advance_allocation_details','debit')
|
||||
|
||||
|
||||
# ============= OTHER CHARGES ====================
|
||||
@ -226,7 +226,7 @@ class DocType(TransactionBase):
|
||||
# ---------------------------------------------------------------------
|
||||
def validate_bill_no(self):
|
||||
if self.doc.bill_no and self.doc.bill_no.lower().strip() not in ['na', 'not applicable', 'none']:
|
||||
b_no = sql("select bill_no, name, ifnull(is_opening,'') from `tabPayable Voucher` where bill_no = '%s' and credit_to = '%s' and docstatus = 1 and name != '%s' " % (self.doc.bill_no, self.doc.credit_to, self.doc.name))
|
||||
b_no = sql("select bill_no, name, ifnull(is_opening,'') from `tabPurchase Invoice` where bill_no = '%s' and credit_to = '%s' and docstatus = 1 and name != '%s' " % (self.doc.bill_no, self.doc.credit_to, self.doc.name))
|
||||
if b_no and cstr(b_no[0][2]) == cstr(self.doc.is_opening):
|
||||
msgprint("Please check you have already booked expense against Bill No. %s in Purchase Invoice %s" % (cstr(b_no[0][0]), cstr(b_no[0][1])))
|
||||
raise Exception , "Validation Error"
|
||||
@ -250,7 +250,7 @@ class DocType(TransactionBase):
|
||||
# Clear Advances
|
||||
# ---------------
|
||||
def clear_advances(self):
|
||||
get_obj('GL Control').clear_advances( self, 'Advance Allocation Detail','advance_allocation_details')
|
||||
get_obj('GL Control').clear_advances( self, 'Purchase Invoice Advance','advance_allocation_details')
|
||||
|
||||
|
||||
# 1. Credit To Account Exists
|
||||
@ -313,7 +313,7 @@ class DocType(TransactionBase):
|
||||
# Validate values with reference document
|
||||
#----------------------------------------
|
||||
def validate_reference_value(self):
|
||||
get_obj('DocType Mapper', 'Purchase Order-Payable Voucher', with_children = 1).validate_reference_value(self, self.doc.name)
|
||||
get_obj('DocType Mapper', 'Purchase Order-Purchase Invoice', with_children = 1).validate_reference_value(self, self.doc.name)
|
||||
|
||||
|
||||
# Validate PO and PR
|
||||
@ -329,7 +329,7 @@ class DocType(TransactionBase):
|
||||
msgprint("Purchase Order: " + cstr(d.purchase_order) + " currency : " + cstr(currency) + " does not match with currency of current document.")
|
||||
raise Exception
|
||||
# import_rate
|
||||
rate = flt(sql('select import_rate from `tabPO Detail` where item_code=%s and parent=%s and name = %s', (d.item_code, d.purchase_order, d.po_detail))[0][0])
|
||||
rate = flt(sql('select import_rate from `tabPurchase Order Item` where item_code=%s and parent=%s and name = %s', (d.item_code, d.purchase_order, d.po_detail))[0][0])
|
||||
if abs(rate - flt(d.import_rate)) > 1:
|
||||
msgprint("Import Rate for %s in the Purchase Order is %s. Rate must be same as Purchase Order Rate" % (d.item_code,rate))
|
||||
raise Exception
|
||||
@ -399,7 +399,7 @@ class DocType(TransactionBase):
|
||||
#check in manage account if purchase order required or not.
|
||||
# ====================================================================================
|
||||
def po_required(self):
|
||||
res = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'po_required'")
|
||||
res = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = 'po_required'")
|
||||
if res and res[0][0] == 'Yes':
|
||||
for d in getlist(self.doclist,'entries'):
|
||||
if not d.purchase_order:
|
||||
@ -409,7 +409,7 @@ class DocType(TransactionBase):
|
||||
#check in manage account if purchase receipt required or not.
|
||||
# ====================================================================================
|
||||
def pr_required(self):
|
||||
res = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'pr_required'")
|
||||
res = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = 'pr_required'")
|
||||
if res and res[0][0] == 'Yes':
|
||||
for d in getlist(self.doclist,'entries'):
|
||||
if not d.purchase_receipt:
|
||||
@ -494,7 +494,7 @@ class DocType(TransactionBase):
|
||||
args = {
|
||||
'voucher_no' : d.journal_voucher,
|
||||
'voucher_detail_no' : d.jv_detail_no,
|
||||
'against_voucher_type' : 'Payable Voucher',
|
||||
'against_voucher_type' : 'Purchase Invoice',
|
||||
'against_voucher' : self.doc.name,
|
||||
'account' : self.doc.credit_to,
|
||||
'is_advance' : 'Yes',
|
@ -1,4 +1,4 @@
|
||||
# DocType, Payable Voucher
|
||||
# DocType, Purchase Invoice
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -32,7 +32,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Payable Voucher',
|
||||
'parent': u'Purchase Invoice',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
@ -41,16 +41,16 @@
|
||||
{
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Payable Voucher',
|
||||
'parent': u'Purchase Invoice',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1
|
||||
},
|
||||
|
||||
# DocType, Payable Voucher
|
||||
# DocType, Purchase Invoice
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Payable Voucher'
|
||||
'name': u'Purchase Invoice'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@ -194,7 +194,7 @@
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'amended_from',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Payable Voucher',
|
||||
'options': u'Purchase Invoice',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
},
|
||||
@ -491,7 +491,7 @@
|
||||
'label': u'Entries',
|
||||
'oldfieldname': u'entries',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'PV Detail',
|
||||
'options': u'Purchase Invoice Item',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@ -536,10 +536,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'purchase_other_charges',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Purchase Other Charges',
|
||||
'label': u'Purchase Taxes and Charges Master',
|
||||
'oldfieldname': u'purchase_other_charges',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Purchase Other Charges',
|
||||
'options': u'Purchase Taxes and Charges Master',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
@ -561,10 +561,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'purchase_tax_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Purchase Tax Details',
|
||||
'label': u'Purchase Taxes and Chargess',
|
||||
'oldfieldname': u'purchase_tax_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Purchase Tax Detail',
|
||||
'options': u'Purchase Taxes and Charges',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@ -773,11 +773,11 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'advance_allocation_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Advance Allocation Details',
|
||||
'label': u'Purchase Invoice Advances',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'advance_allocation_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Advance Allocation Detail',
|
||||
'options': u'Purchase Invoice Advance',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
0
erpnext/accounts/doctype/ledger_detail/__init__.py → erpnext/accounts/doctype/purchase_invoice_advance/__init__.py
Executable file → Normal file
0
erpnext/accounts/doctype/ledger_detail/__init__.py → erpnext/accounts/doctype/purchase_invoice_advance/__init__.py
Executable file → Normal file
@ -1,4 +1,4 @@
|
||||
# DocType, Advance Allocation Detail
|
||||
# DocType, Purchase Invoice Advance
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -27,15 +27,15 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Advance Allocation Detail',
|
||||
'parent': u'Purchase Invoice Advance',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, Advance Allocation Detail
|
||||
# DocType, Purchase Invoice Advance
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Advance Allocation Detail'
|
||||
'name': u'Purchase Invoice Advance'
|
||||
},
|
||||
|
||||
# DocField
|
@ -1,4 +1,4 @@
|
||||
# DocType, PV Detail
|
||||
# DocType, Purchase Invoice Item
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -29,15 +29,15 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'PV Detail',
|
||||
'parent': u'Purchase Invoice Item',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, PV Detail
|
||||
# DocType, Purchase Invoice Item
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'PV Detail'
|
||||
'name': u'Purchase Invoice Item'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@ -280,7 +280,7 @@
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 1,
|
||||
'in_filter': 1,
|
||||
'label': u'PO Detail',
|
||||
'label': u'Purchase Order Item',
|
||||
'oldfieldname': u'po_detail',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 1,
|
@ -1,4 +1,4 @@
|
||||
# DocType, Purchase Tax Detail
|
||||
# DocType, Purchase Taxes and Charges
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -31,15 +31,15 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Purchase Tax Detail',
|
||||
'parent': u'Purchase Taxes and Charges',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, Purchase Tax Detail
|
||||
# DocType, Purchase Taxes and Charges
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Purchase Tax Detail'
|
||||
'name': u'Purchase Taxes and Charges'
|
||||
},
|
||||
|
||||
# DocField
|
@ -1,13 +1,13 @@
|
||||
// render
|
||||
wn.doclistviews['Receivable Voucher'] = wn.views.ListView.extend({
|
||||
wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabReceivable Voucher`.customer_name",
|
||||
"ifnull(`tabReceivable Voucher`.outstanding_amount,0) as outstanding_amount",
|
||||
"ifnull(`tabReceivable Voucher`.grand_total,0) as grand_total",
|
||||
"`tabReceivable Voucher`.currency",
|
||||
"ifnull(`tabReceivable Voucher`.grand_total_export,0) as grand_total_export"
|
||||
"`tabSales Invoice`.customer_name",
|
||||
"ifnull(`tabSales Invoice`.outstanding_amount,0) as outstanding_amount",
|
||||
"ifnull(`tabSales Invoice`.grand_total,0) as grand_total",
|
||||
"`tabSales Invoice`.currency",
|
||||
"ifnull(`tabSales Invoice`.grand_total_export,0) as grand_total_export"
|
||||
]);
|
||||
|
||||
this.stats = this.stats.concat(['company']);
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
cur_frm.cscript.tname = "RV Detail";
|
||||
cur_frm.cscript.tname = "Sales Invoice Item";
|
||||
cur_frm.cscript.fname = "entries";
|
||||
cur_frm.cscript.other_fname = "other_charges";
|
||||
cur_frm.cscript.sales_team_fname = "sales_team";
|
||||
@ -250,7 +250,7 @@ cur_frm.cscript.project_name = function(doc,cdt,cdn){
|
||||
//----------------------------------------------
|
||||
cur_frm.fields_dict['entries'].grid.onrowadd = function(doc, cdt, cdn){
|
||||
|
||||
cl = getchildren('RV Detail', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
cl = getchildren('Sales Invoice Item', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
acc = '';
|
||||
cc = '';
|
||||
|
||||
@ -303,7 +303,7 @@ cur_frm.cscript['Make Delivery Note'] = function() {
|
||||
'from_doctype':doc.doctype,
|
||||
'to_doctype':'Delivery Note',
|
||||
'from_docname':doc.name,
|
||||
'from_to_list':"[['Receivable Voucher','Delivery Note'],['RV Detail','Delivery Note Detail'],['RV Tax Detail','RV Tax Detail'],['Sales Team','Sales Team']]"
|
||||
'from_to_list':"[['Sales Invoice','Delivery Note'],['Sales Invoice Item','Delivery Note Item'],['Sales Taxes and Charges','Sales Taxes and Charges'],['Sales Team','Sales Team']]"
|
||||
}, function(r,rt) {
|
||||
loaddoc('Delivery Note', n);
|
||||
}
|
||||
@ -405,7 +405,7 @@ cur_frm.fields_dict.delivery_note_main.get_query = function(doc) {
|
||||
cur_frm.cscript.income_account = function(doc, cdt, cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.income_account){
|
||||
var cl = getchildren('RV Detail', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
var cl = getchildren('Sales Invoice Item', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
for(var i = 0; i < cl.length; i++){
|
||||
if(!cl[i].income_account) cl[i].income_account = d.income_account;
|
||||
}
|
||||
@ -417,7 +417,7 @@ cur_frm.cscript.income_account = function(doc, cdt, cdn){
|
||||
cur_frm.cscript.cost_center = function(doc, cdt, cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.cost_center){
|
||||
var cl = getchildren('RV Detail', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
var cl = getchildren('Sales Invoice Item', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
for(var i = 0; i < cl.length; i++){
|
||||
if(!cl[i].cost_center) cl[i].cost_center = d.cost_center;
|
||||
}
|
||||
@ -431,7 +431,7 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn){
|
||||
// --------------------
|
||||
cur_frm.cscript.calc_adjustment_amount = function(doc,cdt,cdn) {
|
||||
var doc = locals[doc.doctype][doc.name];
|
||||
var el = getchildren('Advance Adjustment Detail',doc.name,'advance_adjustment_details');
|
||||
var el = getchildren('Sales Invoice Advance',doc.name,'advance_adjustment_details');
|
||||
var total_adjustment_amt = 0
|
||||
for(var i in el) {
|
||||
total_adjustment_amt += flt(el[i].allocated_amount)
|
||||
@ -490,7 +490,7 @@ cur_frm.cscript.convert_into_recurring_invoice = function(doc) {
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
var args = {
|
||||
type: 'Sales Invoice',
|
||||
doctype: 'Receivable Voucher'
|
||||
doctype: 'Sales Invoice'
|
||||
}
|
||||
cur_frm.cscript.notify(doc, args);
|
||||
}
|
@ -36,7 +36,7 @@ class DocType(TransactionBase):
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
self.log = []
|
||||
self.tname = 'RV Detail'
|
||||
self.tname = 'Sales Invoice Item'
|
||||
self.fname = 'entries'
|
||||
|
||||
|
||||
@ -136,13 +136,13 @@ class DocType(TransactionBase):
|
||||
if self.doc.delivery_note_main:
|
||||
self.validate_prev_docname('delivery note')
|
||||
self.doc.clear_table(self.doclist,'other_charges')
|
||||
self.doclist = get_obj('DocType Mapper', 'Delivery Note-Receivable Voucher').dt_map('Delivery Note', 'Receivable Voucher', self.doc.delivery_note_main, self.doc, self.doclist, "[['Delivery Note', 'Receivable Voucher'],['Delivery Note Detail', 'RV Detail'],['RV Tax Detail','RV Tax Detail'],['Sales Team','Sales Team']]")
|
||||
self.doclist = get_obj('DocType Mapper', 'Delivery Note-Sales Invoice').dt_map('Delivery Note', 'Sales Invoice', self.doc.delivery_note_main, self.doc, self.doclist, "[['Delivery Note', 'Sales Invoice'],['Delivery Note Item', 'Sales Invoice Item'],['Sales Taxes and Charges','Sales Taxes and Charges'],['Sales Team','Sales Team']]")
|
||||
self.get_income_account('entries')
|
||||
# Sales Order
|
||||
elif self.doc.sales_order_main:
|
||||
self.validate_prev_docname('sales order')
|
||||
self.doc.clear_table(self.doclist,'other_charges')
|
||||
get_obj('DocType Mapper', 'Sales Order-Receivable Voucher').dt_map('Sales Order', 'Receivable Voucher', self.doc.sales_order_main, self.doc, self.doclist, "[['Sales Order', 'Receivable Voucher'],['Sales Order Detail', 'RV Detail'],['RV Tax Detail','RV Tax Detail'], ['Sales Team', 'Sales Team']]")
|
||||
get_obj('DocType Mapper', 'Sales Order-Sales Invoice').dt_map('Sales Order', 'Sales Invoice', self.doc.sales_order_main, self.doc, self.doclist, "[['Sales Order', 'Sales Invoice'],['Sales Order Item', 'Sales Invoice Item'],['Sales Taxes and Charges','Sales Taxes and Charges'], ['Sales Team', 'Sales Team']]")
|
||||
self.get_income_account('entries')
|
||||
|
||||
ret = self.get_debit_to()
|
||||
@ -239,14 +239,14 @@ class DocType(TransactionBase):
|
||||
# Get Advances
|
||||
# -------------
|
||||
def get_advances(self):
|
||||
get_obj('GL Control').get_advances(self, self.doc.debit_to, 'Advance Adjustment Detail', 'advance_adjustment_details', 'credit')
|
||||
get_obj('GL Control').get_advances(self, self.doc.debit_to, 'Sales Invoice Advance', 'advance_adjustment_details', 'credit')
|
||||
|
||||
#pull project customer
|
||||
#-------------------------
|
||||
def pull_project_customer(self):
|
||||
res = webnotes.conn.sql("select customer from `tabProject` where name = '%s'"%self.doc.project_name)
|
||||
if res:
|
||||
get_obj('DocType Mapper', 'Project-Receivable Voucher').dt_map('Project', 'Receivable Voucher', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Receivable Voucher']]")
|
||||
get_obj('DocType Mapper', 'Project-Sales Invoice').dt_map('Project', 'Sales Invoice', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Sales Invoice']]")
|
||||
|
||||
# ********************************** Server Utility Functions ******************************
|
||||
|
||||
@ -283,7 +283,7 @@ class DocType(TransactionBase):
|
||||
args = {
|
||||
'voucher_no' : d.journal_voucher,
|
||||
'voucher_detail_no' : d.jv_detail_no,
|
||||
'against_voucher_type' : 'Receivable Voucher',
|
||||
'against_voucher_type' : 'Sales Invoice',
|
||||
'against_voucher' : self.doc.name,
|
||||
'account' : self.doc.debit_to,
|
||||
'is_advance' : 'Yes',
|
||||
@ -368,7 +368,7 @@ class DocType(TransactionBase):
|
||||
# Clear Advances
|
||||
# --------------
|
||||
def clear_advances(self):
|
||||
get_obj('GL Control').clear_advances(self, 'Advance Adjustment Detail','advance_adjustment_details')
|
||||
get_obj('GL Control').clear_advances(self, 'Sales Invoice Advance','advance_adjustment_details')
|
||||
|
||||
|
||||
# set aging date
|
||||
@ -397,7 +397,7 @@ class DocType(TransactionBase):
|
||||
def so_dn_required(self):
|
||||
dict = {'Sales Order':'so_required','Delivery Note':'dn_required'}
|
||||
for i in dict:
|
||||
res = webnotes.conn.sql("select value from `tabSingles` where doctype = 'Manage Account' and field = '%s'"%dict[i])
|
||||
res = webnotes.conn.sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = '%s'"%dict[i])
|
||||
if res and res[0][0] == 'Yes':
|
||||
for d in getlist(self.doclist,'entries'):
|
||||
if not d.fields[i.lower().replace(' ','_')]:
|
||||
@ -536,7 +536,7 @@ class DocType(TransactionBase):
|
||||
'transaction_date' : getdate(self.doc.modified).strftime('%Y-%m-%d'),
|
||||
'posting_date' : self.doc.posting_date,
|
||||
'posting_time' : self.doc.posting_time,
|
||||
'voucher_type' : 'Receivable Voucher',
|
||||
'voucher_type' : 'Sales Invoice',
|
||||
'voucher_no' : cstr(self.doc.name),
|
||||
'voucher_detail_no' : cstr(d.name),
|
||||
'actual_qty' : qty,
|
||||
@ -697,7 +697,7 @@ class DocType(TransactionBase):
|
||||
if not self.doc.recurring_id:
|
||||
webnotes.conn.set(self.doc, 'recurring_id', make_autoname('RECINV/.#####'))
|
||||
elif self.doc.recurring_id:
|
||||
webnotes.conn.sql("""update `tabReceivable Voucher` set convert_into_recurring_invoice = 0 where recurring_id = %s""", self.doc.recurring_id)
|
||||
webnotes.conn.sql("""update `tabSales Invoice` set convert_into_recurring_invoice = 0 where recurring_id = %s""", self.doc.recurring_id)
|
||||
|
||||
def set_next_date(self):
|
||||
""" Set next date on which auto invoice will be created"""
|
@ -1,4 +1,4 @@
|
||||
# DocType, Receivable Voucher
|
||||
# DocType, Sales Invoice
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -33,7 +33,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Receivable Voucher',
|
||||
'parent': u'Sales Invoice',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
@ -42,16 +42,16 @@
|
||||
{
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Receivable Voucher',
|
||||
'parent': u'Sales Invoice',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1
|
||||
},
|
||||
|
||||
# DocType, Receivable Voucher
|
||||
# DocType, Sales Invoice
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Receivable Voucher'
|
||||
'name': u'Sales Invoice'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@ -370,7 +370,7 @@
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'amended_from',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Receivable Voucher',
|
||||
'options': u'Sales Invoice',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
},
|
||||
@ -566,7 +566,7 @@
|
||||
'label': u'Entries',
|
||||
'oldfieldname': u'entries',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'RV Detail',
|
||||
'options': u'Sales Invoice Item',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@ -709,7 +709,7 @@
|
||||
'label': u'Charge',
|
||||
'oldfieldname': u'charge',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Other Charges',
|
||||
'options': u'Sales Taxes and Charges Master',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
@ -736,7 +736,7 @@
|
||||
'label': u'Taxes1',
|
||||
'oldfieldname': u'other_charges',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'RV Tax Detail',
|
||||
'options': u'Sales Taxes and Charges',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@ -960,7 +960,7 @@
|
||||
'label': u'Select Terms',
|
||||
'oldfieldname': u'tc_name',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Term',
|
||||
'options': u'Terms and Conditions',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
@ -997,7 +997,7 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'terms',
|
||||
'fieldtype': u'Text Editor',
|
||||
'label': u'Term Details',
|
||||
'label': u'Terms and Conditions Details',
|
||||
'oldfieldname': u'terms',
|
||||
'oldfieldtype': u'Text Editor',
|
||||
'permlevel': 0
|
||||
@ -1262,10 +1262,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'advance_adjustment_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Advance Adjustment Detail',
|
||||
'label': u'Sales Invoice Advance',
|
||||
'oldfieldname': u'advance_adjustment_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Advance Adjustment Detail',
|
||||
'options': u'Sales Invoice Advance',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
@ -1,4 +1,4 @@
|
||||
# DocType, Advance Adjustment Detail
|
||||
# DocType, Sales Invoice Advance
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -28,15 +28,15 @@
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'no_copy': 1,
|
||||
'parent': u'Advance Adjustment Detail',
|
||||
'parent': u'Sales Invoice Advance',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, Advance Adjustment Detail
|
||||
# DocType, Sales Invoice Advance
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Advance Adjustment Detail'
|
||||
'name': u'Sales Invoice Advance'
|
||||
},
|
||||
|
||||
# DocField
|
@ -1,4 +1,4 @@
|
||||
# DocType, RV Detail
|
||||
# DocType, Sales Invoice Item
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -29,15 +29,15 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'RV Detail',
|
||||
'parent': u'Sales Invoice Item',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, RV Detail
|
||||
# DocType, Sales Invoice Item
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'RV Detail'
|
||||
'name': u'Sales Invoice Item'
|
||||
},
|
||||
|
||||
# DocField
|
@ -1,4 +1,4 @@
|
||||
# DocType, RV Tax Detail
|
||||
# DocType, Sales Taxes and Charges
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -30,15 +30,15 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'RV Tax Detail',
|
||||
'parent': u'Sales Taxes and Charges',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, RV Tax Detail
|
||||
# DocType, Sales Taxes and Charges
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'RV Tax Detail'
|
||||
'name': u'Sales Taxes and Charges'
|
||||
},
|
||||
|
||||
# DocField
|
@ -25,14 +25,14 @@ class DocType:
|
||||
# voucher in which tds was applicable for 1st time
|
||||
|
||||
def validate_first_entry(self,obj):
|
||||
if obj.doc.doctype == 'Payable Voucher':
|
||||
if obj.doc.doctype == 'Purchase Invoice':
|
||||
supp_acc = obj.doc.credit_to
|
||||
elif obj.doc.doctype == 'Journal Voucher':
|
||||
supp_acc = obj.doc.supplier_account
|
||||
|
||||
if obj.doc.ded_amount:
|
||||
# first pv
|
||||
first_pv = sql("select posting_date from `tabPayable Voucher` where credit_to = '%s' and docstatus = 1 and tds_category = '%s' and fiscal_year = '%s' and tds_applicable = 'Yes' and (ded_amount != 0 or ded_amount is not null) order by posting_date asc limit 1"%(supp_acc, obj.doc.tds_category, obj.doc.fiscal_year))
|
||||
first_pv = sql("select posting_date from `tabPurchase Invoice` where credit_to = '%s' and docstatus = 1 and tds_category = '%s' and fiscal_year = '%s' and tds_applicable = 'Yes' and (ded_amount != 0 or ded_amount is not null) order by posting_date asc limit 1"%(supp_acc, obj.doc.tds_category, obj.doc.fiscal_year))
|
||||
first_pv_date = first_pv and first_pv[0][0] or ''
|
||||
# first jv
|
||||
first_jv = sql("select posting_date from `tabJournal Voucher` where supplier_account = '%s'and docstatus = 1 and tds_category = '%s' and fiscal_year = '%s' and tds_applicable = 'Yes' and (ded_amount != 0 or ded_amount is not null) order by posting_date asc limit 1"%(supp_acc, obj.doc.tds_category, obj.doc.fiscal_year))
|
||||
@ -58,7 +58,7 @@ class DocType:
|
||||
self.validate_first_entry(obj)
|
||||
|
||||
# get current amount and supplier head
|
||||
if obj.doc.doctype == 'Payable Voucher':
|
||||
if obj.doc.doctype == 'Purchase Invoice':
|
||||
supplier_account = obj.doc.credit_to
|
||||
total_amount=flt(obj.doc.grand_total)
|
||||
for d in getlist(obj.doclist,'advance_allocation_details'):
|
||||
@ -71,7 +71,7 @@ class DocType:
|
||||
if obj.doc.tds_category:
|
||||
# get total billed
|
||||
total_billed = 0
|
||||
pv = sql("select sum(ifnull(grand_total,0)), sum(ifnull(ded_amount,0)) from `tabPayable Voucher` where tds_category = %s and credit_to = %s and fiscal_year = %s and docstatus = 1 and name != %s and is_opening != 'Yes'", (obj.doc.tds_category, supplier_account, obj.doc.fiscal_year, obj.doc.name))
|
||||
pv = sql("select sum(ifnull(grand_total,0)), sum(ifnull(ded_amount,0)) from `tabPurchase Invoice` where tds_category = %s and credit_to = %s and fiscal_year = %s and docstatus = 1 and name != %s and is_opening != 'Yes'", (obj.doc.tds_category, supplier_account, obj.doc.fiscal_year, obj.doc.name))
|
||||
jv = sql("select sum(ifnull(total_debit,0)), sum(ifnull(ded_amount,0)) from `tabJournal Voucher` where tds_category = %s and supplier_account = %s and fiscal_year = %s and docstatus = 1 and name != %s and is_opening != 'Yes'", (obj.doc.tds_category, supplier_account, obj.doc.fiscal_year, obj.doc.name))
|
||||
tds_in_pv = pv and pv[0][1] or 0
|
||||
tds_in_jv = jv and jv[0][1] or 0
|
||||
|
@ -44,14 +44,14 @@ class DocType:
|
||||
# voucher in which tds was applicable for 1st time
|
||||
|
||||
def validate_first_entry(self,obj):
|
||||
if obj.doc.doctype == 'Payable Voucher':
|
||||
if obj.doc.doctype == 'Purchase Invoice':
|
||||
supp_acc = obj.doc.credit_to
|
||||
elif obj.doc.doctype == 'Journal Voucher':
|
||||
supp_acc = obj.doc.supplier_account
|
||||
|
||||
if obj.doc.ded_amount:
|
||||
# first pv
|
||||
first_pv = sql("select posting_date from `tabPayable Voucher` where credit_to = '%s' and docstatus = 1 and tds_category = '%s' and fiscal_year = '%s' and tds_applicable = 'Yes' and (ded_amount != 0 or ded_amount is not null) order by posting_date asc limit 1"%(supp_acc, obj.doc.tds_category, obj.doc.fiscal_year))
|
||||
first_pv = sql("select posting_date from `tabPurchase Invoice` where credit_to = '%s' and docstatus = 1 and tds_category = '%s' and fiscal_year = '%s' and tds_applicable = 'Yes' and (ded_amount != 0 or ded_amount is not null) order by posting_date asc limit 1"%(supp_acc, obj.doc.tds_category, obj.doc.fiscal_year))
|
||||
first_pv_date = first_pv and first_pv[0][0] or ''
|
||||
# first jv
|
||||
first_jv = sql("select posting_date from `tabJournal Voucher` where supplier_account = '%s'and docstatus = 1 and tds_category = '%s' and fiscal_year = '%s' and tds_applicable = 'Yes' and (ded_amount != 0 or ded_amount is not null) order by posting_date asc limit 1"%(supp_acc, obj.doc.tds_category, obj.doc.fiscal_year))
|
||||
@ -77,7 +77,7 @@ class DocType:
|
||||
self.validate_first_entry(obj)
|
||||
|
||||
# get current amount and supplier head
|
||||
if obj.doc.doctype == 'Payable Voucher':
|
||||
if obj.doc.doctype == 'Purchase Invoice':
|
||||
supplier_account = obj.doc.credit_to
|
||||
total_amount=flt(obj.doc.grand_total)
|
||||
for d in getlist(obj.doclist,'advance_allocation_details'):
|
||||
@ -90,7 +90,7 @@ class DocType:
|
||||
if obj.doc.tds_category:
|
||||
# get total billed
|
||||
total_billed = 0
|
||||
pv = sql("select sum(ifnull(grand_total,0)), sum(ifnull(ded_amount,0)) from `tabPayable Voucher` where tds_category = %s and credit_to = %s and fiscal_year = %s and docstatus = 1 and name != %s and is_opening != 'Yes'", (obj.doc.tds_category, supplier_account, obj.doc.fiscal_year, obj.doc.name))
|
||||
pv = sql("select sum(ifnull(grand_total,0)), sum(ifnull(ded_amount,0)) from `tabPurchase Invoice` where tds_category = %s and credit_to = %s and fiscal_year = %s and docstatus = 1 and name != %s and is_opening != 'Yes'", (obj.doc.tds_category, supplier_account, obj.doc.fiscal_year, obj.doc.name))
|
||||
jv = sql("select sum(ifnull(total_debit,0)), sum(ifnull(ded_amount,0)) from `tabJournal Voucher` where tds_category = %s and supplier_account = %s and fiscal_year = %s and docstatus = 1 and name != %s and is_opening != 'Yes'", (obj.doc.tds_category, supplier_account, obj.doc.fiscal_year, obj.doc.name))
|
||||
tds_in_pv = pv and pv[0][1] or 0
|
||||
tds_in_jv = jv and jv[0][1] or 0
|
||||
|
@ -77,7 +77,7 @@ class DocType:
|
||||
msgprint("Please enter from date and to date")
|
||||
else:
|
||||
idx = 1
|
||||
pv_det= sql("Select name,credit_to,grand_total,posting_date, ded_amount from `tabPayable Voucher` where tds_category='%s' And posting_date>= '%s' And posting_date <='%s' and docstatus=1 and ded_amount > 0 Order By posting_date"%(self.doc.tds_category,self.doc.from_date,self.doc.to_date))
|
||||
pv_det= sql("Select name,credit_to,grand_total,posting_date, ded_amount from `tabPurchase Invoice` where tds_category='%s' And posting_date>= '%s' And posting_date <='%s' and docstatus=1 and ded_amount > 0 Order By posting_date"%(self.doc.tds_category,self.doc.from_date,self.doc.to_date))
|
||||
if pv_det:
|
||||
idx = self.make_tds_table(pv_det, idx)
|
||||
|
||||
|
@ -22,7 +22,7 @@ report.customize_filters = function() {
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0;
|
||||
|
||||
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Payable Voucher', report_default:'Aging Date'});
|
||||
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Purchase Invoice', report_default:'Aging Date'});
|
||||
this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:30});
|
||||
this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:45});
|
||||
this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:60});
|
||||
|
@ -89,11 +89,11 @@ for each in sql("select t2.name, t1.supplier_type from tabSupplier t1, tabAccoun
|
||||
|
||||
# get due_date, bill_no, bill_date from PV
|
||||
pv_dict = {}
|
||||
for t in sql("select name, due_date, bill_no, bill_date from `tabPayable Voucher` group by name"):
|
||||
for t in sql("select name, due_date, bill_no, bill_date from `tabPurchase Invoice` group by name"):
|
||||
pv_dict[t[0]] = [cstr(t[1]), t[2], cstr(t[3])]
|
||||
|
||||
# pv outside this period
|
||||
pv_outside_period = [d[0] for d in sql("select distinct name from `tabPayable Voucher` where (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (from_date, to_date))]
|
||||
pv_outside_period = [d[0] for d in sql("select distinct name from `tabPurchase Invoice` where (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (from_date, to_date))]
|
||||
|
||||
|
||||
out = []
|
||||
@ -106,17 +106,17 @@ for r in res:
|
||||
# supplier type
|
||||
r.append(supp_type_dict.get(r[col_idx['Account']], ''))
|
||||
|
||||
if r[col_idx['Voucher Type']] == 'Payable Voucher':
|
||||
if r[col_idx['Voucher Type']] == 'Purchase Invoice':
|
||||
r += pv_dict.get(r[col_idx['Voucher No']], ['', '', ''])
|
||||
else:
|
||||
r += ['', '', '']
|
||||
|
||||
# if entry against Payable Voucher
|
||||
if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher':
|
||||
# if entry against Purchase Invoice
|
||||
if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Purchase Invoice':
|
||||
cond = " and ifnull(against_voucher, '') = '%s'" % r[col_idx['Against Voucher']]
|
||||
|
||||
# if entry against JV & and not adjusted within period
|
||||
elif r[col_idx['Against Voucher Type']] == 'Payable Voucher' and r[col_idx['Against Voucher']] in pv_outside_period:
|
||||
elif r[col_idx['Against Voucher Type']] == 'Purchase Invoice' and r[col_idx['Against Voucher']] in pv_outside_period:
|
||||
booking_amt = 0
|
||||
cond = " and voucher_no = '%s' and ifnull(against_voucher, '') = '%s'" % (r[col_idx['Voucher No']], r[col_idx['Against Voucher']])
|
||||
|
||||
@ -132,7 +132,7 @@ for r in res:
|
||||
total_outstanding_amt += flt(outstanding_amt)
|
||||
|
||||
# add to total booking amount
|
||||
if outstanding_amt and r[col_idx['Voucher Type']] == 'Payable Voucher' and r[col_idx['Against Voucher']]:
|
||||
if outstanding_amt and r[col_idx['Voucher Type']] == 'Purchase Invoice' and r[col_idx['Against Voucher']]:
|
||||
total_booking_amt += flt(booking_amt)
|
||||
|
||||
r += [booking_amt, outstanding_amt]
|
||||
|
@ -16,7 +16,7 @@
|
||||
'criteria_name': 'Accounts Payable',
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Is Cancelled':'','GL Entry\x01Fiscal Year':'','GL Entry\x01Company':'','Payable Voucher\x01Aging Based On':'Posting Date','GL Entry\x01Range 1':'30','GL Entry\x01Range 2':'45','GL Entry\x01Range 3':'60','GL Entry\x01Range 4':'90'}",
|
||||
'filters': "{'GL Entry\x01Is Cancelled':'','GL Entry\x01Fiscal Year':'','GL Entry\x01Company':'','Purchase Invoice\x01Aging Based On':'Posting Date','GL Entry\x01Range 1':'30','GL Entry\x01Range 2':'45','GL Entry\x01Range 3':'60','GL Entry\x01Range 4':'90'}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'sort_by': '`tabGL Entry`.`name`',
|
||||
|
@ -22,7 +22,7 @@ report.customize_filters = function() {
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0;
|
||||
|
||||
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Receivable Voucher', report_default:'Aging Date'});
|
||||
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Sales Invoice', report_default:'Aging Date'});
|
||||
this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
|
||||
this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
|
||||
this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
|
||||
|
@ -84,10 +84,10 @@ for r in res:
|
||||
r.append(terr and terr[0][0] or '')
|
||||
|
||||
outstanding_amt, opening_amt, cond, due_date = 0,0, '', ''
|
||||
# if entry against Receivable Voucher
|
||||
if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Receivable Voucher':
|
||||
# if entry against Sales Invoice
|
||||
if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Sales Invoice':
|
||||
# get due date
|
||||
due_date = sql("select due_date from `tabReceivable Voucher` where name = '%s'" % r[col_idx['Against Voucher']])
|
||||
due_date = sql("select due_date from `tabSales Invoice` where name = '%s'" % r[col_idx['Against Voucher']])
|
||||
due_date = due_date and cstr(due_date[0][0]) or ''
|
||||
|
||||
# get booking amt
|
||||
@ -97,7 +97,7 @@ for r in res:
|
||||
cond = "and against_voucher = '%s' and against_voucher is not null" % r[col_idx['Against Voucher']]
|
||||
|
||||
# if entry against JV & and not adjusted within period
|
||||
elif r[col_idx['Against Voucher Type']] == 'Receivable Voucher' and sql("select name from `tabReceivable Voucher` where name = '%s' and (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (r[col_idx['Against Voucher']], from_date, to_date)):
|
||||
elif r[col_idx['Against Voucher Type']] == 'Sales Invoice' and sql("select name from `tabSales Invoice` where name = '%s' and (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (r[col_idx['Against Voucher']], from_date, to_date)):
|
||||
cond = " and voucher_no = '%s' and ifnull(against_voucher, '') = '%s'" % (r[col_idx['Voucher No']], r[col_idx['Against Voucher']])
|
||||
# if entry against JV and unadjusted
|
||||
elif not r[col_idx['Against Voucher']]:
|
||||
@ -108,7 +108,7 @@ for r in res:
|
||||
# add to total outstanding
|
||||
total_outstanding_amt += flt(outstanding_amt)
|
||||
# add to total booking amount
|
||||
if outstanding_amt and r[col_idx['Voucher Type']] == 'Receivable Voucher' and r[col_idx['Against Voucher']]:
|
||||
if outstanding_amt and r[col_idx['Voucher Type']] == 'Sales Invoice' and r[col_idx['Against Voucher']]:
|
||||
total_opening_amt += flt(opening_amt)
|
||||
|
||||
r += [due_date, opening_amt, outstanding_amt]
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Sales Partner'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Sales Partner'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Sales Partner'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Sales Partner'].df.in_first_page = 1;
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,15 +12,15 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'add_col': "SUM(`tabReceivable Voucher`.`total_commission`) AS 'Total Commission'\nSUM(`tabReceivable Voucher`.`net_total`) AS 'Net Total'\n((SUM(`tabReceivable Voucher`.`total_commission`) / SUM(`tabReceivable Voucher`.`net_total`)) * 100) AS 'Average Commission Rate'",
|
||||
'add_cond': '`tabReceivable Voucher`.`net_total` > 0\n`tabReceivable Voucher`.`total_commission` > 0',
|
||||
'columns': 'Receivable Voucher\x01Business Associate',
|
||||
'add_col': "SUM(`tabSales Invoice`.`total_commission`) AS 'Total Commission'\nSUM(`tabSales Invoice`.`net_total`) AS 'Net Total'\n((SUM(`tabSales Invoice`.`total_commission`) / SUM(`tabSales Invoice`.`net_total`)) * 100) AS 'Average Commission Rate'",
|
||||
'add_cond': '`tabSales Invoice`.`net_total` > 0\n`tabSales Invoice`.`total_commission` > 0',
|
||||
'columns': 'Sales Invoice\x01Business Associate',
|
||||
'criteria_name': 'Business Associate Commission Report',
|
||||
'description': 'Track total commission given to your Business Associate',
|
||||
'doc_type': 'Receivable Voucher',
|
||||
'doc_type': 'Sales Invoice',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Receivable Voucher\x01Submitted':1}",
|
||||
'group_by': '`tabReceivable Voucher`.sales_partner',
|
||||
'filters': "{'Sales Invoice\x01Submitted':1}",
|
||||
'group_by': '`tabSales Invoice`.sales_partner',
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
|
@ -16,7 +16,7 @@
|
||||
'dis_filters': 'fiscal_year',
|
||||
'doc_type': 'Journal Voucher Detail',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Fiscal Year':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':'','Receivable Voucher\x01Aging Based On':'','Payable Voucher\x01Aging Based On':'Transaction Date','Journal Voucher Detail\x01Report Type':'CENVAT CREDIT ACCOUNT - INPUTS (R.G.23 A - PART II)'}",
|
||||
'filters': "{'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Fiscal Year':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':'','Sales Invoice\x01Aging Based On':'','Purchase Invoice\x01Aging Based On':'Transaction Date','Journal Voucher Detail\x01Report Type':'CENVAT CREDIT ACCOUNT - INPUTS (R.G.23 A - PART II)'}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
|
@ -28,7 +28,7 @@ report.customize_filters = function() {
|
||||
this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
|
||||
this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
|
||||
|
||||
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date',ignore : 1, parent:'Receivable Voucher', 'report_default': 'Aging Date'});
|
||||
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date',ignore : 1, parent:'Sales Invoice', 'report_default': 'Aging Date'});
|
||||
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
|
||||
|
@ -66,7 +66,7 @@ for r in row_list:
|
||||
|
||||
for r in res:
|
||||
if r[col_idx['Against Receivable']]:
|
||||
dt=sql("select date(modified), Aging_date from `tabReceivable Voucher` where name='%s'"%r[col_idx['Against Receivable']])
|
||||
dt=sql("select date(modified), Aging_date from `tabSales Invoice` where name='%s'"%r[col_idx['Against Receivable']])
|
||||
r.append('')
|
||||
r.append(dt and cstr(dt[0][0]) or '')
|
||||
r.append(dt and cstr(dt[0][1]) or '')
|
||||
|
@ -18,16 +18,16 @@ report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
filter_list = ['From Voucher Date', 'To Voucher Date', 'Credit To', 'Is Opening', 'From Posting Date', 'To Posting Date']
|
||||
for(var i=0;i<filter_list.length;i++)
|
||||
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +filter_list[i]].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +filter_list[i]].df.filter_hide = 0;
|
||||
|
||||
this.filter_fields_dict['PV Detail'+FILTER_SEP +'Item'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Purchase Invoice Item'+FILTER_SEP +'Item'].df.filter_hide = 0;
|
||||
|
||||
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['PV Detail'+FILTER_SEP +'Item'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Purchase Invoice Item'+FILTER_SEP +'Item'].df.in_first_page = 1;
|
||||
|
||||
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
|
||||
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company
|
||||
this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
|
||||
this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company
|
||||
|
||||
}
|
||||
|
@ -12,18 +12,18 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'Payable Voucher\x01ID,Payable Voucher\x01Credit To,Payable Voucher\x01Company,PV Detail\x01Item,PV Detail\x01Item Name,PV Detail\x01Expense Head,PV Detail\x01Cost Center,PV Detail\x01Qty,PV Detail\x01Rate (Default Curr.),PV Detail\x01Amount (Default Curr.)',
|
||||
'columns': 'Purchase Invoice\x01ID,Purchase Invoice\x01Credit To,Purchase Invoice\x01Company,Purchase Invoice Item\x01Item,Purchase Invoice Item\x01Item Name,Purchase Invoice Item\x01Expense Head,Purchase Invoice Item\x01Cost Center,Purchase Invoice Item\x01Qty,Purchase Invoice Item\x01Rate (Default Curr.),Purchase Invoice Item\x01Amount (Default Curr.)',
|
||||
'criteria_name': 'Itemwise Purchase Register',
|
||||
'description': 'Itemwise Purchase Register',
|
||||
'dis_filters': 'fiscal_year',
|
||||
'doc_type': 'PV Detail',
|
||||
'doc_type': 'Purchase Invoice Item',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Payable Voucher\x01Submitted':1,'Payable Voucher\x01Is Opening':'No','Payable Voucher\x01Company':'','Payable Voucher\x01Fiscal Year':''}",
|
||||
'filters': "{'Purchase Invoice\x01Submitted':1,'Purchase Invoice\x01Is Opening':'No','Purchase Invoice\x01Company':'','Purchase Invoice\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Payable Voucher',
|
||||
'sort_by': '`tabPayable Voucher`.`name`',
|
||||
'parent_doc_type': 'Purchase Invoice',
|
||||
'sort_by': '`tabPurchase Invoice`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
@ -18,18 +18,18 @@ report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
filter_list = ['From Voucher Date', 'To Voucher Date', 'Debit To', 'From Posting Date', 'To Posting Date']
|
||||
for(var i=0;i<filter_list.length;i++)
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +filter_list[i]].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +filter_list[i]].df.filter_hide = 0;
|
||||
|
||||
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Item'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Item Group'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Brand Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Cost Center'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Invoice Item'+FILTER_SEP +'Item'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Invoice Item'+FILTER_SEP +'Item Group'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Invoice Item'+FILTER_SEP +'Brand Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Invoice Item'+FILTER_SEP +'Cost Center'].df.filter_hide = 0;
|
||||
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Item'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Sales Invoice Item'+FILTER_SEP +'Item'].df.in_first_page = 1;
|
||||
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company
|
||||
}
|
||||
|
@ -12,16 +12,16 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'RV Detail\x01Item,RV Detail\x01Item Name,RV Detail\x01Item Group,Receivable Voucher\x01ID,Receivable Voucher\x01Voucher Date,Receivable Voucher\x01Posting Date,Receivable Voucher\x01Debit To,RV Detail\x01Cost Center,Receivable Voucher\x01Territory,RV Detail\x01Income Account,RV Detail\x01Qty,RV Detail\x01Basic Rate*,RV Detail\x01Amount*',
|
||||
'columns': 'Sales Invoice Item\x01Item,Sales Invoice Item\x01Item Name,Sales Invoice Item\x01Item Group,Sales Invoice\x01ID,Sales Invoice\x01Voucher Date,Sales Invoice\x01Posting Date,Sales Invoice\x01Debit To,Sales Invoice Item\x01Cost Center,Sales Invoice\x01Territory,Sales Invoice Item\x01Income Account,Sales Invoice Item\x01Qty,Sales Invoice Item\x01Basic Rate*,Sales Invoice Item\x01Amount*',
|
||||
'criteria_name': 'Itemwise Sales Register',
|
||||
'doc_type': 'RV Detail',
|
||||
'doc_type': 'Sales Invoice Item',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Receivable Voucher\x01Submitted':1,'Receivable Voucher\x01From Posting Date\x01lower':'','Receivable Voucher\x01To Posting Date\x01upper':'','Receivable Voucher\x01Is Opening':'','Receivable Voucher\x01Company':'','Receivable Voucher\x01Fiscal Year':''}",
|
||||
'filters': "{'Sales Invoice\x01Submitted':1,'Sales Invoice\x01From Posting Date\x01lower':'','Sales Invoice\x01To Posting Date\x01upper':'','Sales Invoice\x01Is Opening':'','Sales Invoice\x01Company':'','Sales Invoice\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Receivable Voucher',
|
||||
'sort_by': '`tabRV Detail`.`income_account`',
|
||||
'parent_doc_type': 'Sales Invoice',
|
||||
'sort_by': '`tabSales Invoice Item`.`income_account`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
@ -29,7 +29,7 @@ report.customize_filters = function() {
|
||||
this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
|
||||
this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
|
||||
|
||||
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date',ignore : 1, parent:'Payable Voucher', 'report_default':'Aging Date'});
|
||||
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date',ignore : 1, parent:'Purchase Invoice', 'report_default':'Aging Date'});
|
||||
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
|
||||
|
@ -66,7 +66,7 @@ for r in row_list:
|
||||
|
||||
for r in res:
|
||||
if r[col_idx['Against Payable']]:
|
||||
dt=sql("select date(modified), aging_date from `tabPayable Voucher` where name='%s'"%r[col_idx['Against Payable']])
|
||||
dt=sql("select date(modified), aging_date from `tabPurchase Invoice` where name='%s'"%r[col_idx['Against Payable']])
|
||||
r.append('')
|
||||
r.append(dt and cstr(dt[0][0]) or '')
|
||||
r.append(dt and cstr(dt[0][1]) or '')
|
||||
|
@ -16,7 +16,7 @@
|
||||
'criteria_name': 'Payment Report',
|
||||
'doc_type': 'Journal Voucher Detail',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':'','GL Entry\x01Range 1':'30','GL Entry\x01Range 2':'45','GL Entry\x01Range 3':'60','GL Entry\x01Range 4':'90','Receivable Voucher\x01Aging Based On':'','Payable Voucher\x01Aging Based On':''}",
|
||||
'filters': "{'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':'','GL Entry\x01Range 1':'30','GL Entry\x01Range 2':'45','GL Entry\x01Range 3':'60','GL Entry\x01Range 4':'90','Sales Invoice\x01Aging Based On':'','Purchase Invoice\x01Aging Based On':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'parent_doc_type': 'Journal Voucher',
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
# add expense head columns
|
||||
expense_acc = [c[0] for c in sql("""select distinct expense_head
|
||||
from `tabPV Detail`
|
||||
where parenttype='Payable Voucher'
|
||||
from `tabPurchase Invoice Item`
|
||||
where parenttype='Purchase Invoice'
|
||||
and docstatus=1
|
||||
order by expense_head asc""")]
|
||||
|
||||
@ -31,8 +31,8 @@ for i in expense_acc:
|
||||
|
||||
# Add tax head columns
|
||||
tax_acc = [c[0] for c in sql("""select distinct account_head
|
||||
from `tabPurchase Tax Detail`
|
||||
where parenttype = 'Payable Voucher'
|
||||
from `tabPurchase Taxes and Charges`
|
||||
where parenttype = 'Purchase Invoice'
|
||||
and add_deduct_tax = 'Add'
|
||||
and category in ('For Total', 'For Both')
|
||||
and docstatus=1
|
||||
@ -56,8 +56,8 @@ tax_acc = tax_acc[:-2]
|
||||
for r in res:
|
||||
#Get amounts for expense heads
|
||||
exp_head_amount = sql("""select expense_head, sum(amount)
|
||||
from `tabPV Detail`
|
||||
where parent = %s and parenttype='Payable Voucher'
|
||||
from `tabPurchase Invoice Item`
|
||||
where parent = %s and parenttype='Purchase Invoice'
|
||||
group by expense_head""", (r[col_idx['ID']],))
|
||||
|
||||
#convert the result to dictionary for easy retrieval
|
||||
@ -84,9 +84,9 @@ for r in res:
|
||||
|
||||
#Get tax for account heads
|
||||
acc_head_tax = sql("""select account_head, tax_amount
|
||||
from `tabPurchase Tax Detail`
|
||||
from `tabPurchase Taxes and Charges`
|
||||
where parent = '%s'
|
||||
and parenttype = 'Payable Voucher'
|
||||
and parenttype = 'Purchase Invoice'
|
||||
and add_deduct_tax = 'Add'
|
||||
and category in ('For Total', 'For Both')""" %(r[col_idx['ID']],))
|
||||
|
||||
|
@ -12,12 +12,12 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'add_cond': "`tabPayable Voucher`.is_opening != 'Yes'\n`tabPayable Voucher`.name not like 'OP/%'",
|
||||
'columns': 'Payable Voucher\x01ID,Payable Voucher\x01Voucher Date,Payable Voucher\x01Posting Date,Payable Voucher\x01Credit To,Payable Voucher\x01Expense Head',
|
||||
'add_cond': "`tabPurchase Invoice`.is_opening != 'Yes'\n`tabPurchase Invoice`.name not like 'OP/%'",
|
||||
'columns': 'Purchase Invoice\x01ID,Purchase Invoice\x01Voucher Date,Purchase Invoice\x01Posting Date,Purchase Invoice\x01Credit To,Purchase Invoice\x01Expense Head',
|
||||
'criteria_name': 'Purchase Register',
|
||||
'doc_type': 'Payable Voucher',
|
||||
'doc_type': 'Purchase Invoice',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Payable Voucher\x01Submitted':1}",
|
||||
'filters': "{'Purchase Invoice\x01Submitted':1}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'standard': 'Yes'
|
||||
|
@ -16,17 +16,17 @@
|
||||
|
||||
report.customize_filters = function() {
|
||||
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'ID'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Owner'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Saved'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Submitted'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Cancelled'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Grand Total >='].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Grand Total <='].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Sales Partner'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Is Opening'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'ID'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Owner'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Saved'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Submitted'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Cancelled'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Grand Total >='].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Grand Total <='].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Sales Partner'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Is Opening'].df.filter_hide = 1;
|
||||
}
|
||||
|
@ -17,14 +17,14 @@
|
||||
# add additional columns
|
||||
|
||||
cl = [c[0] for c in sql("""select distinct account_head
|
||||
from `tabRV Tax Detail`
|
||||
where parenttype='Receivable Voucher'
|
||||
from `tabSales Taxes and Charges`
|
||||
where parenttype='Sales Invoice'
|
||||
and docstatus=1
|
||||
order by account_head asc""")]
|
||||
|
||||
income_acc = [c[0] for c in sql("""select distinct income_account
|
||||
from `tabRV Detail`
|
||||
where parenttype='Receivable Voucher'
|
||||
from `tabSales Invoice Item`
|
||||
where parenttype='Sales Invoice'
|
||||
and docstatus=1
|
||||
order by income_account asc""")]
|
||||
|
||||
@ -53,9 +53,9 @@ for r in res:
|
||||
|
||||
#Get amounts for income account
|
||||
income_acc_list = sql("""select income_account, sum(amount)
|
||||
from `tabRV Detail`
|
||||
from `tabSales Invoice Item`
|
||||
where parent = %s
|
||||
and parenttype='Receivable Voucher'
|
||||
and parenttype='Sales Invoice'
|
||||
group by income_account""", (r[col_idx['ID']],))
|
||||
|
||||
#convert the result to dictionary for easy retrieval
|
||||
@ -78,9 +78,9 @@ for r in res:
|
||||
|
||||
#Get tax for account heads
|
||||
acc_head_tax = sql("""select account_head, tax_amount
|
||||
from `tabRV Tax Detail`
|
||||
from `tabSales Taxes and Charges`
|
||||
where parent = '%s'
|
||||
and parenttype = 'Receivable Voucher'""" %(r[col_idx['ID']],))
|
||||
and parenttype = 'Sales Invoice'""" %(r[col_idx['ID']],))
|
||||
|
||||
#Convert the result to dictionary for easy retrieval
|
||||
acc_head_tax_dict = {}
|
||||
|
@ -13,14 +13,14 @@
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'add_col': "`tabAccount`.`parent_account` AS 'Parent Account'\n`tabCustomer`.`territory` AS 'Territory'\n`tabCustomer`.`customer_details` AS 'Customer Details'",
|
||||
'add_cond': "ifnull(`tabReceivable Voucher`.`is_opening`, 'No') = 'No'\n`tabAccount`.name =`tabReceivable Voucher`.debit_to\n`tabCustomer`.`name` = `tabAccount`.`master_name`",
|
||||
'add_cond': "ifnull(`tabSales Invoice`.`is_opening`, 'No') = 'No'\n`tabAccount`.name =`tabSales Invoice`.debit_to\n`tabCustomer`.`name` = `tabAccount`.`master_name`",
|
||||
'add_tab': '`tabAccount`\n`tabCustomer`',
|
||||
'columns': 'Receivable Voucher\x01ID,Receivable Voucher\x01Posting Date,Receivable Voucher\x01Debit To',
|
||||
'columns': 'Sales Invoice\x01ID,Sales Invoice\x01Posting Date,Sales Invoice\x01Debit To',
|
||||
'criteria_name': 'Sales Register',
|
||||
'dis_filters': 'fiscal_year',
|
||||
'doc_type': 'Receivable Voucher',
|
||||
'doc_type': 'Sales Invoice',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Receivable Voucher\x01Submitted':1,'Receivable Voucher\x01Is Opening':''}",
|
||||
'filters': "{'Sales Invoice\x01Submitted':1,'Sales Invoice\x01Is Opening':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
|
@ -18,13 +18,13 @@ report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
//Add filter
|
||||
this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice', report_default:'Sales Invoice', ignore : 1,parent:'RV Tax Detail', single_select :1, in_first_page:1});
|
||||
this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice', report_default:'Sales Invoice', ignore : 1,parent:'Sales Taxes and Charges', single_select :1, in_first_page:1});
|
||||
|
||||
this.add_filter({fieldname:'posting_date', label:'Date', fieldtype:'Date', options:'', ignore : 1,parent:'RV Tax Detail', in_first_page:1});
|
||||
this.add_filter({fieldname:'posting_date', label:'Date', fieldtype:'Date', options:'', ignore : 1,parent:'Sales Taxes and Charges', in_first_page:1});
|
||||
|
||||
this.add_filter({fieldname:'voucher_id', label:'Voucher Id', fieldtype:'Data', options:'', ignore : 1,parent:'RV Tax Detail', in_first_page:1});
|
||||
this.add_filter({fieldname:'voucher_id', label:'Voucher Id', fieldtype:'Data', options:'', ignore : 1,parent:'Sales Taxes and Charges', in_first_page:1});
|
||||
|
||||
this.add_filter({fieldname:'tax_account', label:'Tax Account', fieldtype:'Link', options:'Account', ignore : 1,parent:'RV Tax Detail', in_first_page:1});
|
||||
this.add_filter({fieldname:'tax_account', label:'Tax Account', fieldtype:'Link', options:'Account', ignore : 1,parent:'Sales Taxes and Charges', in_first_page:1});
|
||||
}
|
||||
|
||||
|
||||
@ -36,15 +36,15 @@ this.mytabs.items['Select Columns'].hide();
|
||||
// Get query
|
||||
//--------------------------------------
|
||||
report.get_query = function() {
|
||||
based_on = this.get_filter('RV Tax Detail', 'Based On').get_value();
|
||||
from_date = this.get_filter('RV Tax Detail', 'From Date').get_value();
|
||||
to_date = this.get_filter('RV Tax Detail', 'To Date').get_value();
|
||||
vid = this.get_filter('RV Tax Detail', 'Voucher Id').get_value();
|
||||
acc = this.get_filter('RV Tax Detail', 'Tax Account').get_value();
|
||||
based_on = this.get_filter('Sales Taxes and Charges', 'Based On').get_value();
|
||||
from_date = this.get_filter('Sales Taxes and Charges', 'From Date').get_value();
|
||||
to_date = this.get_filter('Sales Taxes and Charges', 'To Date').get_value();
|
||||
vid = this.get_filter('Sales Taxes and Charges', 'Voucher Id').get_value();
|
||||
acc = this.get_filter('Sales Taxes and Charges', 'Tax Account').get_value();
|
||||
|
||||
date_fld = 'transaction_date';
|
||||
if(based_on == 'Sales Invoice') {
|
||||
based_on = 'Receivable Voucher';
|
||||
based_on = 'Sales Invoice';
|
||||
date_fld = 'voucher_date';
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ report.get_query = function() {
|
||||
if (acc) sp_cond += repl(' AND t2.account_head = "%(acc)s"', {acc:acc});
|
||||
|
||||
return repl('SELECT t1.`name`, t1.`%(dt)s`, t1.`customer_name`, t1.net_total, t2.account_head, t2.description, t2.rate, t2.tax_amount \
|
||||
FROM `tab%(parent)s` t1, `tabRV Tax Detail` t2 \
|
||||
FROM `tab%(parent)s` t1, `tabSales Taxes and Charges` t2 \
|
||||
WHERE t1.docstatus=1 AND t2.`parenttype` = "%(parent)s" \
|
||||
AND t2.`parent` = t1.`name` \
|
||||
%(cond)s ORDER BY t1.`name` DESC, t1.%(dt)s DESC', {parent:based_on, cond:sp_cond, dt:date_fld});
|
||||
|
@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if filter_values.get('based_on') == 'Sales Invoice':
|
||||
based_on_dt = 'Receivable Voucher'
|
||||
based_on_dt = 'Sales Invoice'
|
||||
else:
|
||||
based_on_dt = filter_values.get('based_on')
|
||||
|
||||
|
@ -12,16 +12,16 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'RV Tax Detail\x01Type,RV Tax Detail\x01Account Head,RV Tax Detail\x01Cost Center,RV Tax Detail\x01Description,RV Tax Detail\x01Rate,RV Tax Detail\x01Amount*,RV Tax Detail\x01Total*',
|
||||
'columns': 'Sales Taxes and Charges\x01Type,Sales Taxes and Charges\x01Account Head,Sales Taxes and Charges\x01Cost Center,Sales Taxes and Charges\x01Description,Sales Taxes and Charges\x01Rate,Sales Taxes and Charges\x01Amount*,Sales Taxes and Charges\x01Total*',
|
||||
'criteria_name': 'Voucher wise tax details',
|
||||
'doc_type': 'RV Tax Detail',
|
||||
'doc_type': 'Sales Taxes and Charges',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Delivery Note\x01Submitted':1,'Delivery Note\x01Status':'','Delivery Note\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Delivery Note',
|
||||
'sort_by': '`tabRV Tax Detail`.`parent`',
|
||||
'sort_by': '`tabSales Taxes and Charges`.`parent`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
@ -96,10 +96,10 @@ class DocType:
|
||||
ret = {}
|
||||
st,group = [],[]
|
||||
if module == 'Sales':
|
||||
st = ['Quotation','Sales Order','Delivery Note','Receivable Voucher']
|
||||
st = ['Quotation','Sales Order','Delivery Note','Sales Invoice']
|
||||
group = ['Item','Item Group','Customer','Customer Group','Cost Center']
|
||||
elif module == 'Purchase':
|
||||
st = ['Purchase Order','Purchase Receipt','Payable Voucher']
|
||||
st = ['Purchase Order','Purchase Receipt','Purchase Invoice']
|
||||
group = ['Item','Item Group','Supplier','Supplier Type']
|
||||
|
||||
ret['stmt_type'] = st
|
||||
|
@ -42,7 +42,7 @@ class DocType:
|
||||
def define_globals(self, trans, fiscal_year):
|
||||
self.month_name = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
|
||||
|
||||
if trans == 'Purchase Receipt' or trans == 'Delivery Note' or trans == 'Payable Voucher' or trans == 'Receivable Voucher':
|
||||
if trans == 'Purchase Receipt' or trans == 'Delivery Note' or trans == 'Purchase Invoice' or trans == 'Sales Invoice':
|
||||
self.trans_date = 'posting_date'
|
||||
else:
|
||||
self.trans_date = 'transaction_date'
|
@ -1,4 +1,4 @@
|
||||
# DocType, TA Control
|
||||
# DocType, Trend Analyzer Control
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@ -24,9 +24,9 @@
|
||||
'version': 11
|
||||
},
|
||||
|
||||
# DocType, TA Control
|
||||
# DocType, Trend Analyzer Control
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'TA Control'
|
||||
'name': u'Trend Analyzer Control'
|
||||
}
|
||||
]
|
@ -80,14 +80,14 @@ report.get_query = function() {
|
||||
add_col = '';
|
||||
add_tables = '';
|
||||
sp_cond = '';
|
||||
if(trans == 'Sales Invoice') trans = 'Receivable Voucher';
|
||||
else if(trans == 'Purchase Invoice') trans = 'Payable Voucher';
|
||||
if(trans == 'Sales Invoice') trans = 'Sales Invoice';
|
||||
else if(trans == 'Purchase Invoice') trans = 'Purchase Invoice';
|
||||
|
||||
trans_det = trans+' Detail'
|
||||
|
||||
if(trans == 'Receivable Voucher') trans_det = 'RV Detail';
|
||||
else if(trans == 'Payable Voucher') trans_det = 'PV Detail';
|
||||
else if(trans == 'Purchase Order') trans_det = 'PO Detail';
|
||||
if(trans == 'Sales Invoice') trans_det = 'Sales Invoice Item';
|
||||
else if(trans == 'Purchase Invoice') trans_det = 'Purchase Invoice Item';
|
||||
else if(trans == 'Purchase Order') trans_det = 'Purchase Order Item';
|
||||
|
||||
if(order_type != '') add_code += ' AND t1.order_type = '+order_type;
|
||||
|
||||
@ -117,7 +117,7 @@ report.get_query = function() {
|
||||
if(supp_type) add_cond += ' AND t1.supplier_type = "'+supp_type+'"';
|
||||
break;
|
||||
case 'Project' : pro = this.get_filter('Profile', 'Project').get_value();
|
||||
if (inList(['Purchase Order', 'Purchase Receipt', 'Payable Voucher'], trans)) {
|
||||
if (inList(['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'], trans)) {
|
||||
col = 'DISTINCT t2.project_name';
|
||||
if(pro) add_cond += ' AND t2.project_name = "'+pro+'"';
|
||||
} else {
|
||||
|
@ -39,16 +39,16 @@ project = filter_values.get('project')
|
||||
# ********************************************* SET DEFAULTS **************************************************
|
||||
# Details Table
|
||||
# --------------
|
||||
if trans == 'Sales Invoice': trans = 'Receivable Voucher'
|
||||
elif trans == 'Purchase Invoice': trans = 'Payable Voucher'
|
||||
if trans == 'Sales Invoice': trans = 'Sales Invoice'
|
||||
elif trans == 'Purchase Invoice': trans = 'Purchase Invoice'
|
||||
|
||||
trans_det = trans+' Detail'
|
||||
|
||||
if trans == 'Receivable Voucher': trans_det = 'RV Detail'
|
||||
elif trans == 'Payable Voucher': trans_det = 'PV Detail'
|
||||
elif trans == 'Purchase Order': trans_det = 'PO Detail'
|
||||
if trans == 'Sales Invoice': trans_det = 'Sales Invoice Item'
|
||||
elif trans == 'Purchase Invoice': trans_det = 'Purchase Invoice Item'
|
||||
elif trans == 'Purchase Order': trans_det = 'Purchase Order Item'
|
||||
|
||||
col_names, query_val = get_obj('TA Control').get_single_year_query_value(fiscal_year, period, trans, trans_det)
|
||||
col_names, query_val = get_obj('Trend Analyzer Control').get_single_year_query_value(fiscal_year, period, trans, trans_det)
|
||||
query_val += 'SUM(t2.qty), SUM(t2.amount)'
|
||||
|
||||
col_names.append('Total (Qty)')
|
||||
@ -134,7 +134,7 @@ if supplier_type or based_on == 'Supplier Type':
|
||||
|
||||
# Project
|
||||
if project or based_on == 'Project':
|
||||
if trans in ['Purchase Order', 'Purchase Receipt', 'Payable Voucher']:
|
||||
if trans in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']:
|
||||
add_cond += ' AND t2.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
|
||||
else:
|
||||
add_cond += ' AND t1.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user