fix: update price

This commit is contained in:
ilham
2022-01-03 19:56:04 +07:00
parent 128e915eb2
commit cfca06ecc5
2 changed files with 41 additions and 7 deletions

View File

@@ -522,11 +522,15 @@ export class TransactionService {
let newProductPrice = new ProductHistoryPrice();
newProductPrice = product_price;
newProductPrice.id = uuid.v4();
newProductPrice.type = product_price.type;
newProductPrice.price = hitSupplier.harga;
newProductPrice.mark_up_price = product_price.mark_up_price;
newProductPrice.startDate = new Date();
newProductPrice.product = product;
newProductPrice.partner = product_price.partner;
await this.productHistoryPriceService.create(product_price);
await this.productHistoryPriceService.updateEndDate(product.id);
await this.productHistoryPriceService.create(newProductPrice);
}