fix: Issues related to RFQ and Supplier Quotation on Portal (#37565)
fix: RFQ and Supplier Quotation for Portal
This commit is contained in:
parent
1d186efaab
commit
2851a41310
@ -7,7 +7,6 @@ from typing import Optional
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe import _, msgprint, scrub
|
from frappe import _, msgprint, scrub
|
||||||
from frappe.contacts.doctype.address.address import get_company_address, get_default_address
|
from frappe.contacts.doctype.address.address import get_company_address, get_default_address
|
||||||
from frappe.contacts.doctype.contact.contact import get_contact_details
|
|
||||||
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
|
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
|
||||||
from frappe.model.utils import get_fetch_values
|
from frappe.model.utils import get_fetch_values
|
||||||
from frappe.query_builder.functions import Abs, Date, Sum
|
from frappe.query_builder.functions import Abs, Date, Sum
|
||||||
@ -294,7 +293,21 @@ def set_contact_details(party_details, party, party_type):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
party_details.update(get_contact_details(party_details.contact_person))
|
fields = [
|
||||||
|
"name as contact_person",
|
||||||
|
"full_name as contact_display",
|
||||||
|
"email_id as contact_email",
|
||||||
|
"mobile_no as contact_mobile",
|
||||||
|
"phone as contact_phone",
|
||||||
|
"designation as contact_designation",
|
||||||
|
"department as contact_department",
|
||||||
|
]
|
||||||
|
|
||||||
|
contact_details = frappe.db.get_value(
|
||||||
|
"Contact", party_details.contact_person, fields, as_dict=True
|
||||||
|
)
|
||||||
|
|
||||||
|
party_details.update(contact_details)
|
||||||
|
|
||||||
|
|
||||||
def set_other_values(party_details, party, party_type):
|
def set_other_values(party_details, party, party_type):
|
||||||
|
@ -73,6 +73,7 @@ rfq = class rfq {
|
|||||||
|
|
||||||
submit_rfq(){
|
submit_rfq(){
|
||||||
$('.btn-sm').click(function(){
|
$('.btn-sm').click(function(){
|
||||||
|
debugger
|
||||||
frappe.freeze();
|
frappe.freeze();
|
||||||
frappe.call({
|
frappe.call({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@ -82,6 +83,7 @@ rfq = class rfq {
|
|||||||
},
|
},
|
||||||
btn: this,
|
btn: this,
|
||||||
callback: function(r){
|
callback: function(r){
|
||||||
|
debugger
|
||||||
frappe.unfreeze();
|
frappe.unfreeze();
|
||||||
if(r.message){
|
if(r.message){
|
||||||
$('.btn-sm').hide()
|
$('.btn-sm').hide()
|
||||||
|
@ -1,19 +1,25 @@
|
|||||||
{% from "erpnext/templates/includes/macros.html" import product_image_square, product_image %}
|
{% from "erpnext/templates/includes/macros.html" import product_image_square, product_image %}
|
||||||
|
|
||||||
{% macro item_name_and_description(d, doc) %}
|
{% macro item_name_and_description(d, doc) %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
{{ product_image(d.image) }}
|
{% if d.image %}
|
||||||
</div>
|
{{ product_image(d.image) }}
|
||||||
<div class="col-9">
|
{% else %}
|
||||||
{{ d.item_code }}
|
<div class="website-image h-100 w-100" style="background-color:var(--gray-100);text-align: center;line-height: 3.6;">
|
||||||
<p class="text-muted small">{{ d.description }}</p>
|
{{ frappe.utils.get_abbr(d.item_name)}}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-9">
|
||||||
|
{{ d.item_code }}
|
||||||
|
<p class="text-muted small">{{ d.description }}</p>
|
||||||
{% set supplier_part_no = frappe.db.get_value("Item Supplier", {'parent': d.item_code, 'supplier': doc.supplier}, "supplier_part_no") %}
|
{% set supplier_part_no = frappe.db.get_value("Item Supplier", {'parent': d.item_code, 'supplier': doc.supplier}, "supplier_part_no") %}
|
||||||
<p class="text-muted small supplier-part-no">
|
<p class="text-muted small supplier-part-no">
|
||||||
{% if supplier_part_no %}
|
{% if supplier_part_no %}
|
||||||
{{_("Supplier Part No") + ": "+ supplier_part_no}}
|
{{_("Supplier Part No") + ": "+ supplier_part_no}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{% extends "templates/web.html" %}
|
{% extends "templates/web.html" %}
|
||||||
{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
|
{% from "erpnext/templates/includes/macros.html" import product_image %}
|
||||||
|
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
{% include "templates/includes/breadcrumbs.html" %}
|
{% include "templates/includes/breadcrumbs.html" %}
|
||||||
@ -34,18 +34,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% if show_pay_button %}
|
|
||||||
<div class="form-column col-sm-6">
|
|
||||||
<div class="page-header-actions-block" data-html-block="header-actions">
|
|
||||||
<p>
|
|
||||||
<a href="/api/method/erpnext.accounts.doctype.payment_request.payment_request.make_payment_request?dn={{ doc.name }}&dt={{ doc.doctype }}&submit_doc=1&order_type=Shopping Cart"
|
|
||||||
class="btn btn-primary btn-sm" id="pay-for-order">
|
|
||||||
{{ _("Pay") }} {{doc.get_formatted("grand_total") }}
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@ -130,42 +118,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if enabled_checkout and ((doc.doctype=="Sales Order" and doc.per_billed <= 0)
|
|
||||||
or (doc.doctype=="Sales Invoice" and doc.outstanding_amount> 0)) %}
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-collapse">
|
|
||||||
<div class="panel-body text-muted small">
|
|
||||||
<div class="row">
|
|
||||||
<div class="form-column col-sm-6">
|
|
||||||
{% if available_loyalty_points %}
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="row">
|
|
||||||
<div class="form-column col-sm-6 address-title">
|
|
||||||
<strong>Loyalty Points</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="h6">Enter Loyalty Points</div>
|
|
||||||
<div class="control-input-wrapper">
|
|
||||||
<div class="control-input">
|
|
||||||
<input class="form-control" type="number" min="0"
|
|
||||||
max="{{ available_loyalty_points }}" id="loyalty-point-to-redeem">
|
|
||||||
</div>
|
|
||||||
<p class="help-box small text-muted d-none d-sm-block"> Available Points: {{
|
|
||||||
available_loyalty_points }} </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
{% if attachments %}
|
{% if attachments %}
|
||||||
<div class="order-item-table">
|
<div class="order-item-table">
|
||||||
<div class="row order-items order-item-header text-muted">
|
<div class="row order-items order-item-header text-muted">
|
||||||
@ -193,15 +145,27 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block script %}
|
{% macro item_name_and_description(d) %}
|
||||||
<script> {% include "templates/pages/order.js" %}</script>
|
<div class="row item_name_and_description">
|
||||||
<script>
|
<div class="col-xs-4 col-sm-2 order-image-col">
|
||||||
window.doc_info = {
|
<div class="order-image h-100">
|
||||||
customer: '{{doc.customer}}',
|
{% if d.thumbnail or d.image %}
|
||||||
doctype: '{{ doc.doctype }}',
|
{{ product_image(d.thumbnail or d.image, no_border=True) }}
|
||||||
doctype_name: '{{ doc.name }}',
|
{% else %}
|
||||||
grand_total: '{{ doc.grand_total }}',
|
<div class="no-image-cart-item" style="min-height: 100px;">
|
||||||
currency: '{{ doc.currency }}'
|
{{ frappe.utils.get_abbr(d.item_name) or "NA" }}
|
||||||
}
|
</div>
|
||||||
</script>
|
{% endif %}
|
||||||
{% endblock %}
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-8 col-sm-10">
|
||||||
|
{{ d.item_code }}
|
||||||
|
<div class="text-muted small item-description">
|
||||||
|
{{ html2text(d.description) | truncate(140) }}
|
||||||
|
</div>
|
||||||
|
<span class="text-muted mt-2 d-l-n order-qty">
|
||||||
|
{{ _("Qty ") }}({{ d.get_formatted("qty") }})
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
@ -1,7 +1,7 @@
|
|||||||
{% extends "templates/web.html" %}
|
{% extends "templates/web.html" %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<h1>{{ doc.name }}</h1>
|
<h1 style="margin-top: 10px;">{{ doc.name }}</h1>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block script %}
|
{% block script %}
|
||||||
@ -16,7 +16,7 @@
|
|||||||
{% if doc.items %}
|
{% if doc.items %}
|
||||||
<button class="btn btn-primary btn-sm"
|
<button class="btn btn-primary btn-sm"
|
||||||
type="button">
|
type="button">
|
||||||
{{ _("Submit") }}</button>
|
{{ _("Make Quotation") }}</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user