fix: deploy
This commit is contained in:
		| @@ -520,18 +520,25 @@ export class TransactionService { | ||||
|     if (hitSupplier.harga > product_price.price) { | ||||
|       product_price.endDate = new Date(); | ||||
|  | ||||
|       let newProductPrice = new ProductHistoryPrice(); | ||||
|  | ||||
|       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; | ||||
|       const listActivePrice = | ||||
|         await this.productHistoryPriceService.getAllActivePriceByProduct( | ||||
|           product.id, | ||||
|         ); | ||||
|  | ||||
|       await this.productHistoryPriceService.updateEndDate(product.id); | ||||
|       await this.productHistoryPriceService.create(newProductPrice); | ||||
|  | ||||
|       listActivePrice.map(async (x) => { | ||||
|         let newProductPrice = new ProductHistoryPrice(); | ||||
|  | ||||
|         newProductPrice.id = uuid.v4(); | ||||
|         newProductPrice.type = x.type; | ||||
|         newProductPrice.price = hitSupplier.harga; | ||||
|         newProductPrice.mark_up_price = x.mark_up_price; | ||||
|         newProductPrice.startDate = new Date(); | ||||
|         newProductPrice.product = product; | ||||
|         newProductPrice.partner = x.partner; | ||||
|         await this.productHistoryPriceService.create(newProductPrice); | ||||
|       }); | ||||
|     } | ||||
|  | ||||
|     return { | ||||
| @@ -1021,9 +1028,6 @@ export class TransactionService { | ||||
|         createdAt: 'DESC', | ||||
|       }, | ||||
|     }); | ||||
|  | ||||
|  | ||||
|  | ||||
|     return baseQuery; | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user