Rushabh Mehta | ad45e31 | 2013-11-20 12:59:58 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
Anand Doshi | 330dae9 | 2013-09-10 13:46:15 +0530 | [diff] [blame] | 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | import webnotes |
| 6 | |
Anand Doshi | b0d996f | 2013-09-10 18:29:39 +0530 | [diff] [blame] | 7 | no_cache = True |
| 8 | |
Anand Doshi | 330dae9 | 2013-09-10 13:46:15 +0530 | [diff] [blame] | 9 | def get_context(): |
Rushabh Mehta | df200f3 | 2013-12-25 15:19:22 +0530 | [diff] [blame^] | 10 | from erpnext.templates.utils import get_currency_context |
Anand Doshi | 330dae9 | 2013-09-10 13:46:15 +0530 | [diff] [blame] | 11 | context = get_currency_context() |
| 12 | context.update({ |
| 13 | "title": "Invoices", |
Anand Doshi | 1be5bb7 | 2013-09-12 15:25:38 +0530 | [diff] [blame] | 14 | "method": "accounts.doctype.sales_invoice.templates.pages.invoices.get_invoices", |
Anand Doshi | 330dae9 | 2013-09-10 13:46:15 +0530 | [diff] [blame] | 15 | "icon": "icon-file-text", |
| 16 | "empty_list_message": "No Invoices Found", |
| 17 | "page": "invoice" |
| 18 | }) |
| 19 | return context |
| 20 | |
| 21 | @webnotes.whitelist() |
| 22 | def get_invoices(start=0): |
Rushabh Mehta | df200f3 | 2013-12-25 15:19:22 +0530 | [diff] [blame^] | 23 | from erpnext.templates.utils import get_transaction_list |
Rushabh Mehta | 1f84799 | 2013-12-12 19:12:19 +0530 | [diff] [blame] | 24 | from erpnext.accounts.doctype.sales_invoice.templates.pages.invoice import modify_status |
Anand Doshi | 1be5bb7 | 2013-09-12 15:25:38 +0530 | [diff] [blame] | 25 | invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"]) |
| 26 | for d in invoices: |
| 27 | modify_status(d) |
| 28 | return invoices |