mirror of
https://github.com/frappe/books.git
synced 2026-08-24 02:24:17 -05:00
fix: alert "Insufficient Quantity" when creating a shipment without stock
This commit is contained in:
@@ -88,12 +88,10 @@ export abstract class StockTransfer extends Transfer {
|
||||
|
||||
const totalDiscount = this.getTotalDiscount(docData);
|
||||
|
||||
const x = ((docData.taxes ?? []) as Doc[])
|
||||
return ((docData.taxes ?? []) as Doc[])
|
||||
.map((doc) => doc.amount as Money)
|
||||
.reduce((a, b) => a.add(b), this.getNetTotal() as Money)
|
||||
.sub(totalDiscount);
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
getInvoiceDiscountAmount(doc: Doc) {
|
||||
|
||||
@@ -82,9 +82,15 @@ export async function getShipmentCOGSAmountFromSLEs(
|
||||
const i = item.item ?? '-';
|
||||
const l = item.location ?? '-';
|
||||
const b = item.batch ?? '-';
|
||||
const stAmount = item.amount ?? 0;
|
||||
|
||||
if (Object.keys(q).length === 0) {
|
||||
total = total.add(stAmount);
|
||||
continue;
|
||||
}
|
||||
|
||||
const sq = q[i][l][b];
|
||||
const stAmount = item.amount ?? 0;
|
||||
|
||||
if (!sq) {
|
||||
total = total.add(stAmount);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user