Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | import frappe |
Neil Trini Lasrado | d718c93 | 2014-10-22 15:56:38 +0530 | [diff] [blame^] | 6 | from erpnext.templates.utils import get_currency_context |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 7 | |
| 8 | no_cache = 1 |
| 9 | no_sitemap = 1 |
| 10 | |
| 11 | def get_context(context): |
| 12 | invoices_context = get_currency_context() |
| 13 | invoices_context.update({ |
| 14 | "title": "Invoices", |
Neil Trini Lasrado | d718c93 | 2014-10-22 15:56:38 +0530 | [diff] [blame^] | 15 | "method": "erpnext.templates.pages.invoices.get_invoices", |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 16 | "icon": "icon-file-text", |
| 17 | "empty_list_message": "No Invoices Found", |
| 18 | "page": "invoice" |
| 19 | }) |
| 20 | return invoices_context |
| 21 | |
| 22 | @frappe.whitelist() |
| 23 | def get_invoices(start=0): |
Neil Trini Lasrado | d718c93 | 2014-10-22 15:56:38 +0530 | [diff] [blame^] | 24 | from erpnext.templates.utils import get_transaction_list |
| 25 | from erpnext.templates.pages.invoice import modify_status |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 26 | invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"]) |
| 27 | for d in invoices: |
| 28 | modify_status(d) |
| 29 | return invoices |