- added between dates when exporting excel transaction history
This commit is contained in:
parent
8e9295a806
commit
dbb363983b
|
@ -1,8 +1,9 @@
|
|||
import { IsNotEmpty, IsOptional } from 'class-validator';
|
||||
|
||||
export class ExportTransactionDto {
|
||||
@IsNotEmpty()
|
||||
dateStart: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
dateStart: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
dateEnd: string;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ export class ExcelController {
|
|||
) {
|
||||
const result = await this.transactionService.exportDataExcel(
|
||||
exportTransactionDto.dateStart,
|
||||
exportTransactionDto.dateEnd,
|
||||
id,
|
||||
req.user,
|
||||
);
|
||||
|
|
|
@ -2208,7 +2208,7 @@ export class TransactionService {
|
|||
});
|
||||
}
|
||||
|
||||
async exportDataExcel(startDate, user: any, currentUser: any) {
|
||||
async exportDataExcel(startDate, endDate, user: any, currentUser: any) {
|
||||
const userData = await this.userService.findExist(user);
|
||||
|
||||
let userBySupperior = [];
|
||||
|
@ -2285,7 +2285,7 @@ export class TransactionService {
|
|||
'transaction.created_at between :startDate and :enDate',
|
||||
{
|
||||
startDate: new Date (`${startDate} 00:00:00`),
|
||||
enDate: new Date (`${startDate} 23:59:59`),
|
||||
enDate: new Date (`${endDate} 23:59:59`),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -2413,7 +2413,7 @@ export class TransactionService {
|
|||
tmp.file(
|
||||
{
|
||||
discardDescriptor: true,
|
||||
prefix: `Mutasi Transaksi ${userData?.partner.name} ${startDate}`,
|
||||
prefix: `Mutasi Transaksi ${userData?.partner.name} ${startDate} - ${endDate}`,
|
||||
postfix: '.xlsx',
|
||||
mode: parseInt('0600', 8),
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user