| # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
| # License: GNU General Public License v3. See license.txt |
| from __future__ import unicode_literals |
| from erpnext.templates.utils import get_transaction_context |
| def get_context(context): |
| order_context = frappe._dict({ |
| "parent_title": "My Orders" |
| order_context.update(get_transaction_context("Sales Order", frappe.form_dict.name)) |
| modify_status(order_context.doc) |
| if 0 < doc.per_billed < 100: |
| doc.status.append(("label-warning", "icon-ok", _("Partially Billed"))) |
| elif doc.per_billed == 100: |
| doc.status.append(("label-success", "icon-ok", _("Billed"))) |
| if 0 < doc.per_delivered < 100: |
| doc.status.append(("label-warning", "icon-truck", _("Partially Delivered"))) |
| elif doc.per_delivered == 100: |
| doc.status.append(("label-success", "icon-truck", _("Delivered"))) |
| doc.status = " " + " ".join(('<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % s |