fix: added uom in print

This commit is contained in:
Gadha2311
2026-01-12 10:41:00 +05:30
parent f7887d1401
commit f01330aaa9
5 changed files with 13 additions and 19 deletions
+8 -8
View File
@@ -36,7 +36,7 @@ export abstract class InvoiceItem extends Doc {
transferUnit?: string;
quantity?: number;
transferQuantity?: number;
quantities?: number;
qty?: number;
unitConversionFactor?: number;
batch?: string;
@@ -232,8 +232,8 @@ export abstract class InvoiceItem extends Doc {
},
transferQuantity: {
formula: (fieldname) => {
if (fieldname === 'quantities') {
return this.quantities
if (fieldname === 'qty') {
return this.qty;
}
if (fieldname === 'quantity' || this.unit === this.transferUnit) {
return this.quantity;
@@ -241,14 +241,14 @@ export abstract class InvoiceItem extends Doc {
return this.transferQuantity;
},
dependsOn: ['item', 'quantity', 'quantities'],
dependsOn: ['item', 'quantity', 'qty'],
},
quantities: {
qty: {
formula: (fieldname) => {
if (fieldname === 'transferQuantity') {
return this.transferQuantity
return this.transferQuantity;
}
if (fieldname === 'quantity' || this.unit === this.transferUnit) {
if (fieldname === 'quantity' || this.unit === this.transferUnit) {
return this.quantity;
}
return this.transferQuantity;
@@ -266,7 +266,7 @@ export abstract class InvoiceItem extends Doc {
this.item
);
const unitDoc = itemDoc.getLink('uom');
let quantity: number = this.quantity ?? 1;
if (this.isReturn && quantity > 0) {
+2 -2
View File
@@ -45,7 +45,7 @@
"required": true
},
{
"fieldname": "quantities",
"fieldname": "qty",
"label": "Qty",
"fieldtype": "Float",
"default": 1,
@@ -147,7 +147,7 @@
"readOnly": true
}
],
"tableFields": ["item", "tax", "quantities", "rate", "amount"],
"tableFields": ["item", "tax", "qty", "rate", "amount"],
"keywordFields": ["item", "tax"],
"quickEditFields": [
"item",
+1 -3
View File
@@ -88,9 +88,7 @@
<div v-if="row.transferUnit">
({{ row.quantity}} of {{ row.transferUnit }})
</div>
<div v-else-if="row.unit">
({{ row.quantity }} of {{ row.unit }})
</div>
<div v-else-if="row.unit">({{ row.quantity }} of {{ row.unit }})</div>
</div>
<div class="w-3/12 text-right py-4">{{ row.rate }}</div>
<div class="w-3/12 text-right py-4">{{ row.amount }}</div>
+1 -3
View File
@@ -82,9 +82,7 @@
<div v-if="row.transferUnit">
({{ row.quantity }} of {{ row.transferUnit }})
</div>
<div v-else-if="row.unit">
({{ row.quantity }} of {{ row.unit }})
</div>
<div v-else-if="row.unit">({{ row.quantity }} of {{ row.unit }})</div>
</div>
<div class="w-3/12 text-right">{{ row.rate }}</div>
<div class="w-3/12 text-right">{{ row.amount }}</div>
+1 -3
View File
@@ -120,9 +120,7 @@
<div v-if="row.transferUnit">
({{ row.quantity }} of {{ row.transferUnit }})
</div>
<div v-else-if="row.unit">
({{ row.quantity }} of {{ row.unit }})
</div>
<div v-else-if="row.unit">({{ row.quantity }} of {{ row.unit }})</div>
</div>
<div class="w-3/12 text-right">{{ row.rate }}</div>
<div class="w-3/12 text-right">{{ row.amount }}</div>