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