blob: 448c525068de0549321010cfd7029d0687883d69 [file] [log] [blame]
Rushabh Mehtaad45e312013-11-20 12:59:58 +05301# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
Anand Doshi330dae92013-09-10 13:46:15 +05302# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5import webnotes
6
Anand Doshib0d996f2013-09-10 18:29:39 +05307no_cache = True
8
Anand Doshi330dae92013-09-10 13:46:15 +05309def get_context():
Rushabh Mehtadf200f32013-12-25 15:19:22 +053010 from erpnext.templates.utils import get_currency_context
Anand Doshi330dae92013-09-10 13:46:15 +053011 context = get_currency_context()
12 context.update({
13 "title": "Invoices",
Anand Doshi1be5bb72013-09-12 15:25:38 +053014 "method": "accounts.doctype.sales_invoice.templates.pages.invoices.get_invoices",
Anand Doshi330dae92013-09-10 13:46:15 +053015 "icon": "icon-file-text",
16 "empty_list_message": "No Invoices Found",
17 "page": "invoice"
18 })
19 return context
20
21@webnotes.whitelist()
22def get_invoices(start=0):
Rushabh Mehtadf200f32013-12-25 15:19:22 +053023 from erpnext.templates.utils import get_transaction_list
Rushabh Mehta1f847992013-12-12 19:12:19 +053024 from erpnext.accounts.doctype.sales_invoice.templates.pages.invoice import modify_status
Anand Doshi1be5bb72013-09-12 15:25:38 +053025 invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
26 for d in invoices:
27 modify_status(d)
28 return invoices