Website Listing

This commit is contained in:
Anand Doshi
2015-02-23 22:14:12 +05:30
parent a1da88a3d3
commit f9fc04ce8e
37 changed files with 256 additions and 487 deletions

View File

@@ -1,6 +0,0 @@
{% block title %} {{ doc.name }} {% endblock %}
{% block header %}<h2>{{ doc.name }}</h2>{% endblock %}
{% block content%}{% include "templates/includes/sale.html" %}{% endblock %}

View File

@@ -1,31 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, fmt_money
from erpnext.templates.utils import get_transaction_context
no_cache = 1
no_sitemap = 1
def get_context(context):
invoice_context = frappe._dict({
"parent_link": "invoices",
"parent_title": "Invoices"
})
invoice_context.update(get_transaction_context("Sales Invoice", frappe.form_dict.name))
modify_status(invoice_context.doc)
return invoice_context
def modify_status(doc):
doc.status = ""
if flt(doc.outstanding_amount):
doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
("label-warning", "icon-exclamation-sign",
_("To Pay") + " = " + fmt_money(doc.outstanding_amount, currency=doc.currency))
else:
doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
("label-success", "icon-ok", _("Paid"))

View File

@@ -1,6 +0,0 @@
{% block title %} {{ title }} {% endblock %}
{% block header %}<h2>{{ title }}</h2>{% endblock %}
{% block content %}{% include "templates/includes/sales_transactions.html" %}{% endblock %}

View File

@@ -1,29 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.templates.utils import get_currency_context
no_cache = 1
no_sitemap = 1
def get_context(context):
invoices_context = get_currency_context()
invoices_context.update({
"title": "Invoices",
"method": "erpnext.templates.pages.invoices.get_invoices",
"icon": "icon-file-text",
"empty_list_message": "No Invoices Found",
"page": "invoice"
})
return invoices_context
@frappe.whitelist()
def get_invoices(start=0):
from erpnext.templates.utils import get_transaction_list
from erpnext.templates.pages.invoice import modify_status
invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
for d in invoices:
modify_status(d)
return invoices

View File

@@ -1,6 +0,0 @@
{% block title %} {{ doc.name }} {% endblock %}
{% block header %}<h2>{{ doc.name }}</h2>{% endblock %}
{% block content%}{% include "templates/includes/sale.html" %}{% endblock %}

View File

@@ -1,34 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.templates.utils import get_transaction_context
no_cache = 1
no_sitemap = 1
def get_context(context):
order_context = frappe._dict({
"parent_link": "orders",
"parent_title": "My Orders"
})
order_context.update(get_transaction_context("Sales Order", frappe.form_dict.name))
modify_status(order_context.doc)
return order_context
def modify_status(doc):
doc.status = []
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
for s in doc.status))

View File

@@ -1,5 +0,0 @@
{% block title %} {{ title }} {% endblock %}
{% block header %}<h2>{{ title }}</h2>{% endblock %}
{% block content %}{% include "templates/includes/sales_transactions.html" %}{% endblock %}

View File

@@ -1,30 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.templates.utils import get_currency_context, get_transaction_list
from erpnext.templates.pages.order import modify_status
no_cache = 1
no_sitemap = 1
def get_context(context):
orders_context = get_currency_context()
orders_context.update({
"title": "My Orders",
"method": "erpnext.templates.pages.orders.get_orders",
"icon": "icon-list",
"empty_list_message": "No Orders Yet",
"page": "order",
})
return orders_context
@frappe.whitelist()
def get_orders(start=0):
orders = get_transaction_list("Sales Order", start, ["per_billed", "per_delivered"])
for d in orders:
modify_status(d)
return orders

View File

@@ -1,6 +0,0 @@
{% block title %} {{ doc.name }} {% endblock %}
{% block header %}<h2>{{ doc.name }}</h2>{% endblock %}
{% block content%}{% include "templates/includes/sale.html" %}{% endblock %}

View File

@@ -1,17 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.templates.utils import get_transaction_context
no_cache = 1
no_sitemap = 1
def get_context(context):
shipment_context = frappe._dict({
"parent_link": "shipments",
"parent_title": "Shipments"
})
shipment_context.update(get_transaction_context("Delivery Note", frappe.form_dict.name))
return shipment_context

View File

@@ -1,5 +0,0 @@
{% block title %} {{ title }} {% endblock %}
{% block header %}<h2>{{ title }}</h2>{% endblock %}
{% block content %}{% include "templates/includes/sales_transactions.html" %}{% endblock %}

View File

@@ -1,25 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.templates.utils import get_currency_context
no_cache = 1
no_sitemap = 1
def get_context(context):
shipments_context = get_currency_context()
shipments_context.update({
"title": "Shipments",
"method": "erpnext.templates.pages.shipments.get_shipments",
"icon": "icon-truck",
"empty_list_message": "No Shipments Found",
"page": "shipment"
})
return shipments_context
@frappe.whitelist()
def get_shipments(start=0):
from erpnext.templates.utils import get_transaction_list
return get_transaction_list("Delivery Note", start)