mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 23:22:52 +00:00
[enhancement] request for quotation
This commit is contained in:
83
erpnext/templates/pages/rfq.html
Normal file
83
erpnext/templates/pages/rfq.html
Normal file
@@ -0,0 +1,83 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% block header %}
|
||||
<h1>{{ doc.name }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>{% include "templates/includes/rfq.js" %}</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{% include "templates/includes/breadcrumbs.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block style %}
|
||||
<style>
|
||||
{% include "templates/includes/order/order.css" %}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block header_actions %}
|
||||
{% if doc.items %}
|
||||
<button class="btn btn-primary btn-sm"
|
||||
type="button">
|
||||
{{ _("Submit") }}</button>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="rfq-supplier">{{ doc.supplier }}</div>
|
||||
</div>
|
||||
<div class="col-xs-6 text-muted text-right h6">
|
||||
{{ doc.get_formatted("transaction_date") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rfq-content">
|
||||
<div id="order-container">
|
||||
<div id="rfq-items">
|
||||
<div class="row cart-item-header">
|
||||
<div class="col-sm-6 col-xs-6">
|
||||
Items
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-2 text-right">
|
||||
Qty
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-2 text-right">
|
||||
Rate
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-2 text-right">
|
||||
Amount
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
{% if doc.items %}
|
||||
<div class="rfq-items">
|
||||
{% include "templates/includes/rfq/rfq_items.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if doc.items %}
|
||||
<div class="row grand-total-row">
|
||||
<div class="col-xs-10 text-right">{{ _("Grand Total") }}</div>
|
||||
<div class="col-xs-2 text-right">
|
||||
<span class="tax-grand-total">0.0</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row terms">
|
||||
<div class="col-xs-5 text-left text-muted">{{ _("Terms and Conditions: ") }}</div>
|
||||
</div>
|
||||
<div class="row terms">
|
||||
<div class="col-xs-5 text-left text-muted">
|
||||
<textarea class="form-control terms-feedback" style="border:1px solid #cccccc; padding:4px"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- no-sidebar -->
|
||||
{% endblock %}
|
||||
31
erpnext/templates/pages/rfq.py
Normal file
31
erpnext/templates/pages/rfq.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = 1
|
||||
context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name)
|
||||
context.parents = frappe.form_dict.parents
|
||||
context.doc.supplier = get_supplier()
|
||||
unauthrized_user(context.doc.supplier)
|
||||
context["title"] = frappe.form_dict.name
|
||||
|
||||
def unauthrized_user(supplier):
|
||||
status = check_supplier_has_docname_access(supplier)
|
||||
if status == False:
|
||||
frappe.throw(_("Not Permitted"), frappe.PermissionError)
|
||||
|
||||
def get_supplier():
|
||||
from erpnext.shopping_cart.utils import check_customer_or_supplier
|
||||
key, parties = check_customer_or_supplier()
|
||||
return parties[0] if key == 'Supplier' else ''
|
||||
|
||||
def check_supplier_has_docname_access(supplier):
|
||||
status = True
|
||||
if frappe.form_dict.name not in frappe.db.sql_list("""select parent from `tabRFQ Supplier`
|
||||
where supplier = '{supplier}'""".format(supplier=supplier)):
|
||||
status = False
|
||||
return status
|
||||
Reference in New Issue
Block a user