From feb8669cbde3cb784b8ad5169834921dd83f4138 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 14 Jun 2013 17:40:48 +0530 Subject: [PATCH] [Reports][Validation changes in Purchase and Sales trends] --- .../purchase_invoice_trends/purchase_invoice_trends.py | 6 +++--- accounts/report/purchase_register/purchase_register.py | 1 + .../report/sales_invoice_trends/sales_invoice_trends.py | 4 ++-- .../report/purchase_order_trends/purchase_order_trends.py | 4 ++-- selling/report/quotation_trends/quotation_trends.py | 4 ++-- selling/report/sales_order_trends/sales_order_trends.py | 4 ++-- stock/report/delivery_note_trends/delivery_note_trends.py | 4 ++-- .../purchase_receipt_trends/purchase_receipt_trends.py | 4 ++-- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py b/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py index a38c37cdb5..b2f376b471 100644 --- a/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py +++ b/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py @@ -27,8 +27,8 @@ def execute(filters=None): details = get_columns(filters, trans) data = get_data(filters, tab, details) - - if data == '': - webnotes.msgprint("Data Not Available") + + if not data : + webnotes.msgprint("Data not found for selected criterias") return details["columns"], data \ No newline at end of file diff --git a/accounts/report/purchase_register/purchase_register.py b/accounts/report/purchase_register/purchase_register.py index 7c4b38671d..548b561344 100644 --- a/accounts/report/purchase_register/purchase_register.py +++ b/accounts/report/purchase_register/purchase_register.py @@ -107,6 +107,7 @@ def get_invoices(filters): from `tabPurchase Invoice` where docstatus = 1 %s order by posting_date desc, name desc""" % conditions, filters, as_dict=1) + def get_invoice_expense_map(invoice_list): expense_details = webnotes.conn.sql("""select parent, expense_head, sum(amount) as amount from `tabPurchase Invoice Item` where parent in (%s) group by parent, expense_head""" % diff --git a/accounts/report/sales_invoice_trends/sales_invoice_trends.py b/accounts/report/sales_invoice_trends/sales_invoice_trends.py index 3839900b46..11d6665ff3 100644 --- a/accounts/report/sales_invoice_trends/sales_invoice_trends.py +++ b/accounts/report/sales_invoice_trends/sales_invoice_trends.py @@ -28,7 +28,7 @@ def execute(filters=None): details = get_columns(filters, trans) data = get_data(filters, tab, details) - if data == '': - webnotes.msgprint("Data Not Available") + if not data : + webnotes.msgprint("Data not found for selected criterias") return details["columns"], data \ No newline at end of file diff --git a/buying/report/purchase_order_trends/purchase_order_trends.py b/buying/report/purchase_order_trends/purchase_order_trends.py index 063bef43f2..301124fd3b 100644 --- a/buying/report/purchase_order_trends/purchase_order_trends.py +++ b/buying/report/purchase_order_trends/purchase_order_trends.py @@ -28,7 +28,7 @@ def execute(filters=None): details = get_columns(filters, trans) data = get_data(filters, tab, details) - if data == '': - webnotes.msgprint("Data Not Available") + if not data : + webnotes.msgprint("Data not found for selected criterias") return details["columns"], data \ No newline at end of file diff --git a/selling/report/quotation_trends/quotation_trends.py b/selling/report/quotation_trends/quotation_trends.py index 548a4a8253..e341752cd0 100644 --- a/selling/report/quotation_trends/quotation_trends.py +++ b/selling/report/quotation_trends/quotation_trends.py @@ -28,7 +28,7 @@ def execute(filters=None): details = get_columns(filters, trans) data = get_data(filters, tab, details) - if data == '': - webnotes.msgprint("Data Not Available") + if not data: + webnotes.msgprint("Data not found for selected criterias") return details["columns"], data \ No newline at end of file diff --git a/selling/report/sales_order_trends/sales_order_trends.py b/selling/report/sales_order_trends/sales_order_trends.py index e3d9d9f523..d556a58d37 100644 --- a/selling/report/sales_order_trends/sales_order_trends.py +++ b/selling/report/sales_order_trends/sales_order_trends.py @@ -28,7 +28,7 @@ def execute(filters=None): details = get_columns(filters, trans) data = get_data(filters, tab, details) - if data == '': - webnotes.msgprint("Data Not Available") + if not data : + webnotes.msgprint("Data not found for selected criterias") return details["columns"], data \ No newline at end of file diff --git a/stock/report/delivery_note_trends/delivery_note_trends.py b/stock/report/delivery_note_trends/delivery_note_trends.py index a161c65eee..369b6a36b1 100644 --- a/stock/report/delivery_note_trends/delivery_note_trends.py +++ b/stock/report/delivery_note_trends/delivery_note_trends.py @@ -28,7 +28,7 @@ def execute(filters=None): details = get_columns(filters, trans) data = get_data(filters, tab, details) - if data == '': - webnotes.msgprint("Data Not Available") + if not data : + webnotes.msgprint("Data not found for selected criterias") return details["columns"], data \ No newline at end of file diff --git a/stock/report/purchase_receipt_trends/purchase_receipt_trends.py b/stock/report/purchase_receipt_trends/purchase_receipt_trends.py index abce01eedd..bd089fafa2 100644 --- a/stock/report/purchase_receipt_trends/purchase_receipt_trends.py +++ b/stock/report/purchase_receipt_trends/purchase_receipt_trends.py @@ -28,7 +28,7 @@ def execute(filters=None): details = get_columns(filters, trans) data = get_data(filters, tab, details) - if data == '': - webnotes.msgprint("Data Not Available") + if not data : + webnotes.msgprint("Data not found for selected criterias") return details["columns"], data \ No newline at end of file