diff --git a/src/transaction/transaction.service.ts b/src/transaction/transaction.service.ts index 7adaa89..1b65d06 100644 --- a/src/transaction/transaction.service.ts +++ b/src/transaction/transaction.service.ts @@ -505,9 +505,11 @@ export class TransactionService { responseAPISupplier: hitSupplier, }); + let costInventory = product_price.price; + if (hitSupplier.harga != product_price.price) { product_price.endDate = new Date(); - + costInventory = hitSupplier.harga; const listActivePrice = await this.productHistoryPriceService.getAllActivePriceByProduct( product.id, @@ -570,7 +572,7 @@ export class TransactionService { journals: [ { coa_id: coaInventory.id, - credit: product_price.price, + credit: costInventory, }, { coa_id: coaCostOfSales.id,