Merge branch 'development' into 'devops-staging'

Development

See merge request empatnusabangsa/ppob/ppob-backend!130
This commit is contained in:
ilham dwi pratama 2022-02-05 14:09:46 +00:00
commit 8f4eafe8fe
3 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
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_pin = '04JFGC';
const irs_user = 'D10BD0';

View File

@ -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,20 +572,20 @@ export class TransactionService {
journals: [
{
coa_id: coaInventory.id,
credit: product_price.price,
credit: costInventory,
},
{
coa_id: coaCostOfSales.id,
debit: product_price.price,
debit: costInventory,
},
{
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
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 {
coa_id: coaAccount.id,
credit: (totalPrice * commissionValue.commission) / 100,
credit: Math.floor((totalPrice * commissionValue.commission) / 100),
};
}),
);