[minor] [customer login] renamed order template to sale and use it for order, invoice and delivery note
This commit is contained in:
parent
0e23929740
commit
d5c18d46d0
20
config.json
20
config.json
@ -101,19 +101,32 @@
|
||||
},
|
||||
"order": {
|
||||
"no_cache": true,
|
||||
"template": "app/website/templates/pages/order",
|
||||
"args_method": "selling.doctype.sales_order.sales_order.get_website_args"
|
||||
"template": "app/website/templates/pages/sale",
|
||||
"args_method": "website.helpers.transaction.get_order_args",
|
||||
"for_doctype": "Sales Order"
|
||||
},
|
||||
"orders": {
|
||||
"no_cache": true,
|
||||
"template": "app/website/templates/pages/sales_transactions",
|
||||
"args_method": "website.helpers.transaction.order_list_args"
|
||||
},
|
||||
"invoice": {
|
||||
"no_cache": true,
|
||||
"template": "app/website/templates/pages/sale",
|
||||
"args_method": "website.helpers.transaction.get_invoice_args",
|
||||
"for_doctype": "Sales Invoice"
|
||||
},
|
||||
"invoices": {
|
||||
"no_cache": true,
|
||||
"template": "app/website/templates/pages/sales_transactions",
|
||||
"args_method": "website.helpers.transaction.invoice_list_args"
|
||||
},
|
||||
"shipment": {
|
||||
"no_cache": true,
|
||||
"template": "app/website/templates/pages/sale",
|
||||
"args_method": "website.helpers.transaction.get_shipment_args",
|
||||
"for_doctype": "Delivery Note"
|
||||
},
|
||||
"shipments": {
|
||||
"no_cache": true,
|
||||
"template": "app/website/templates/pages/sales_transactions",
|
||||
@ -130,7 +143,8 @@
|
||||
"ticket": {
|
||||
"no_cache": true,
|
||||
"template": "app/website/templates/pages/ticket",
|
||||
"args_method": "support.doctype.support_ticket.support_ticket.get_website_args"
|
||||
"args_method": "support.doctype.support_ticket.support_ticket.get_website_args",
|
||||
"for_doctype": "Support Ticket"
|
||||
},
|
||||
"tickets": {
|
||||
"template": "app/website/templates/pages/tickets",
|
||||
|
@ -286,22 +286,6 @@ class DocType(SellingController):
|
||||
def on_update(self):
|
||||
pass
|
||||
|
||||
def get_website_args():
|
||||
customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user},
|
||||
"customer")
|
||||
bean = webnotes.bean("Sales Order", webnotes.form_dict.name)
|
||||
if bean.doc.customer != customer:
|
||||
return {
|
||||
"doc": {"name": "Not Allowed"}
|
||||
}
|
||||
else:
|
||||
return {
|
||||
"doc": bean.doc,
|
||||
"doclist": bean.doclist,
|
||||
"webnotes": webnotes,
|
||||
"utils": webnotes.utils,
|
||||
}
|
||||
|
||||
def set_missing_values(source, target):
|
||||
bean = webnotes.bean(target)
|
||||
bean.run_method("onload_post_render")
|
||||
|
@ -117,3 +117,29 @@ def message_list_args():
|
||||
"icon": "icon-comments",
|
||||
"empty_list_message": "No Messages Found",
|
||||
}
|
||||
|
||||
def get_transaction_args(doctype, name):
|
||||
customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user},
|
||||
"customer")
|
||||
|
||||
bean = webnotes.bean(doctype, name)
|
||||
if bean.doc.customer != customer:
|
||||
return {
|
||||
"doc": {"name": "Not Allowed"}
|
||||
}
|
||||
else:
|
||||
return {
|
||||
"doc": bean.doc,
|
||||
"doclist": bean.doclist,
|
||||
"webnotes": webnotes,
|
||||
"utils": webnotes.utils
|
||||
}
|
||||
|
||||
def get_order_args():
|
||||
return get_transaction_args("Sales Order", webnotes.form_dict.name)
|
||||
|
||||
def get_invoice_args():
|
||||
return get_transaction_args("Sales Invoice", webnotes.form_dict.name)
|
||||
|
||||
def get_shipment_args():
|
||||
return get_transaction_args("Delivery Note", webnotes.form_dict.name)
|
||||
|
88
website/templates/pages/invoice.html
Normal file
88
website/templates/pages/invoice.html
Normal file
@ -0,0 +1,88 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% set title=doc.name %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li><a href="account">My Account</a></li>
|
||||
<li><a href="invoices">Invoices</a></li>
|
||||
<li class="active"><i class="icon-file-text icon-fixed-width"></i> {{ doc.name }}</li>
|
||||
</ul>
|
||||
<h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
|
||||
<hr>
|
||||
{%- if doc.status -%}
|
||||
<div style="font-size: 13px;">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="label">{{ doc.status }}</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ utils.formatdate(doc.transaction_date) }}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Sr</th>
|
||||
<th>Item Name</th>
|
||||
<th>Description</th>
|
||||
<th>Qty</th>
|
||||
<th>UoM</th>
|
||||
<th>Basic Rate</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
{%- for row in doclist.get({"doctype":"Sales Order Item"}) %}
|
||||
<tr>
|
||||
<td style="width: 3%;">{{ row.idx }}</td>
|
||||
<td style="width: 20%;">{{ row.item_name }}</td>
|
||||
<td style="width: 37%;">{{ row.description }}</td>
|
||||
<td style="width: 5%; text-align: right;">{{ row.qty }}</td>
|
||||
<td style="width: 5%;">{{ row.stock_uom }}</td>
|
||||
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_rate, currency=doc.currency) }}</td>
|
||||
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_amount, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
{% endfor -%}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6"></div>
|
||||
<div class="col-md-6">
|
||||
<table cellspacing=0 width=100%>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Net Total</td>
|
||||
<td width=40% style="text-align: right;">{{
|
||||
utils.fmt_money(doc.net_total/doc.conversion_rate, currency=doc.currency)
|
||||
}}</td>
|
||||
</tr>
|
||||
{%- for charge in doclist.get({"doctype":"Sales Taxes and Charges"}) -%}
|
||||
{%- if not charge.included_in_print_rate -%}
|
||||
<tr>
|
||||
<td>{{ charge.description }}</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(charge.tax_amount / doc.conversion_rate, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
<tr>
|
||||
<td>Grand Total</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(doc.grand_total_export, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
<tr style='font-weight: bold'>
|
||||
<td>Rounded Total</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(doc.rounded_total_export, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user