Merge branch 'development' into 'devops-staging'
Development See merge request empatnusabangsa/ppob/ppob-backend!130
This commit is contained in:
commit
518f12c62b
|
@ -1,6 +1,6 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const irs_url = 'http://h2h.elangpangarep.com/api/h2h';
|
const irs_url = 'http://h2h.elangpixiu.com/api/h2h';
|
||||||
const irs_id = 'PT0005';
|
const irs_id = 'PT0005';
|
||||||
const irs_pin = '04JFGC';
|
const irs_pin = '04JFGC';
|
||||||
const irs_user = 'D10BD0';
|
const irs_user = 'D10BD0';
|
||||||
|
|
|
@ -505,9 +505,11 @@ export class TransactionService {
|
||||||
responseAPISupplier: hitSupplier,
|
responseAPISupplier: hitSupplier,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let costInventory = product_price.price;
|
||||||
|
|
||||||
if (hitSupplier.harga != product_price.price) {
|
if (hitSupplier.harga != product_price.price) {
|
||||||
product_price.endDate = new Date();
|
product_price.endDate = new Date();
|
||||||
|
costInventory = hitSupplier.harga;
|
||||||
const listActivePrice =
|
const listActivePrice =
|
||||||
await this.productHistoryPriceService.getAllActivePriceByProduct(
|
await this.productHistoryPriceService.getAllActivePriceByProduct(
|
||||||
product.id,
|
product.id,
|
||||||
|
@ -570,20 +572,20 @@ export class TransactionService {
|
||||||
journals: [
|
journals: [
|
||||||
{
|
{
|
||||||
coa_id: coaInventory.id,
|
coa_id: coaInventory.id,
|
||||||
credit: product_price.price,
|
credit: costInventory,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
coa_id: coaCostOfSales.id,
|
coa_id: coaCostOfSales.id,
|
||||||
debit: product_price.price,
|
debit: costInventory,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
coa_id: coaAccount.id,
|
coa_id: coaAccount.id,
|
||||||
debit: product_price.mark_up_price + product_price.price,
|
debit: product_price.mark_up_price + costInventory,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
coa_id: coaSales.id,
|
coa_id: coaSales.id,
|
||||||
credit: product_price.mark_up_price + product_price.price,
|
credit: product_price.mark_up_price + costInventory,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
@ -1325,7 +1327,7 @@ export class TransactionService {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
coa_id: coaAccount.id,
|
coa_id: coaAccount.id,
|
||||||
credit: (totalPrice * commissionValue.commission) / 100,
|
credit: Math.floor((totalPrice * commissionValue.commission) / 100),
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user