Merge pull request 'feat/adjustment-report' (#81) from feat/adjustment-report into development
Reviewed-on: #81fix/report 20.1.58-alpha.1
commit
0457fc9e1d
|
@ -0,0 +1,22 @@
|
|||
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`,
|
||||
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;
|
||||
},
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
import { REPORT_GROUP } from '../../../constant';
|
||||
import { ReportConfigEntity } from '../../../entities/report-config.entity';
|
||||
import IncomeReportPerItem from '../../transaction-report/configs/income-per-item';
|
||||
|
||||
export default <ReportConfigEntity>{
|
||||
...IncomeReportPerItem,
|
||||
group_name: REPORT_GROUP.tenant_report,
|
||||
unique_name: `${REPORT_GROUP.tenant_report}__income_per_item`,
|
||||
};
|
|
@ -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,8 @@
|
|||
import { ReportConfigEntity } from '../../entities/report-config.entity';
|
||||
import SampleReport from './configs/sample.report';
|
||||
import IncomeReportPerItem from './configs/income-per-item';
|
||||
import IncomeReportPerItemMaster from './configs/income-per-item-master';
|
||||
|
||||
export const TenantReportConfig: ReportConfigEntity[] = [
|
||||
// SampleReport
|
||||
IncomeReportPerItem,
|
||||
IncomeReportPerItemMaster,
|
||||
];
|
||||
|
|
|
@ -94,8 +94,8 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
filed_label: 'No. PoS',
|
||||
filter_column: 'main__pos_number',
|
||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
||||
field_type: FILTER_FIELD_TYPE.input_number,
|
||||
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -85,5 +85,11 @@ export default <ReportConfigEntity>{
|
|||
field_type: FILTER_FIELD_TYPE.input_tag,
|
||||
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,
|
||||
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',
|
||||
query: 'main.invoice_code',
|
||||
label: 'Kode Transaksi',
|
||||
query: `CASE WHEN main.type != 'counter' THEN main.invoice_code ELSE null END`,
|
||||
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,
|
||||
format: DATA_FORMAT.TEXT,
|
||||
},
|
||||
|
@ -173,8 +187,8 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
filed_label: 'No. Pos',
|
||||
filter_column: 'main__creator_counter_no',
|
||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
||||
field_type: FILTER_FIELD_TYPE.input_number,
|
||||
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||
},
|
||||
{
|
||||
filed_label: 'Nama Pelanggan',
|
||||
|
|
|
@ -38,7 +38,7 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
column: 'main__settlement_date',
|
||||
query: 'main.settlement_date',
|
||||
label: 'Tanggal Pendapatan',
|
||||
label: 'Tgl. Pendapatan',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||
date_format: 'DD/MM/YYYY',
|
||||
|
@ -59,14 +59,14 @@ export default <ReportConfigEntity>{
|
|||
},
|
||||
{
|
||||
column: 'main__invoice_code',
|
||||
query: 'main.invoice_code',
|
||||
query: `CASE WHEN main.type != 'counter' THEN main.invoice_code ELSE null END`,
|
||||
label: 'Kode Booking',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.TEXT,
|
||||
},
|
||||
{
|
||||
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',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.TEXT,
|
||||
|
@ -117,7 +117,7 @@ export default <ReportConfigEntity>{
|
|||
column: 'tr_item__qty',
|
||||
query: 'tr_item.qty',
|
||||
label: 'Qty',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.NUMBER,
|
||||
},
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
column: 'refund__refund_date',
|
||||
query: 'refund.refund_date',
|
||||
label: 'Tanggal Pengembalian',
|
||||
label: 'Tgl. Pengembalian',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||
date_format: 'DD/MM/YYYY',
|
||||
|
@ -162,7 +162,7 @@ export default <ReportConfigEntity>{
|
|||
column: 'refund_item__qty_refund',
|
||||
query: 'refund_item.qty_refund',
|
||||
label: 'Qty Pengembalian',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.NUMBER,
|
||||
},
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ export default <ReportConfigEntity>{
|
|||
column: 'tenant_income',
|
||||
query: 'tr_item.total_price - tr_item.item_tenant_share_margin',
|
||||
label: 'Pendapatan Tenant',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.CURRENCY,
|
||||
},
|
||||
|
||||
|
@ -239,7 +239,7 @@ export default <ReportConfigEntity>{
|
|||
ignore_filter_keys: ['tr_item__breakdown_bundling'],
|
||||
filter_configs: [
|
||||
{
|
||||
filed_label: 'Tanggal Pendapatan',
|
||||
filed_label: 'Tgl. Pendapatan',
|
||||
filter_column: 'main__settlement_date',
|
||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||
|
@ -303,11 +303,11 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
filed_label: 'No. PoS',
|
||||
filter_column: 'main__creator_counter_no',
|
||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
||||
field_type: FILTER_FIELD_TYPE.input_number,
|
||||
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||
},
|
||||
{
|
||||
filed_label: 'Tanggal Pengembalian',
|
||||
filed_label: 'Tgl. Pengembalian',
|
||||
filter_column: 'refund__refund_date',
|
||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||
|
|
|
@ -37,7 +37,7 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
column: 'main__settlement_date',
|
||||
query: 'main.settlement_date',
|
||||
label: 'Tanggal Pendapatan',
|
||||
label: 'Tgl. Pendapatan',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||
date_format: 'DD/MM/YYYY',
|
||||
|
@ -58,14 +58,14 @@ export default <ReportConfigEntity>{
|
|||
},
|
||||
{
|
||||
column: 'main__invoice_code',
|
||||
query: 'main.invoice_code',
|
||||
query: `CASE WHEN main.type != 'counter' THEN main.invoice_code ELSE null END`,
|
||||
label: 'Kode Booking',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.TEXT,
|
||||
},
|
||||
{
|
||||
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',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.TEXT,
|
||||
|
@ -102,7 +102,7 @@ export default <ReportConfigEntity>{
|
|||
column: 'tr_item__qty',
|
||||
query: 'tr_item.qty',
|
||||
label: 'Qty',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.NUMBER,
|
||||
},
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
column: 'refund__refund_date',
|
||||
query: 'refund.refund_date',
|
||||
label: 'Tanggal Pengembalian',
|
||||
label: 'Tgl. Pengembalian',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||
date_format: 'DD/MM/YYYY',
|
||||
|
@ -147,7 +147,7 @@ export default <ReportConfigEntity>{
|
|||
column: 'refund_item__qty_refund',
|
||||
query: 'refund_item.qty_refund',
|
||||
label: 'Qty Pengembalian',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.NUMBER,
|
||||
},
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ export default <ReportConfigEntity>{
|
|||
column: 'tenant_income',
|
||||
query: 'tr_item.total_price - tr_item.item_tenant_share_margin',
|
||||
label: 'Pendapatan Tenant',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.CURRENCY,
|
||||
},
|
||||
|
||||
|
@ -211,7 +211,7 @@ export default <ReportConfigEntity>{
|
|||
],
|
||||
filter_configs: [
|
||||
{
|
||||
filed_label: 'Tanggal Pendapatan',
|
||||
filed_label: 'Tgl. Pendapatan',
|
||||
filter_column: 'main__settlement_date',
|
||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||
|
@ -262,11 +262,11 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
filed_label: 'No. PoS',
|
||||
filter_column: 'main__creator_counter_no',
|
||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
||||
field_type: FILTER_FIELD_TYPE.input_number,
|
||||
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||
},
|
||||
{
|
||||
filed_label: 'Tanggal Pengembalian',
|
||||
filed_label: 'Tgl. Pengembalian',
|
||||
filter_column: 'refund__refund_date',
|
||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||
|
|
|
@ -40,7 +40,7 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
column: 'main__settlement_date',
|
||||
query: 'main.settlement_date',
|
||||
label: 'Tanggal Pendapatan',
|
||||
label: 'Tgl. Pendapatan',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||
date_format: 'DD/MM/YYYY',
|
||||
|
@ -61,14 +61,14 @@ export default <ReportConfigEntity>{
|
|||
},
|
||||
{
|
||||
column: 'main__invoice_code',
|
||||
query: 'main.invoice_code',
|
||||
query: `CASE WHEN main.type != 'counter' THEN main.invoice_code ELSE null END`,
|
||||
label: 'Kode Booking',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.TEXT,
|
||||
},
|
||||
{
|
||||
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',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
format: DATA_FORMAT.TEXT,
|
||||
|
@ -101,13 +101,6 @@ export default <ReportConfigEntity>{
|
|||
type: DATA_TYPE.MEASURE,
|
||||
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',
|
||||
query: 'main.payment_total_dpp',
|
||||
|
@ -133,21 +126,21 @@ export default <ReportConfigEntity>{
|
|||
column: 'main__discount_value',
|
||||
query: 'main.discount_value',
|
||||
label: 'Diskon (IDR)',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.CURRENCY,
|
||||
},
|
||||
{
|
||||
column: 'main__payment_total',
|
||||
query: 'main.payment_total',
|
||||
label: 'Total Penjualan',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.CURRENCY,
|
||||
},
|
||||
{
|
||||
column: 'refund__refund_date',
|
||||
query: 'refund.refund_date',
|
||||
label: 'Tanggal Pengembalian',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
label: 'Tgl. Pengembalian',
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.DATE_TIMESTAMP,
|
||||
date_format: 'DD/MM/YYYY',
|
||||
},
|
||||
|
@ -169,14 +162,14 @@ export default <ReportConfigEntity>{
|
|||
column: 'refund__refund_total',
|
||||
query: '(refund.refund_total * -1)',
|
||||
label: 'Total Pengembalian',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.CURRENCY,
|
||||
},
|
||||
{
|
||||
column: 'transaction_balance',
|
||||
query: `CASE WHEN refund.id is null THEN main.payment_total ELSE main.payment_total - refund.refund_total END`,
|
||||
label: 'Balance',
|
||||
type: DATA_TYPE.DIMENSION,
|
||||
type: DATA_TYPE.MEASURE,
|
||||
format: DATA_FORMAT.CURRENCY,
|
||||
},
|
||||
{
|
||||
|
@ -252,7 +245,7 @@ export default <ReportConfigEntity>{
|
|||
],
|
||||
filter_configs: [
|
||||
{
|
||||
filed_label: 'Tanggal Pendapatan',
|
||||
filed_label: 'Tgl. Pendapatan',
|
||||
filter_column: 'main__settlement_date',
|
||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||
|
@ -291,11 +284,11 @@ export default <ReportConfigEntity>{
|
|||
{
|
||||
filed_label: 'No. PoS',
|
||||
filter_column: 'main__creator_counter_no',
|
||||
field_type: FILTER_FIELD_TYPE.input_tag,
|
||||
filter_type: FILTER_TYPE.TEXT_MULTIPLE_CONTAINS,
|
||||
field_type: FILTER_FIELD_TYPE.input_number,
|
||||
filter_type: FILTER_TYPE.NUMBER_EQUAL,
|
||||
},
|
||||
{
|
||||
filed_label: 'Tanggal Pengembalian',
|
||||
filed_label: 'Tgl. Pengembalian',
|
||||
filter_column: 'refund__refund_date',
|
||||
field_type: FILTER_FIELD_TYPE.date_range_picker,
|
||||
filter_type: FILTER_TYPE.DATE_IN_RANGE_TIMESTAMP,
|
||||
|
|
|
@ -94,6 +94,13 @@ export default <ReportConfigEntity>{
|
|||
type: DATA_TYPE.MEASURE,
|
||||
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',
|
||||
query: `CASE WHEN main.type = 'counter' THEN main.creator_name END`,
|
||||
|
|
Loading…
Reference in New Issue