mirror of
https://github.com/frappe/books.git
synced 2026-08-24 02:24:17 -05:00
fix: added uom in print
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user