Merge pull request 'feat/adjustment-report' (#87) from feat/adjustment-report into development
Reviewed-on: #87fix/report 20.1.62-alpha.1
commit
a2be2bb331
|
@ -0,0 +1,21 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class AddPosNameColumn1726033041774 implements MigrationInterface {
|
||||||
|
name = 'AddPosNameColumn1726033041774';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "transactions" ADD "creator_counter_name" character varying`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "logs_pos" ADD "pos_name" character varying`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE "logs_pos" DROP COLUMN "pos_name"`);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "transactions" DROP COLUMN "creator_counter_name"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,6 +14,9 @@ export class PosLogModel
|
||||||
@Column('bigint', { name: 'pos_number', nullable: true })
|
@Column('bigint', { name: 'pos_number', nullable: true })
|
||||||
pos_number: number;
|
pos_number: number;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'pos_name', nullable: true })
|
||||||
|
pos_name: string;
|
||||||
|
|
||||||
@Column('decimal', { name: 'total_balance', nullable: true })
|
@Column('decimal', { name: 'total_balance', nullable: true })
|
||||||
total_balance: number;
|
total_balance: number;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { BaseCoreEntity } from 'src/core/modules/domain/entities/base-core.entit
|
||||||
export interface PosLogEntity extends BaseCoreEntity {
|
export interface PosLogEntity extends BaseCoreEntity {
|
||||||
type: PosLogType;
|
type: PosLogType;
|
||||||
pos_number: number;
|
pos_number: number;
|
||||||
|
pos_name: string;
|
||||||
total_balance: number;
|
total_balance: number;
|
||||||
created_at: number;
|
created_at: number;
|
||||||
creator_name: string;
|
creator_name: string;
|
||||||
|
|
|
@ -26,6 +26,7 @@ export class RecordPosLogHandler implements IEventHandler<ChangeDocEvent> {
|
||||||
type: PosLogType[data.type],
|
type: PosLogType[data.type],
|
||||||
total_balance: data.withdrawal_cash ?? data.opening_cash_balance,
|
total_balance: data.withdrawal_cash ?? data.opening_cash_balance,
|
||||||
pos_number: data.pos_number,
|
pos_number: data.pos_number,
|
||||||
|
pos_name: data.pos_name,
|
||||||
creator_id: data.pos_admin?.id,
|
creator_id: data.pos_admin?.id,
|
||||||
creator_name: data.pos_admin?.name ?? data.pos_admin?.username,
|
creator_name: data.pos_admin?.name ?? data.pos_admin?.username,
|
||||||
drawn_by_id: data.withdraw_user?.id,
|
drawn_by_id: data.withdraw_user?.id,
|
||||||
|
|
|
@ -47,6 +47,7 @@ export class IndexReconciliationManager extends BaseIndexManager<TransactionEnti
|
||||||
|
|
||||||
`${this.tableName}.customer_name`,
|
`${this.tableName}.customer_name`,
|
||||||
`${this.tableName}.creator_counter_no`,
|
`${this.tableName}.creator_counter_no`,
|
||||||
|
`${this.tableName}.creator_counter_name`,
|
||||||
|
|
||||||
`${this.tableName}.invoice_code`,
|
`${this.tableName}.invoice_code`,
|
||||||
`${this.tableName}.booking_date`,
|
`${this.tableName}.booking_date`,
|
||||||
|
@ -111,11 +112,20 @@ export class IndexReconciliationManager extends BaseIndexManager<TransactionEnti
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.filterParam.couner_no) {
|
if (this.filterParam.counter_no) {
|
||||||
queryBuilder.andWhere(
|
queryBuilder.andWhere(
|
||||||
`${this.tableName}.creator_counter_no In (:...counters)`,
|
`${this.tableName}.creator_counter_no In (:...counters)`,
|
||||||
{
|
{
|
||||||
counters: [this.filterParam.couner_no],
|
counters: [this.filterParam.counter_no],
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.filterParam.counter_name) {
|
||||||
|
queryBuilder.andWhere(
|
||||||
|
`${this.tableName}.creator_counter_name In (:...counterNames)`,
|
||||||
|
{
|
||||||
|
counterNames: [this.filterParam.counter_name],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,7 @@ export class RecapReconciliationManager extends BaseCustomManager<TransactionEnt
|
||||||
booking_date: payment_date,
|
booking_date: payment_date,
|
||||||
payment_date: payment_date,
|
payment_date: payment_date,
|
||||||
creator_counter_no: first_transaction.creator_counter_no,
|
creator_counter_no: first_transaction.creator_counter_no,
|
||||||
|
creator_counter_name: first_transaction.creator_counter_name,
|
||||||
payment_type: first_transaction.payment_type_counter,
|
payment_type: first_transaction.payment_type_counter,
|
||||||
payment_type_counter: first_transaction.payment_type_counter,
|
payment_type_counter: first_transaction.payment_type_counter,
|
||||||
payment_type_method_id: first_transaction.payment_type_method_id,
|
payment_type_method_id: first_transaction.payment_type_method_id,
|
||||||
|
|
|
@ -36,6 +36,9 @@ export class TransactionModel
|
||||||
@Column('int', { name: 'creator_counter_no', nullable: true })
|
@Column('int', { name: 'creator_counter_no', nullable: true })
|
||||||
creator_counter_no: number;
|
creator_counter_no: number;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'creator_counter_name', nullable: true })
|
||||||
|
creator_counter_name: string;
|
||||||
|
|
||||||
// season data
|
// season data
|
||||||
@Column('varchar', { name: 'season_period_id', nullable: true })
|
@Column('varchar', { name: 'season_period_id', nullable: true })
|
||||||
season_period_id: string;
|
season_period_id: string;
|
||||||
|
|
|
@ -13,6 +13,7 @@ export interface TransactionEntity extends BaseStatusEntity {
|
||||||
type: TransactionType;
|
type: TransactionType;
|
||||||
invoice_code: string;
|
invoice_code: string;
|
||||||
creator_counter_no: number; // nomor pos transaksi dibuat
|
creator_counter_no: number; // nomor pos transaksi dibuat
|
||||||
|
creator_counter_name: string; // name pos transaksi dibuat
|
||||||
|
|
||||||
// season data
|
// season data
|
||||||
season_period_id: string;
|
season_period_id: string;
|
||||||
|
|
|
@ -42,6 +42,7 @@ export class DetailTransactionManager extends BaseDetailManager<TransactionEntit
|
||||||
return [
|
return [
|
||||||
`${this.tableName}.id`,
|
`${this.tableName}.id`,
|
||||||
`${this.tableName}.creator_counter_no`,
|
`${this.tableName}.creator_counter_no`,
|
||||||
|
`${this.tableName}.creator_counter_name`,
|
||||||
`${this.tableName}.creator_name`,
|
`${this.tableName}.creator_name`,
|
||||||
`${this.tableName}.created_at`,
|
`${this.tableName}.created_at`,
|
||||||
`${this.tableName}.updated_at`,
|
`${this.tableName}.updated_at`,
|
||||||
|
|
|
@ -118,6 +118,7 @@ export function mappingRevertTransaction(data, type) {
|
||||||
Object.assign(data, {
|
Object.assign(data, {
|
||||||
id: data.booking_id ?? data._id,
|
id: data.booking_id ?? data._id,
|
||||||
creator_counter_no: Number(data.pos_number),
|
creator_counter_no: Number(data.pos_number),
|
||||||
|
creator_counter_name: data.pos_name,
|
||||||
settlement_date: new Date(data.created_at),
|
settlement_date: new Date(data.created_at),
|
||||||
payment_date: isCancel ? null : new Date(data.created_at),
|
payment_date: isCancel ? null : new Date(data.created_at),
|
||||||
invoice_date: new Date(data.created_at),
|
invoice_date: new Date(data.created_at),
|
||||||
|
|
|
@ -55,6 +55,7 @@ export class IndexTransactionManager extends BaseIndexManager<TransactionEntity>
|
||||||
`${this.tableName}.status`,
|
`${this.tableName}.status`,
|
||||||
`${this.tableName}.invoice_code`,
|
`${this.tableName}.invoice_code`,
|
||||||
`${this.tableName}.creator_counter_no`,
|
`${this.tableName}.creator_counter_no`,
|
||||||
|
`${this.tableName}.creator_counter_name`,
|
||||||
`${this.tableName}.booking_date`,
|
`${this.tableName}.booking_date`,
|
||||||
`${this.tableName}.no_of_group`,
|
`${this.tableName}.no_of_group`,
|
||||||
`${this.tableName}.type`,
|
`${this.tableName}.type`,
|
||||||
|
|
Loading…
Reference in New Issue