Merge pull request #17769 from deepeshgarg007/dimensions
feat: Configurable Accounting Dimensions
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index b75b8b8..d5f86a1 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -397,7 +397,7 @@
net_total += item.net_amount
# discount amount rounding loss adjustment if no taxes
- if (not taxes or self.doc.apply_discount_on == "Net Total") \
+ if (self.doc.apply_discount_on == "Net Total" or not taxes or total_for_discount_amount==self.doc.net_total) \
and i == len(self.doc.get("items")) - 1:
discount_amount_loss = flt(self.doc.net_total - net_total - self.doc.discount_amount,
self.doc.precision("net_total"))
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index b3c8538..91800cd 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -515,7 +515,7 @@
net_total += item.net_amount;
// discount amount rounding loss adjustment if no taxes
- if ((!(me.frm.doc.taxes || []).length || (me.frm.doc.apply_discount_on == "Net Total"))
+ if ((!(me.frm.doc.taxes || []).length || total_for_discount_amount==me.frm.doc.net_total || (me.frm.doc.apply_discount_on == "Net Total"))
&& i == (me.frm.doc.items || []).length - 1) {
var discount_amount_loss = flt(me.frm.doc.net_total - net_total
- me.frm.doc.discount_amount, precision("net_total"));
diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js
index b22d5ca..a28d42b 100644
--- a/erpnext/public/js/utils/serial_no_batch_selector.js
+++ b/erpnext/public/js/utils/serial_no_batch_selector.js
@@ -373,13 +373,24 @@
get_serial_no_fields: function() {
var me = this;
this.serial_list = [];
+
+ let serial_no_filters = {
+ item_code: me.item_code,
+ delivery_document_no: ""
+ }
+
+ if (me.warehouse_details.name) {
+ serial_no_filters['warehouse'] = me.warehouse_details.name;
+ }
return [
{fieldtype: 'Section Break', label: __('Serial Numbers')},
{
fieldtype: 'Link', fieldname: 'serial_no_select', options: 'Serial No',
label: __('Select to add Serial Number.'),
get_query: function() {
- return { filters: {item_code: me.item_code, warehouse: me.warehouse_details.name}};
+ return {
+ filters: serial_no_filters
+ };
},
onchange: function(e) {
if(this.in_local_change) return;
diff --git a/erpnext/templates/includes/issue_row.html b/erpnext/templates/includes/issue_row.html
index 637fde2..ff868fa 100644
--- a/erpnext/templates/includes/issue_row.html
+++ b/erpnext/templates/includes/issue_row.html
@@ -1,33 +1,30 @@
<div class="web-list-item transaction-list-item">
- <a href="/issues?name={{ doc.name }}">
- <div class="row">
- <div class="col-xs-3">
- <span class="indicator {{ "red" if doc.status=="Open" else "darkgrey" }}">
- {{ doc.name }}</span>
- </div>
- <div class="col-xs-5 items-preview ellipsis ellipsis-width">
- {{ doc.subject }}</div>
- <div class="col-xs-2 text-muted">
- <span class="indicator
- {% if doc.status == "Open" %}
- {% if doc.priority == "Medium" %}
- orange"> Medium
- {% elif doc.priority == "Low" %}
- yellow"> Low
- {% else %}
- red"> High
- {% endif %}
- {% elif doc.status == "Closed" %}
- green"> Closed
- {% else %}
- darkgrey"> {{ doc.status }}
- {% endif %}
- </span>
- </div>
- <div class="col-xs-3 text-right small text-muted">
- {{ frappe.format_date(doc.modified) }}
- </div>
- </div>
- </a>
+ <a href="/issues?name={{ doc.name }}" class="no-underline">
+ <div class="row py-4 border-bottom">
+ <div class="col-3 d-flex align-items-center">
+ {% set indicator = 'red' if doc.status == 'Open' else 'darkgrey' %}
+ {% set indicator = 'green' if doc.status == 'Closed' else indicator %}
+ <span class="d-inline-flex indicator {{ indicator }}"></span>
+ {{ doc.name }}
+ </div>
+ <div class="col-5 text-muted">
+ {{ doc.subject }}</div>
+ <div class="col-2 d-flex align-items-center text-muted">
+ {% set indicator = 'red' if doc.status == 'Open' else 'darkgrey' %}
+ {% set indicator = 'green' if doc.status == 'Closed' else indicator %}
+ {% set indicator = 'orange' if doc.status == 'Open' and doc.priority == 'Medium' else indicator %}
+ {% set indicator = 'yellow' if doc.status == 'Open' and doc.priority == 'Low' else indicator %}
+ <span class="d-inline-flex indicator {{ indicator }}"></span>
+ {% if doc.status == "Open" %}
+ {{ doc.priority }}
+ {% else %}
+ {{ doc.status }}
+ {%- endif -%}
+ </span>
+ </div>
+ <div class="col-2 text-right text-muted">
+ {{ frappe.format_date(doc.modified) }}
+ </div>
+ </div>
+ </a>
</div>
-
\ No newline at end of file
diff --git a/erpnext/templates/includes/macros.html b/erpnext/templates/includes/macros.html
index 2d27915..3c82e90 100644
--- a/erpnext/templates/includes/macros.html
+++ b/erpnext/templates/includes/macros.html
@@ -45,7 +45,7 @@
<div class="card-body">
<h5 class="card-title">{{ card.title }}</h5>
<p class="card-subtitle mb-2 text-muted">{{ card.subtitle or '' }}</p>
- <p class="card-text">{{ card.content | truncate(140, True) }}</p>
+ <p class="card-text">{{ card.content or '' | truncate(140, True) }}</p>
</div>
<div class="card-body flex-grow-0">
<a href="{{ card.route }}" class="card-link">{{ _('More details') }}</a>