merged with slow branch

This commit is contained in:
Nabin Hait
2013-07-18 12:28:09 +05:30
10 changed files with 60 additions and 23 deletions

View File

@@ -374,22 +374,27 @@ class DocType(SellingController):
"compare_fields": [["customer", "="], ["company", "="], ["project_name", "="],
["currency", "="]],
},
"Sales Order Item": {
"ref_dn_field": "so_detail",
"compare_fields": [["export_rate", "="]],
"is_child_table": True
},
"Delivery Note": {
"ref_dn_field": "delivery_note",
"compare_fields": [["customer", "="], ["company", "="], ["project_name", "="],
["currency", "="]],
},
"Delivery Note Item": {
"ref_dn_field": "dn_detail",
"compare_fields": [["export_rate", "="]],
"is_child_table": True
}
})
if cint(webnotes.defaults.get_global_default('maintain_same_sales_rate')):
super(DocType, self).validate_with_previous_doc(self.tname, {
"Sales Order Item": {
"ref_dn_field": "so_detail",
"compare_fields": [["export_rate", "="]],
"is_child_table": True
},
"Delivery Note Item": {
"ref_dn_field": "dn_detail",
"compare_fields": [["export_rate", "="]],
"is_child_table": True
}
})
def set_aging_date(self):
if self.doc.is_opening != 'Yes':
@@ -975,4 +980,4 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters):
and tabAccount.company = '%(company)s'
and tabAccount.%(key)s LIKE '%(txt)s'
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield)})
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield)})

View File

@@ -54,7 +54,7 @@ def execute(filters=None):
row.append(expense_amount)
# net total
row.append(net_total)
row.append(net_total or inv.net_total)
# tax account
total_tax = 0
@@ -121,7 +121,7 @@ def get_conditions(filters):
def get_invoices(filters):
conditions = get_conditions(filters)
return webnotes.conn.sql("""select name, posting_date, credit_to, supplier, supplier_name,
bill_no, bill_date, remarks, grand_total, outstanding_amount
bill_no, bill_date, remarks, net_total, grand_total, outstanding_amount
from `tabPurchase Invoice` where docstatus = 1 %s
order by posting_date desc, name desc""" % conditions, filters, as_dict=1)

View File

@@ -54,7 +54,7 @@ def execute(filters=None):
row.append(income_amount)
# net total
row.append(net_total)
row.append(net_total or inv.net_total)
# tax account
total_tax = 0
@@ -120,7 +120,7 @@ def get_conditions(filters):
def get_invoices(filters):
conditions = get_conditions(filters)
return webnotes.conn.sql("""select name, posting_date, debit_to, project_name, customer,
customer_name, remarks, grand_total, rounded_total, outstanding_amount
customer_name, remarks, net_total, grand_total, rounded_total, outstanding_amount
from `tabSales Invoice`
where docstatus = 1 %s order by posting_date desc, name desc""" %
conditions, filters, as_dict=1)