Merge branch 'devops-staging' of https://gitlab.com/empatnusabangsa/ppob/ppob-backend
This commit is contained in:
commit
03d843281c
|
@ -13,11 +13,7 @@ export class COA extends BaseModel {
|
||||||
@Column('text')
|
@Column('text')
|
||||||
balanceType: balanceType;
|
balanceType: balanceType;
|
||||||
|
|
||||||
@Column({
|
@Column()
|
||||||
type: 'numeric',
|
|
||||||
precision: 20,
|
|
||||||
scale: 2,
|
|
||||||
})
|
|
||||||
amount: number;
|
amount: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
|
|
|
@ -10,11 +10,7 @@ export class Transactions extends BaseModel {
|
||||||
@Column()
|
@Column()
|
||||||
amount: number;
|
amount: number;
|
||||||
|
|
||||||
@Column({
|
@Column()
|
||||||
type: 'numeric',
|
|
||||||
precision: 20,
|
|
||||||
scale: 2,
|
|
||||||
})
|
|
||||||
balance_remaining: number;
|
balance_remaining: number;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
|
|
|
@ -163,12 +163,13 @@ export class TransactionService {
|
||||||
HttpStatus.NOT_ACCEPTABLE,
|
HttpStatus.NOT_ACCEPTABLE,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
console.log('suppliercodedist', supplier.code);
|
||||||
// GET COA
|
// GET COA
|
||||||
const coaBudget = await this.coaService.findByName(
|
const coaBudget = await this.coaService.findByName(
|
||||||
`${coaType[coaType.BUDGET]}-${supplier.code}`,
|
`${coaType[coaType.BUDGET]}-${supplier.code}`,
|
||||||
);
|
);
|
||||||
|
console.log('coabudgetdist', coaBudget.amount);
|
||||||
|
console.log('amounttotaldist', distributeTransactionDto.amount);
|
||||||
if (coaBudget.amount < distributeTransactionDto.amount) {
|
if (coaBudget.amount < distributeTransactionDto.amount) {
|
||||||
throw new HttpException(
|
throw new HttpException(
|
||||||
{
|
{
|
||||||
|
@ -1395,7 +1396,7 @@ export class TransactionService {
|
||||||
dataTransaction.callback_json = callback;
|
dataTransaction.callback_json = callback;
|
||||||
dataTransaction.failed_reason = `Trx ${product.code} ke ${dataTransaction.destination} gagal`;
|
dataTransaction.failed_reason = `Trx ${product.code} ke ${dataTransaction.destination} gagal`;
|
||||||
dataTransaction.balance_remaining =
|
dataTransaction.balance_remaining =
|
||||||
Math.floor(coaAccount.amount) + dataTransaction.amount;
|
coaAccount.amount + dataTransaction.amount;
|
||||||
|
|
||||||
const coaInventory = await this.coaService.findByName(
|
const coaInventory = await this.coaService.findByName(
|
||||||
`${coaType[coaType.INVENTORY]}-${product.supplier.code}`,
|
`${coaType[coaType.INVENTORY]}-${product.supplier.code}`,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user