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

This commit is contained in:
Rushabh Mehta 2012-10-03 18:44:54 +05:30
commit 7a32ec0f4f
2 changed files with 14 additions and 4 deletions

View File

@ -38,7 +38,7 @@ def execute():
other_charges_deducted = %s, other_charges_deducted = %s,
other_charges_deducted_import = other_charges_deducted / conversion_rate, other_charges_deducted_import = other_charges_deducted / conversion_rate,
grand_total = net_total + other_charges_added - other_charges_deducted, grand_total = net_total + other_charges_added - other_charges_deducted,
grand_total_import = grand_total / conversion_rate, grand_total_import = grand_total / conversion_rate,
total_amount_to_pay = grand_total - total_tds_on_voucher, total_amount_to_pay = grand_total - total_tds_on_voucher,
outstanding_amount = total_amount_to_pay - total_advance outstanding_amount = total_amount_to_pay - total_advance
where where
@ -51,11 +51,17 @@ def execute():
update `tab%s` update `tab%s`
set set
total_tax = %s, total_tax = %s,
other_charges_added = %s,
other_charges_added_import = other_charges_added / conversion_rate,
other_charges_deducted = %s,
other_charges_deducted_import = other_charges_deducted / conversion_rate,
grand_total = net_total + total_tax, grand_total = net_total + total_tax,
grand_total_import = grand_total / conversion_rate grand_total_import = grand_total / conversion_rate,
rounded_total = round(grand_total)
where where
name = %s name = %s
""" % (d[1], '%s', '%s'), (correct_total_tax, d['parent'])) """ % (d['parenttype'], '%s', '%s', '%s', '%s'),
(correct_total_tax, d['tax_added'], d['tax_ded'], d['parent']))
# set in words # set in words
obj = get_obj(d['parenttype'], d['parent'], with_children=1) obj = get_obj(d['parenttype'], d['parent'], with_children=1)
@ -70,7 +76,7 @@ def execute():
# fix gl entries # fix gl entries
if d['parenttype'] == 'Purchase Invoice' and d['docstatus'] == 1: if d['parenttype'] == 'Purchase Invoice' and d['docstatus'] == 1:
webnotes.conn.sql("""update `tabGL Entry` set is_cancelled = 'No' webnotes.conn.sql("""update `tabGL Entry` set is_cancelled = 'Yes'
where voucher_type = %s and voucher_no = %s""", where voucher_type = %s and voucher_no = %s""",
(d['parenttype'], d['parent'])) (d['parenttype'], d['parent']))

View File

@ -615,4 +615,8 @@ patch_list = [
'patch_module': 'patches.october_2012', 'patch_module': 'patches.october_2012',
'patch_file': 'reload_gl_mapper', 'patch_file': 'reload_gl_mapper',
}, },
{
'patch_module': 'patches.october_2012',
'patch_file': 'fix_wrong_vouchers',
},
] ]