Merge branch 'development' of ssh://git.eigen.co.id:2222/eigen/pos-be into development
commit
19494b3328
|
@ -1602,7 +1602,7 @@
|
||||||
mso-line-height-rule: exactly;
|
mso-line-height-rule: exactly;
|
||||||
mso-text-raise: 2px;
|
mso-text-raise: 2px;
|
||||||
"
|
"
|
||||||
>Pay Here</a
|
>Click Here to Pay</a
|
||||||
>
|
>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class AddPaymentDateBankColumnAtTransaction1725962197762
|
||||||
|
implements MigrationInterface
|
||||||
|
{
|
||||||
|
name = 'AddPaymentDateBankColumnAtTransaction1725962197762';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "transactions" ADD "payment_date_bank" date`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "transactions" DROP COLUMN "payment_date_bank"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class AddFlagRoleQueue1726041175749 implements MigrationInterface {
|
||||||
|
name = 'AddFlagRoleQueue1726041175749';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TYPE "public"."users_role_enum" RENAME TO "users_role_enum_old"`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`CREATE TYPE "public"."users_role_enum" AS ENUM('superadmin', 'staff', 'tenant', 'queue_admin')`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "users" ALTER COLUMN "role" DROP DEFAULT`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "users" ALTER COLUMN "role" TYPE "public"."users_role_enum" USING "role"::"text"::"public"."users_role_enum"`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "users" ALTER COLUMN "role" SET DEFAULT 'staff'`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(`DROP TYPE "public"."users_role_enum_old"`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`CREATE TYPE "public"."users_role_enum_old" AS ENUM('superadmin', 'staff', 'tenant')`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "users" ALTER COLUMN "role" DROP DEFAULT`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "users" ALTER COLUMN "role" TYPE "public"."users_role_enum_old" USING "role"::"text"::"public"."users_role_enum_old"`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "users" ALTER COLUMN "role" SET DEFAULT 'staff'`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(`DROP TYPE "public"."users_role_enum"`);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TYPE "public"."users_role_enum_old" RENAME TO "users_role_enum"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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,
|
||||||
|
|
|
@ -134,7 +134,15 @@ export class ItemDto extends BaseStatusDto implements ItemEntity {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@IsArray()
|
@IsArray({
|
||||||
|
message: (body) => {
|
||||||
|
const value = body.value;
|
||||||
|
if (!value || value?.length === 0) {
|
||||||
|
return 'Product bundling tidak boleh kosong.';
|
||||||
|
}
|
||||||
|
return 'Product bundling tidak sesuai.';
|
||||||
|
},
|
||||||
|
})
|
||||||
@ValidateIf((body) => body.item_type.toLowerCase() == ItemType.BUNDLING)
|
@ValidateIf((body) => body.item_type.toLowerCase() == ItemType.BUNDLING)
|
||||||
bundling_items: ItemEntity[];
|
bundling_items: ItemEntity[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { REPORT_GROUP } from '../../../constant';
|
||||||
|
import { ReportConfigEntity } from '../../../entities/report-config.entity';
|
||||||
|
import IncomeReportPerItemMaster from '../../transaction-report/configs/income-per-item-master';
|
||||||
|
|
||||||
|
export default <ReportConfigEntity>{
|
||||||
|
...IncomeReportPerItemMaster,
|
||||||
|
group_name: REPORT_GROUP.tenant_report,
|
||||||
|
unique_name: `${REPORT_GROUP.tenant_report}__income_per_item_master`,
|
||||||
|
label: 'Pendapatan',
|
||||||
|
whereCondition(filterModel) {
|
||||||
|
const queryFilter = [];
|
||||||
|
const breakdown = filterModel.tr_item__breakdown_bundling;
|
||||||
|
if (breakdown) {
|
||||||
|
console.log({ breakdown });
|
||||||
|
const value = breakdown.filter.map((item) => {
|
||||||
|
return item === 'Yes' ? true : false;
|
||||||
|
});
|
||||||
|
|
||||||
|
queryFilter.push(`tr_item.breakdown_bundling in (${value.join()})`);
|
||||||
|
}
|
||||||
|
return queryFilter;
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,39 +0,0 @@
|
||||||
import { DATA_FORMAT, DATA_TYPE, REPORT_GROUP } from '../../../constant';
|
|
||||||
import { ReportConfigEntity } from '../../../entities/report-config.entity';
|
|
||||||
|
|
||||||
export default <ReportConfigEntity>{
|
|
||||||
group_name: REPORT_GROUP.tenant_report,
|
|
||||||
unique_name: `${REPORT_GROUP.tenant_report}__sample`,
|
|
||||||
label: 'Sample Tenant Report',
|
|
||||||
table_schema: 'season_types main',
|
|
||||||
main_table_alias: 'main',
|
|
||||||
defaultOrderBy: [],
|
|
||||||
lowLevelOrderBy: [],
|
|
||||||
filter_period_config: {
|
|
||||||
hidden: true,
|
|
||||||
},
|
|
||||||
column_configs: [
|
|
||||||
{
|
|
||||||
column: 'main__created_at',
|
|
||||||
query: 'main.created_at',
|
|
||||||
label: 'Created Date',
|
|
||||||
type: DATA_TYPE.DIMENSION,
|
|
||||||
format: DATA_FORMAT.DATE_EPOCH,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
column: 'main__updated_at',
|
|
||||||
query: 'main.updated_at',
|
|
||||||
label: 'Updated Date',
|
|
||||||
type: DATA_TYPE.DIMENSION,
|
|
||||||
format: DATA_FORMAT.DATE_EPOCH,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
column: 'main__name',
|
|
||||||
query: 'main.name',
|
|
||||||
label: 'Name',
|
|
||||||
type: DATA_TYPE.DIMENSION,
|
|
||||||
format: DATA_FORMAT.TEXT,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
filter_configs: [],
|
|
||||||
};
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ReportConfigEntity } from '../../entities/report-config.entity';
|
import { ReportConfigEntity } from '../../entities/report-config.entity';
|
||||||
import SampleReport from './configs/sample.report';
|
import IncomeReportPerItemMaster from './configs/income-per-item-master';
|
||||||
|
|
||||||
export const TenantReportConfig: ReportConfigEntity[] = [
|
export const TenantReportConfig: ReportConfigEntity[] = [
|
||||||
// SampleReport
|
IncomeReportPerItemMaster,
|
||||||
];
|
];
|
||||||
|
|
|
@ -94,8 +94,8 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
filed_label: 'No. PoS',
|
filed_label: 'No. PoS',
|
||||||
filter_column: 'main__pos_number',
|
filter_column: 'main__pos_number',
|
||||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
field_type: FILTER_FIELD_TYPE.input_number,
|
||||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -85,5 +85,11 @@ export default <ReportConfigEntity>{
|
||||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
field_type: FILTER_FIELD_TYPE.input_tag,
|
||||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
filed_label: 'No. PoS',
|
||||||
|
filter_column: 'main__pos_number',
|
||||||
|
field_type: FILTER_FIELD_TYPE.input_number,
|
||||||
|
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,10 +54,24 @@ export default <ReportConfigEntity>{
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// column: 'main__invoice_code',
|
||||||
|
// query: 'main.invoice_code',
|
||||||
|
// label: 'Kode Transaksi',
|
||||||
|
// type: DATA_TYPE.DIMENSION,
|
||||||
|
// format: DATA_FORMAT.TEXT,
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
column: 'main__invoice_code',
|
column: 'main__invoice_code',
|
||||||
query: 'main.invoice_code',
|
query: `CASE WHEN main.type != 'counter' THEN main.invoice_code ELSE null END`,
|
||||||
label: 'Kode Transaksi',
|
label: 'Kode Booking',
|
||||||
|
type: DATA_TYPE.DIMENSION,
|
||||||
|
format: DATA_FORMAT.TEXT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
column: 'main__payment_code',
|
||||||
|
query: `CASE WHEN main.type = 'counter' THEN main.invoice_code ELSE main.payment_code END`,
|
||||||
|
label: 'Kode Pembayaran',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
},
|
},
|
||||||
|
@ -173,8 +187,8 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
filed_label: 'No. Pos',
|
filed_label: 'No. Pos',
|
||||||
filter_column: 'main__creator_counter_no',
|
filter_column: 'main__creator_counter_no',
|
||||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
field_type: FILTER_FIELD_TYPE.input_number,
|
||||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filed_label: 'Nama Pelanggan',
|
filed_label: 'Nama Pelanggan',
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
column: 'main__settlement_date',
|
column: 'main__settlement_date',
|
||||||
query: 'main.settlement_date',
|
query: 'main.settlement_date',
|
||||||
label: 'Tanggal Pendapatan',
|
label: 'Tgl. Pendapatan',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||||
date_format: 'DD/MM/YYYY',
|
date_format: 'DD/MM/YYYY',
|
||||||
|
@ -59,14 +59,14 @@ export default <ReportConfigEntity>{
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'main__invoice_code',
|
column: 'main__invoice_code',
|
||||||
query: 'main.invoice_code',
|
query: `CASE WHEN main.type != 'counter' THEN main.invoice_code ELSE null END`,
|
||||||
label: 'Kode Booking',
|
label: 'Kode Booking',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'main__payment_code',
|
column: 'main__payment_code',
|
||||||
query: 'main.payment_code',
|
query: `CASE WHEN main.type = 'counter' THEN main.invoice_code ELSE main.payment_code END`,
|
||||||
label: 'Kode Pembayaran',
|
label: 'Kode Pembayaran',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
|
@ -117,7 +117,7 @@ export default <ReportConfigEntity>{
|
||||||
column: 'tr_item__qty',
|
column: 'tr_item__qty',
|
||||||
query: 'tr_item.qty',
|
query: 'tr_item.qty',
|
||||||
label: 'Qty',
|
label: 'Qty',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.NUMBER,
|
format: DATA_FORMAT.NUMBER,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -127,8 +127,20 @@ export default <ReportConfigEntity>{
|
||||||
type: DATA_TYPE.MEASURE,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
// TODO => tambahkan total dpp per item
|
{
|
||||||
// TODO => tambahkan total tax
|
column: 'tr_item__payment_total_dpp',
|
||||||
|
query: 'tr_item.payment_total_dpp',
|
||||||
|
label: 'DPP',
|
||||||
|
type: DATA_TYPE.MEASURE,
|
||||||
|
format: DATA_FORMAT.CURRENCY,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
column: 'tr_item__payment_total_tax',
|
||||||
|
query: 'tr_item.payment_total_tax',
|
||||||
|
label: 'Total Pajak',
|
||||||
|
type: DATA_TYPE.MEASURE,
|
||||||
|
format: DATA_FORMAT.CURRENCY,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
column: 'tr_item__total_price',
|
column: 'tr_item__total_price',
|
||||||
query: 'tr_item.total_price',
|
query: 'tr_item.total_price',
|
||||||
|
@ -139,7 +151,7 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
column: 'refund__refund_date',
|
column: 'refund__refund_date',
|
||||||
query: 'refund.refund_date',
|
query: 'refund.refund_date',
|
||||||
label: 'Tanggal Pengembalian',
|
label: 'Tgl. Pengembalian',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||||
date_format: 'DD/MM/YYYY',
|
date_format: 'DD/MM/YYYY',
|
||||||
|
@ -162,7 +174,7 @@ export default <ReportConfigEntity>{
|
||||||
column: 'refund_item__qty_refund',
|
column: 'refund_item__qty_refund',
|
||||||
query: 'refund_item.qty_refund',
|
query: 'refund_item.qty_refund',
|
||||||
label: 'Qty Pengembalian',
|
label: 'Qty Pengembalian',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.NUMBER,
|
format: DATA_FORMAT.NUMBER,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -191,7 +203,7 @@ export default <ReportConfigEntity>{
|
||||||
column: 'tenant_income',
|
column: 'tenant_income',
|
||||||
query: 'tr_item.total_price - tr_item.item_tenant_share_margin',
|
query: 'tr_item.total_price - tr_item.item_tenant_share_margin',
|
||||||
label: 'Pendapatan Tenant',
|
label: 'Pendapatan Tenant',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -239,7 +251,7 @@ export default <ReportConfigEntity>{
|
||||||
ignore_filter_keys: ['tr_item__breakdown_bundling'],
|
ignore_filter_keys: ['tr_item__breakdown_bundling'],
|
||||||
filter_configs: [
|
filter_configs: [
|
||||||
{
|
{
|
||||||
filed_label: 'Tanggal Pendapatan',
|
filed_label: 'Tgl. Pendapatan',
|
||||||
filter_column: 'main__settlement_date',
|
filter_column: 'main__settlement_date',
|
||||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||||
|
@ -303,11 +315,11 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
filed_label: 'No. PoS',
|
filed_label: 'No. PoS',
|
||||||
filter_column: 'main__creator_counter_no',
|
filter_column: 'main__creator_counter_no',
|
||||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
field_type: FILTER_FIELD_TYPE.input_number,
|
||||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filed_label: 'Tanggal Pengembalian',
|
filed_label: 'Tgl. Pengembalian',
|
||||||
filter_column: 'refund__refund_date',
|
filter_column: 'refund__refund_date',
|
||||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||||
|
|
|
@ -37,7 +37,7 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
column: 'main__settlement_date',
|
column: 'main__settlement_date',
|
||||||
query: 'main.settlement_date',
|
query: 'main.settlement_date',
|
||||||
label: 'Tanggal Pendapatan',
|
label: 'Tgl. Pendapatan',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||||
date_format: 'DD/MM/YYYY',
|
date_format: 'DD/MM/YYYY',
|
||||||
|
@ -58,14 +58,14 @@ export default <ReportConfigEntity>{
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'main__invoice_code',
|
column: 'main__invoice_code',
|
||||||
query: 'main.invoice_code',
|
query: `CASE WHEN main.type != 'counter' THEN main.invoice_code ELSE null END`,
|
||||||
label: 'Kode Booking',
|
label: 'Kode Booking',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'main__payment_code',
|
column: 'main__payment_code',
|
||||||
query: 'main.payment_code',
|
query: `CASE WHEN main.type = 'counter' THEN main.invoice_code ELSE main.payment_code END`,
|
||||||
label: 'Kode Pembayaran',
|
label: 'Kode Pembayaran',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
|
@ -102,7 +102,7 @@ export default <ReportConfigEntity>{
|
||||||
column: 'tr_item__qty',
|
column: 'tr_item__qty',
|
||||||
query: 'tr_item.qty',
|
query: 'tr_item.qty',
|
||||||
label: 'Qty',
|
label: 'Qty',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.NUMBER,
|
format: DATA_FORMAT.NUMBER,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -112,8 +112,20 @@ export default <ReportConfigEntity>{
|
||||||
type: DATA_TYPE.MEASURE,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
// TODO => tambahkan total dpp per item
|
{
|
||||||
// TODO => tambahkan total tax
|
column: 'tr_item__payment_total_dpp',
|
||||||
|
query: 'tr_item.payment_total_dpp',
|
||||||
|
label: 'DPP',
|
||||||
|
type: DATA_TYPE.MEASURE,
|
||||||
|
format: DATA_FORMAT.CURRENCY,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
column: 'tr_item__payment_total_tax',
|
||||||
|
query: 'tr_item.payment_total_tax',
|
||||||
|
label: 'Total Pajak',
|
||||||
|
type: DATA_TYPE.MEASURE,
|
||||||
|
format: DATA_FORMAT.CURRENCY,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
column: 'tr_item__total_price',
|
column: 'tr_item__total_price',
|
||||||
query: 'tr_item.total_price',
|
query: 'tr_item.total_price',
|
||||||
|
@ -124,7 +136,7 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
column: 'refund__refund_date',
|
column: 'refund__refund_date',
|
||||||
query: 'refund.refund_date',
|
query: 'refund.refund_date',
|
||||||
label: 'Tanggal Pengembalian',
|
label: 'Tgl. Pengembalian',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||||
date_format: 'DD/MM/YYYY',
|
date_format: 'DD/MM/YYYY',
|
||||||
|
@ -147,7 +159,7 @@ export default <ReportConfigEntity>{
|
||||||
column: 'refund_item__qty_refund',
|
column: 'refund_item__qty_refund',
|
||||||
query: 'refund_item.qty_refund',
|
query: 'refund_item.qty_refund',
|
||||||
label: 'Qty Pengembalian',
|
label: 'Qty Pengembalian',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.NUMBER,
|
format: DATA_FORMAT.NUMBER,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -176,7 +188,7 @@ export default <ReportConfigEntity>{
|
||||||
column: 'tenant_income',
|
column: 'tenant_income',
|
||||||
query: 'tr_item.total_price - tr_item.item_tenant_share_margin',
|
query: 'tr_item.total_price - tr_item.item_tenant_share_margin',
|
||||||
label: 'Pendapatan Tenant',
|
label: 'Pendapatan Tenant',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -211,7 +223,7 @@ export default <ReportConfigEntity>{
|
||||||
],
|
],
|
||||||
filter_configs: [
|
filter_configs: [
|
||||||
{
|
{
|
||||||
filed_label: 'Tanggal Pendapatan',
|
filed_label: 'Tgl. Pendapatan',
|
||||||
filter_column: 'main__settlement_date',
|
filter_column: 'main__settlement_date',
|
||||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||||
|
@ -262,11 +274,11 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
filed_label: 'No. PoS',
|
filed_label: 'No. PoS',
|
||||||
filter_column: 'main__creator_counter_no',
|
filter_column: 'main__creator_counter_no',
|
||||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
field_type: FILTER_FIELD_TYPE.input_number,
|
||||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filed_label: 'Tanggal Pengembalian',
|
filed_label: 'Tgl. Pengembalian',
|
||||||
filter_column: 'refund__refund_date',
|
filter_column: 'refund__refund_date',
|
||||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
column: 'main__settlement_date',
|
column: 'main__settlement_date',
|
||||||
query: 'main.settlement_date',
|
query: 'main.settlement_date',
|
||||||
label: 'Tanggal Pendapatan',
|
label: 'Tgl. Pendapatan',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||||
date_format: 'DD/MM/YYYY',
|
date_format: 'DD/MM/YYYY',
|
||||||
|
@ -61,14 +61,14 @@ export default <ReportConfigEntity>{
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'main__invoice_code',
|
column: 'main__invoice_code',
|
||||||
query: 'main.invoice_code',
|
query: `CASE WHEN main.type != 'counter' THEN main.invoice_code ELSE null END`,
|
||||||
label: 'Kode Booking',
|
label: 'Kode Booking',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'main__payment_code',
|
column: 'main__payment_code',
|
||||||
query: 'main.payment_code',
|
query: `CASE WHEN main.type = 'counter' THEN main.invoice_code ELSE main.payment_code END`,
|
||||||
label: 'Kode Pembayaran',
|
label: 'Kode Pembayaran',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
|
@ -101,13 +101,6 @@ export default <ReportConfigEntity>{
|
||||||
type: DATA_TYPE.MEASURE,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
column: 'main__reconciliation_mdr',
|
|
||||||
query: 'main.reconciliation_mdr',
|
|
||||||
label: 'MDR',
|
|
||||||
type: DATA_TYPE.MEASURE,
|
|
||||||
format: DATA_FORMAT.CURRENCY,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
column: 'main__payment_total_dpp',
|
column: 'main__payment_total_dpp',
|
||||||
query: 'main.payment_total_dpp',
|
query: 'main.payment_total_dpp',
|
||||||
|
@ -133,21 +126,21 @@ export default <ReportConfigEntity>{
|
||||||
column: 'main__discount_value',
|
column: 'main__discount_value',
|
||||||
query: 'main.discount_value',
|
query: 'main.discount_value',
|
||||||
label: 'Diskon (IDR)',
|
label: 'Diskon (IDR)',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'main__payment_total',
|
column: 'main__payment_total',
|
||||||
query: 'main.payment_total',
|
query: 'main.payment_total',
|
||||||
label: 'Total Penjualan',
|
label: 'Total Penjualan',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'refund__refund_date',
|
column: 'refund__refund_date',
|
||||||
query: 'refund.refund_date',
|
query: 'refund.refund_date',
|
||||||
label: 'Tanggal Pengembalian',
|
label: 'Tgl. Pengembalian',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||||
date_format: 'DD/MM/YYYY',
|
date_format: 'DD/MM/YYYY',
|
||||||
},
|
},
|
||||||
|
@ -169,14 +162,14 @@ export default <ReportConfigEntity>{
|
||||||
column: 'refund__refund_total',
|
column: 'refund__refund_total',
|
||||||
query: '(refund.refund_total * -1)',
|
query: '(refund.refund_total * -1)',
|
||||||
label: 'Total Pengembalian',
|
label: 'Total Pengembalian',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'transaction_balance',
|
column: 'transaction_balance',
|
||||||
query: `CASE WHEN refund.id is null THEN main.payment_total ELSE main.payment_total - refund.refund_total END`,
|
query: `CASE WHEN refund.id is null THEN main.payment_total ELSE main.payment_total - refund.refund_total END`,
|
||||||
label: 'Balance',
|
label: 'Balance',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -252,7 +245,7 @@ export default <ReportConfigEntity>{
|
||||||
],
|
],
|
||||||
filter_configs: [
|
filter_configs: [
|
||||||
{
|
{
|
||||||
filed_label: 'Tanggal Pendapatan',
|
filed_label: 'Tgl. Pendapatan',
|
||||||
filter_column: 'main__settlement_date',
|
filter_column: 'main__settlement_date',
|
||||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||||
|
@ -291,11 +284,11 @@ export default <ReportConfigEntity>{
|
||||||
{
|
{
|
||||||
filed_label: 'No. PoS',
|
filed_label: 'No. PoS',
|
||||||
filter_column: 'main__creator_counter_no',
|
filter_column: 'main__creator_counter_no',
|
||||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
field_type: FILTER_FIELD_TYPE.input_number,
|
||||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filed_label: 'Tanggal Pengembalian',
|
filed_label: 'Tgl. Pengembalian',
|
||||||
filter_column: 'refund__refund_date',
|
filter_column: 'refund__refund_date',
|
||||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||||
|
|
|
@ -37,9 +37,17 @@ export default <ReportConfigEntity>{
|
||||||
format: DATA_FORMAT.TEXT,
|
format: DATA_FORMAT.TEXT,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
column: 'main__settlement_date',
|
column: 'main__payment_date',
|
||||||
query: 'main.settlement_date',
|
query: 'main.payment_date',
|
||||||
label: 'Tgl. Pendapatan',
|
label: 'Tgl. Transaksi',
|
||||||
|
type: DATA_TYPE.DIMENSION,
|
||||||
|
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||||
|
date_format: 'DD/MM/YYYY',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
column: 'main__payment_date_bank',
|
||||||
|
query: 'main.payment_date_bank',
|
||||||
|
label: 'Tgl. Transaksi Bank',
|
||||||
type: DATA_TYPE.DIMENSION,
|
type: DATA_TYPE.DIMENSION,
|
||||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||||
date_format: 'DD/MM/YYYY',
|
date_format: 'DD/MM/YYYY',
|
||||||
|
@ -94,6 +102,13 @@ export default <ReportConfigEntity>{
|
||||||
type: DATA_TYPE.MEASURE,
|
type: DATA_TYPE.MEASURE,
|
||||||
format: DATA_FORMAT.CURRENCY,
|
format: DATA_FORMAT.CURRENCY,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
column: 'main__payment_total_net_profit',
|
||||||
|
query: 'main.payment_total_net_profit',
|
||||||
|
label: 'Net Pendapatan',
|
||||||
|
type: DATA_TYPE.MEASURE,
|
||||||
|
format: DATA_FORMAT.CURRENCY,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
column: 'cashier',
|
column: 'cashier',
|
||||||
query: `CASE WHEN main.type = 'counter' THEN main.creator_name END`,
|
query: `CASE WHEN main.type = 'counter' THEN main.creator_name END`,
|
||||||
|
@ -129,8 +144,14 @@ export default <ReportConfigEntity>{
|
||||||
select_custom_options: [...Object.values(TransactionType)],
|
select_custom_options: [...Object.values(TransactionType)],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filed_label: 'Tgl. Pendapatan',
|
filed_label: 'Tgl. Transaksi',
|
||||||
filter_column: 'main__settlement_date',
|
filter_column: 'main__payment_date',
|
||||||
|
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||||
|
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filed_label: 'Tgl. Transaksi Bank',
|
||||||
|
filter_column: 'main__payment_date_bank',
|
||||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||||
},
|
},
|
||||||
|
|
|
@ -43,6 +43,7 @@ export class DetailReconciliationManager extends BaseDetailManager<TransactionEn
|
||||||
`${this.tableName}.payment_code_reference`,
|
`${this.tableName}.payment_code_reference`,
|
||||||
`${this.tableName}.payment_code`,
|
`${this.tableName}.payment_code`,
|
||||||
`${this.tableName}.payment_date`,
|
`${this.tableName}.payment_date`,
|
||||||
|
`${this.tableName}.payment_date_bank`,
|
||||||
|
|
||||||
`${this.tableName}.payment_total`,
|
`${this.tableName}.payment_total`,
|
||||||
`${this.tableName}.payment_total_net_profit`,
|
`${this.tableName}.payment_total_net_profit`,
|
||||||
|
|
|
@ -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`,
|
||||||
|
@ -58,6 +59,7 @@ export class IndexReconciliationManager extends BaseIndexManager<TransactionEnti
|
||||||
`${this.tableName}.payment_code_reference`,
|
`${this.tableName}.payment_code_reference`,
|
||||||
`${this.tableName}.payment_code`,
|
`${this.tableName}.payment_code`,
|
||||||
`${this.tableName}.payment_date`,
|
`${this.tableName}.payment_date`,
|
||||||
|
`${this.tableName}.payment_date_bank`,
|
||||||
|
|
||||||
`${this.tableName}.payment_total`,
|
`${this.tableName}.payment_total`,
|
||||||
`${this.tableName}.payment_total_net_profit`,
|
`${this.tableName}.payment_total_net_profit`,
|
||||||
|
@ -110,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,
|
||||||
|
|
|
@ -25,6 +25,7 @@ export class UpdateReconciliationManager extends BaseUpdateManager<TransactionEn
|
||||||
reconciliation_mdr: this.data.reconciliation_mdr ?? null,
|
reconciliation_mdr: this.data.reconciliation_mdr ?? null,
|
||||||
payment_total_net_profit: net_profit,
|
payment_total_net_profit: net_profit,
|
||||||
payment_date: this.data.payment_date ?? this.oldData.payment_date,
|
payment_date: this.data.payment_date ?? this.oldData.payment_date,
|
||||||
|
payment_date_bank: this.data.payment_date_bank ?? null,
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -148,6 +151,9 @@ export class TransactionModel
|
||||||
@Column('date', { name: 'payment_date', nullable: true })
|
@Column('date', { name: 'payment_date', nullable: true })
|
||||||
payment_date: Date;
|
payment_date: Date;
|
||||||
|
|
||||||
|
@Column('date', { name: 'payment_date_bank', nullable: true })
|
||||||
|
payment_date_bank: Date;
|
||||||
|
|
||||||
// calculation data
|
// calculation data
|
||||||
@Column('decimal', { name: 'payment_sub_total', nullable: true })
|
@Column('decimal', { name: 'payment_sub_total', nullable: true })
|
||||||
payment_sub_total: number;
|
payment_sub_total: number;
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -54,6 +55,7 @@ export interface TransactionEntity extends BaseStatusEntity {
|
||||||
payment_midtrans_token: string;
|
payment_midtrans_token: string;
|
||||||
payment_midtrans_url: string;
|
payment_midtrans_url: string;
|
||||||
payment_date: Date;
|
payment_date: Date;
|
||||||
|
payment_date_bank: Date;
|
||||||
|
|
||||||
// calculation data
|
// calculation data
|
||||||
payment_sub_total: number; // total invoice tanpa discount
|
payment_sub_total: number; // total invoice tanpa discount
|
||||||
|
|
|
@ -61,11 +61,12 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
||||||
|
|
||||||
// jika delete
|
// jika delete
|
||||||
if (data._deleted ?? false) {
|
if (data._deleted ?? false) {
|
||||||
await this.dataService.deleteById(
|
// FIXME => This comment for ignore delete from POS data
|
||||||
queryRunner,
|
// await this.dataService.deleteById(
|
||||||
TransactionModel,
|
// queryRunner,
|
||||||
data._id,
|
// TransactionModel,
|
||||||
);
|
// data._id,
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
// jika update // create
|
// jika update // create
|
||||||
|
|
|
@ -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`,
|
||||||
|
|
|
@ -2,4 +2,5 @@ export enum UserRole {
|
||||||
SUPERADMIN = 'superadmin',
|
SUPERADMIN = 'superadmin',
|
||||||
STAFF = 'staff',
|
STAFF = 'staff',
|
||||||
TENANT = 'tenant',
|
TENANT = 'tenant',
|
||||||
|
QUEUE_ADMIN = 'queue_admin',
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue