Merge branch 'develop' into patch-23

This commit is contained in:
Dany Robert 2022-10-04 17:17:30 +05:30 committed by GitHub
commit 74505a116f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 372 additions and 194 deletions

View File

@ -0,0 +1,115 @@
#page-order {
.main-column {
.page-content-wrapper {
.breadcrumb-container {
@media screen and (min-width: 567px) {
padding-left: var(--padding-sm);
}
}
.container.my-4 {
background-color: var(--fg-color);
@media screen and (min-width: 567px) {
padding: 1.25rem 1.5rem;
border-radius: var(--border-radius-md);
box-shadow: var(--card-shadow);
}
}
}
}
}
.indicator-container {
@media screen and (max-width: 567px) {
padding-bottom: 0.8rem;
}
}
.order-items {
padding: 1.5rem 0;
border-bottom: 1px solid var(--border-color);
color: var(--gray-700);
@media screen and (max-width: 567px) {
align-items: flex-start !important;
}
.col-2 {
@media screen and (max-width: 567px) {
flex: auto;
max-width: 28%;
}
}
.order-item-name {
font-size: var(--text-base);
font-weight: 500;
}
.btn:focus,
.btn:hover {
background-color: var(--control-bg);
}
.col-6 {
@media screen and (max-width: 567px) {
max-width: 100%;
}
&.order-item-name {
font-size: var(--text-base);
}
}
}
.item-grand-total {
font-size: var(--text-base);
}
.list-item-name,
.item-total,
.order-container,
.order-qty {
font-size: var(--text-md);
}
.d-s-n {
@media screen and (max-width: 567px) {
display: none;
}
}
.d-l-n {
@media screen and (min-width: 567px) {
display: none;
}
}
.border-btm {
border-bottom: 1px solid var(--border-color);
}
.order-taxes {
display: flex;
@media screen and (min-width: 567px) {
justify-content: flex-end;
}
.col-4 {
padding-right: 0;
.col-8 {
padding-left: 0;
padding-right: 0;
}
@media screen and (max-width: 567px) {
padding-left: 0;
flex: auto;
max-width: 100%;
}
}
}

View File

@ -1,3 +1,4 @@
@import './order-page';
.filter-options { .filter-options {
max-height: 300px; max-height: 300px;
@ -32,19 +33,29 @@
height: 24px; height: 24px;
} }
.website-list .result { .website-list {
margin-top: 2rem; background-color: var(--fg-color);
} padding: 0 var(--padding-lg);
border-radius: var(--border-radius-md);
.result { @media screen and (max-width: 567px) {
border-bottom: 1px solid var(--border-color); margin-left: -2rem;
}
&.result {
border-bottom: 1px solid var(--border-color);
}
} }
.transaction-list-item { .transaction-list-item {
padding: 1rem 0; padding: 1rem 0;
border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
position: relative; position: relative;
&:only-child, &:last-child {
border: 0;
}
a.transaction-item-link { a.transaction-item-link {
position: absolute; position: absolute;
top: 0; top: 0;
@ -68,3 +79,13 @@
line-height: 1.3; line-height: 1.3;
} }
} }
.list-item-name, .item-total {
font-size: var(--font-size-sm);
}
.items-preview {
@media screen and (max-width: 567px) {
margin-top: 1rem;
}
}

View File

@ -6,7 +6,7 @@
aria-label="{{ _('Your email address...') }}" aria-label="{{ _('Your email address...') }}"
aria-describedby="footer-subscribe-button"> aria-describedby="footer-subscribe-button">
<div class="input-group-append"> <div class="input-group-append">
<button class="btn btn-sm btn-default" <button class="btn btn-sm btn-secondary pl-3 pr-3 ml-2"
type="button" id="footer-subscribe-button">{{ _("Get Updates") }}</button> type="button" id="footer-subscribe-button">{{ _("Get Updates") }}</button>
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
{% macro product_image_square(website_image, css_class="") %} {% macro product_image_square(website_image, css_class="") %}
<div class="product-image product-image-square <div class="product-image product-image-square h-100 rounded
{% if not website_image -%} missing-image {%- endif %} {{ css_class }}" {% if not website_image -%} missing-image {%- endif %} {{ css_class }}"
{% if website_image -%} {% if website_image -%}
style="background-image: url('{{ frappe.utils.quoted(website_image) | abs_url }}');" style="background-image: url('{{ frappe.utils.quoted(website_image) | abs_url }}');"

View File

@ -3,7 +3,7 @@
{% macro item_name_and_description(d) %} {% macro item_name_and_description(d) %}
<div class="row item_name_and_description"> <div class="row item_name_and_description">
<div class="col-xs-4 col-sm-2 order-image-col"> <div class="col-xs-4 col-sm-2 order-image-col">
<div class="order-image"> <div class="order-image h-100">
{% if d.thumbnail or d.image %} {% if d.thumbnail or d.image %}
{{ product_image(d.thumbnail or d.image, no_border=True) }} {{ product_image(d.thumbnail or d.image, no_border=True) }}
{% else %} {% else %}
@ -18,6 +18,9 @@
<div class="text-muted small item-description"> <div class="text-muted small item-description">
{{ html2text(d.description) | truncate(140) }} {{ html2text(d.description) | truncate(140) }}
</div> </div>
<span class="text-muted mt-2 d-l-n order-qty">
{{ _("Qty ") }}({{ d.get_formatted("qty") }})
</span>
</div> </div>
</div> </div>
{% endmacro %} {% endmacro %}

View File

@ -1,84 +1,111 @@
{% if doc.taxes %} {% if doc.taxes %}
<tr> <div class="w-100 order-taxes mt-5">
<td class="text-left" colspan="1"> <div class="col-4 d-flex border-btm pb-5">
{{ _("Net Total") }} <div class="item-grand-total col-8">
</td> {{ _("Net Total") }}
<td class="text-right totals" colspan="3"> </div>
{{ doc.get_formatted("net_total") }} <div class="item-grand-total col-4 text-right pr-0">
</td> {{ doc.get_formatted("net_total") }}
</tr> </div>
</div>
</div>
{% endif %} {% endif %}
{% for d in doc.taxes %} {% for d in doc.taxes %}
{% if d.base_tax_amount %} {% if d.base_tax_amount %}
<tr> <div class="order-taxes w-100 mt-5">
<td class="text-left" colspan="1"> <div class="col-4 d-flex border-btm pb-5">
{{ d.description }} <div class="item-grand-total col-8">
</td> {{ d.description }}
<td class="text-right totals" colspan="3"> </div>
{{ d.get_formatted("base_tax_amount") }} <div class="item-grand-total col-4 text-right pr-0">
</td> {{ doc.get_formatted("net_total") }}
</tr> </div>
</div>
</div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if doc.doctype == 'Quotation' %} {% if doc.doctype == 'Quotation' %}
{% if doc.coupon_code %} {% if doc.coupon_code %}
<tr> <div class="w-100 mt-5 order-taxes font-weight-bold">
<td class="text-left total-discount" colspan="1"> <div class="col-4 d-flex border-btm pb-5">
{{ _("Savings") }} <div class="item-grand-total col-8">
</td> {{ _("Savings") }}
<td class="text-right tot_quotation_discount total-discount totals" colspan="3"> </div>
{% set tot_quotation_discount = [] %} <div class="item-grand-total col-4 text-right pr-0">
{%- for item in doc.items -%} {% set tot_quotation_discount = [] %}
{% if tot_quotation_discount.append((((item.price_list_rate * item.qty) {%- for item in doc.items -%}
* item.discount_percentage) / 100)) %} {% if tot_quotation_discount.append((((item.price_list_rate * item.qty)
{% endif %} * item.discount_percentage) / 100)) %}
{% endfor %} {% endif %}
{{ frappe.utils.fmt_money((tot_quotation_discount | sum),currency=doc.currency) }} {% endfor %}
</td> {{ frappe.utils.fmt_money((tot_quotation_discount | sum),currency=doc.currency) }} </div>
</tr> </div>
</div>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if doc.doctype == 'Sales Order' %} {% if doc.doctype == 'Sales Order' %}
{% if doc.coupon_code %} {% if doc.coupon_code %}
<tr> <div class="w-100 order-taxes mt-5">
<td class="text-left total-discount" colspan="2" style="padding-right: 2rem;"> <div class="col-4 d-flex border-btm pb-5">
{{ _("Applied Coupon Code") }} <div class="item-grand-total col-8">
</td> {{ _("Total Amount") }}
<td class="text-right total-discount"> </div>
<span> <div class="item-grand-total col-4 text-right pr-0">
{%- for row in frappe.get_all(doctype="Coupon Code", <span>
fields=["coupon_code"], filters={ "name":doc.coupon_code}) -%} {% set total_amount = [] %}
<span>{{ row.coupon_code }}</span> {%- for item in doc.items -%}
{% endfor %} {% if total_amount.append((item.price_list_rate * item.qty)) %}{% endif %}
</span> {% endfor %}
</td> {{ frappe.utils.fmt_money((total_amount | sum),currency=doc.currency) }}
</tr> </span>
<tr> </div>
<td class="text-left total-discount" colspan="2"> </div>
{{ _("Savings") }} </div>
</td> <div class="order-taxes w-100 mt-5">
<td class="text-right total-discount"> <div class="col-4 d-flex">
<span> <div class="item-grand-total col-8">
{% set tot_SO_discount = [] %} {{ _("Applied Coupon Code") }}
{%- for item in doc.items -%} </div>
{% if tot_SO_discount.append((((item.price_list_rate * item.qty) <div class="item-grand-total col-4 text-right pr-0">
* item.discount_percentage) / 100)) %}{% endif %} <span>
{% endfor %} {%- for row in frappe.get_all(doctype="Coupon Code",
{{ frappe.utils.fmt_money((tot_SO_discount | sum),currency=doc.currency) }} fields=["coupon_code"], filters={ "name":doc.coupon_code}) -%}
</span> <span>{{ row.coupon_code }}</span>
</td> {% endfor %}
</tr> </span>
</div>
</div>
</div>
<div class="order-taxes mt-5">
<div class="col-4 d-flex border-btm pb-5">
<div class="item-grand-total col-8">
{{ _("Savings") }}
</div>
<div class="item-grand-total col-4 text-right pr-0">
<span>
{% set tot_SO_discount = [] %}
{%- for item in doc.items -%}
{% if tot_SO_discount.append((((item.price_list_rate * item.qty)
* item.discount_percentage) / 100)) %}{% endif %}
{% endfor %}
{{ frappe.utils.fmt_money((tot_SO_discount | sum),currency=doc.currency) }}
</span>
</div>
</div>
</div>
{% endif %} {% endif %}
{% endif %} {% endif %}
<tr> <div class="w-100 mt-5 order-taxes font-weight-bold">
<th class="text-left item-grand-total" colspan="1"> <div class="col-4 d-flex">
{{ _("Grand Total") }} <div class="item-grand-total col-8">
</th> {{ _("Grand Total") }}
<th class="text-right item-grand-total totals" colspan="3"> </div>
{{ doc.get_formatted("grand_total") }} <div class="item-grand-total col-4 text-right pr-0">
</th> {{ doc.get_formatted("grand_total") }}
</tr> </div>
</div>
</div>

View File

@ -1,20 +1,22 @@
<div class="web-list-item transaction-list-item"> <div class="web-list-item transaction-list-item">
<div class="row"> <div class="row align-items-center">
<div class="col-sm-4"> <div class="col-sm-4">
<span class="indicator small {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "gray") }}"> <span class="list-item-name font-weight-bold">{{ doc.name }}</span>
{{ doc.name }}</span>
<div class="small text-muted transaction-time" <div class="small text-muted transaction-time"
title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}"> title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}">
{{ frappe.utils.global_date_format(doc.modified) }} {{ frappe.utils.global_date_format(doc.modified) }}
</div> </div>
</div> </div>
<div class="col-sm-5"> <div class="col-sm-3">
<span class="indicator-pill {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "gray") }} list-item-status">{{doc.status}}</span>
</div>
<div class="col-sm-2">
<div class="small text-muted items-preview ellipsis ellipsis-width"> <div class="small text-muted items-preview ellipsis ellipsis-width">
{{ doc.items_preview }} {{ doc.items_preview }}
</div> </div>
</div> </div>
{% if doc.get('grand_total') %} {% if doc.get('grand_total') %}
<div class="col-sm-3 text-right bold"> <div class="col-sm-3 text-right font-weight-bold item-total">
{{ doc.get_formatted("grand_total") }} {{ doc.get_formatted("grand_total") }}
</div> </div>
{% endif %} {% endif %}

View File

@ -5,149 +5,159 @@
{% include "templates/includes/breadcrumbs.html" %} {% include "templates/includes/breadcrumbs.html" %}
{% endblock %} {% endblock %}
{% block title %}{{ doc.name }}{% endblock %} {% block title %}
{{ doc.name }}
{% endblock %}
{% block header %} {% block header %}
<h2 class="m-0">{{ doc.name }}</h2> <h3 class="m-0">{{ doc.name }}</h3>
{% endblock %} {% endblock %}
{% block header_actions %} {% block header_actions %}
<div class="dropdown"> <div class="row">
<button class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <div class="dropdown">
<span class="font-md">{{ _('Actions') }}</span> <button class="btn btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<b class="caret"></b> <span class="font-md">{{ _('Actions') }}</span>
</button> <b class="caret"></b>
<ul class="dropdown-menu dropdown-menu-right" role="menu"> </button>
{% if doc.doctype == 'Purchase Order' and show_make_pi_button %} <ul class="dropdown-menu dropdown-menu-right" role="menu">
<a class="dropdown-item" href="/api/method/erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice_from_portal?purchase_order_name={{ doc.name }}" data-action="make_purchase_invoice">{{ _("Make Purchase Invoice") }}</a> {% if doc.doctype == 'Purchase Order' and show_make_pi_button %}
{% endif %} <a class="dropdown-item"
<a class="dropdown-item" href='/printview?doctype={{ doc.doctype}}&name={{ doc.name }}&format={{ print_format }}' href="/api/method/erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice_from_portal?purchase_order_name={{ doc.name }}"
target="_blank" rel="noopener noreferrer"> data-action="make_purchase_invoice">{{ _("Make Purchase Invoice") }}
{{ _("Print") }} </a>
</a> {% endif %}
</ul> <a class="dropdown-item"
href='/printview?doctype={{ doc.doctype}}&name={{ doc.name }}&format={{ print_format }}' target="_blank"
rel="noopener noreferrer">
{{ _("Print") }}
</a>
</ul>
</div>
<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>
</div> </div>
{% endblock %} {% endblock %}
{% block page_content %} {% block page_content %}
<div class="row transaction-subheading"> <div>
<div class="col-6"> <div class="row transaction-subheading mt-1">
<span class="font-md indicator-pill {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgrey") }}"> <div class="col-6 text-muted small mt-1">
{% if doc.doctype == "Quotation" and not doc.docstatus %} {{ frappe.utils.format_date(doc.transaction_date, 'medium') }}
{{ _("Pending") }} {% if doc.valid_till %}
{% else %} <p>
{{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }} {{ _("Valid Till") }}: {{ frappe.utils.format_date(doc.valid_till, 'medium') }}
</p>
{% endif %} {% endif %}
</span> </div>
</div> </div>
<div class="col-6 text-muted text-right small pt-3"> <div class="row indicator-container mt-2">
{{ frappe.utils.format_date(doc.transaction_date, 'medium') }} <div class="col-10">
{% if doc.valid_till %} <span class="indicator-pill {{ doc.indicator_color or (" blue" if doc.docstatus==1 else "darkgrey" ) }}">
<p> {% if doc.doctype == "Quotation" and not doc.docstatus %}
{{ _("Valid Till") }}: {{ frappe.utils.format_date(doc.valid_till, 'medium') }} {{ _("Pending") }}
</p> {% else %}
{% endif %} {{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }}
</div>
</div>
<p class="small my-3">
{%- set party_name = doc.supplier_name if doc.doctype in ['Supplier Quotation', 'Purchase Invoice', 'Purchase Order'] else doc.customer_name %}
<b>{{ party_name }}</b>
{% if doc.contact_display and doc.contact_display != party_name %}
<br>
{{ doc.contact_display }}
{% endif %}
</p>
{% if doc._header %}
{{ doc._header }}
{% endif %}
<div class="order-container">
<!-- items -->
<table class="order-item-table w-100 table">
<thead class="order-items order-item-header">
<th width="60%">
{{ _("Item") }}
</th>
<th width="20%" class="text-right">
{{ _("Quantity") }}
</th>
<th width="20%" class="text-right">
{{ _("Amount") }}
</th>
</thead>
<tbody>
{% for d in doc.items %}
<tr class="order-items">
<td>
{{ item_name_and_description(d) }}
</td>
<td class="text-right">
{{ d.qty }}
{% if d.delivered_qty is defined and d.delivered_qty != None %}
<p class="text-muted small">{{ _("Delivered") }}&nbsp;{{ d.delivered_qty }}</p>
{% endif %} {% endif %}
</td> </span>
<td class="text-right"> </div>
{{ d.get_formatted("amount") }} <div class="text-right col-2">
<p class="text-muted small">{{ _("Rate:") }}&nbsp;{{ d.get_formatted("rate") }}</p> {%- set party_name = doc.supplier_name if doc.doctype in ['Supplier Quotation', 'Purchase Invoice', 'Purchase
</td> Order'] else doc.customer_name %}
</tr> <b>{{ party_name }}</b>
{% endfor %}
</tbody> {% if doc.contact_display and doc.contact_display != party_name %}
</table> <br>
<!-- taxes --> {{ doc.contact_display }}
<div class="order-taxes d-flex justify-content-end"> {% endif %}
<table> </div>
</div>
{% if doc._header %}
{{ doc._header }}
{% endif %}
<div class="order-container mt-4">
<!-- items -->
<div class="w-100">
<div class="order-items order-item-header mb-1 row text-muted">
<span class="col-5">
{{ _("Item") }}
</span>
<span class="d-s-n col-3">
{{ _("Quantity") }}
</span>
<span class="col-2 pl-10">
{{ _("Rate") }}
</span>
<span class="col-2 text-right">
{{ _("Amount") }}
</span>
</div>
{% for d in doc.items %}
<div class="order-items row align-items-center">
<span class="order-item-name col-5 pr-0">
{{ item_name_and_description(d) }}
</span>
<span class="d-s-n col-3 pl-10">
{{ d.get_formatted("qty") }}
</span>
<span class="order-rate pl-4 col-2">
{{ d.get_formatted("rate") }}
</span>
<span class="col-2 text-right">
{{ d.get_formatted("amount") }}
</span>
</div>
{% endfor %}
</div>
<!-- taxes -->
<div class="">
{% include "erpnext/templates/includes/order/order_taxes.html" %} {% include "erpnext/templates/includes/order/order_taxes.html" %}
</table> </div>
</div> </div>
</div> </div>
{% if enabled_checkout and ((doc.doctype=="Sales Order" and doc.per_billed <= 0) {% if enabled_checkout and ((doc.doctype=="Sales Order" and doc.per_billed <= 0)
or (doc.doctype=="Sales Invoice" and doc.outstanding_amount > 0)) %} or (doc.doctype=="Sales Invoice" and doc.outstanding_amount> 0)) %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="form-column col-sm-6 address-title">
<strong>Payment</strong>
</div>
</div>
</div>
<div class="panel-collapse"> <div class="panel-collapse">
<div class="panel-body text-muted small"> <div class="panel-body text-muted small">
<div class="row"> <div class="row">
<div class="form-column col-sm-6"> <div class="form-column col-sm-6">
{% if available_loyalty_points %} {% 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="form-group">
<div class="h6">Enter Loyalty Points</div> <div class="h6">Enter Loyalty Points</div>
<div class="control-input-wrapper"> <div class="control-input-wrapper">
<div class="control-input"> <div class="control-input">
<input class="form-control" type="number" min="0" max="{{ available_loyalty_points }}" id="loyalty-point-to-redeem"> <input class="form-control" type="number" min="0"
max="{{ available_loyalty_points }}" id="loyalty-point-to-redeem">
</div> </div>
<p class="help-box small text-muted d-none d-sm-block"> Available Points: {{ available_loyalty_points }} </p> <p class="help-box small text-muted d-none d-sm-block"> Available Points: {{
available_loyalty_points }} </p>
</div> </div>
</div> </div>
{% endif %} {% endif %}
</div> </div>
<div class="form-column col-sm-6">
<div id="loyalty-points-status" style="text-align: right"></div>
<div class="page-header-actions-block" data-html-block="header-actions">
<p class="mt-2" style="float: right;">
<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>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -172,17 +182,17 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
</div>
{% if doc.terms %} {% if doc.terms %}
<div class="terms-and-condition text-muted small"> <div class="terms-and-condition text-muted small">
<hr><p>{{ doc.terms }}</p> <hr>
<p>{{ doc.terms }}</p>
</div> </div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block script %} {% block script %}
<script> {% include "templates/pages/order.js" %} </script> <script> {% include "templates/pages/order.js" %}</script>
<script> <script>
window.doc_info = { window.doc_info = {
customer: '{{doc.customer}}', customer: '{{doc.customer}}',
@ -192,4 +202,4 @@
currency: '{{ doc.currency }}' currency: '{{ doc.currency }}'
} }
</script> </script>
{% endblock %} {% endblock %}