Merge branch 'development' of https://gitlab.com/empatnusabangsa/ppob/ppob-backend into devops-staging
This commit is contained in:
commit
f8df57da40
|
@ -1,8 +1,9 @@
|
||||||
import { IsNotEmpty, IsOptional } from 'class-validator';
|
import { IsNotEmpty, IsOptional } from 'class-validator';
|
||||||
|
|
||||||
export class ExportTransactionDto {
|
export class ExportTransactionDto {
|
||||||
|
@IsNotEmpty()
|
||||||
|
dateStart: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
dateStart: string;
|
dateEnd: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ export class ExcelController {
|
||||||
) {
|
) {
|
||||||
const result = await this.transactionService.exportDataExcel(
|
const result = await this.transactionService.exportDataExcel(
|
||||||
exportTransactionDto.dateStart,
|
exportTransactionDto.dateStart,
|
||||||
|
exportTransactionDto.dateEnd,
|
||||||
id,
|
id,
|
||||||
req.user,
|
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);
|
const userData = await this.userService.findExist(user);
|
||||||
|
|
||||||
let userBySupperior = [];
|
let userBySupperior = [];
|
||||||
|
@ -2285,7 +2285,7 @@ export class TransactionService {
|
||||||
'transaction.created_at between :startDate and :enDate',
|
'transaction.created_at between :startDate and :enDate',
|
||||||
{
|
{
|
||||||
startDate: new Date (`${startDate} 00:00:00`),
|
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(
|
tmp.file(
|
||||||
{
|
{
|
||||||
discardDescriptor: true,
|
discardDescriptor: true,
|
||||||
prefix: `Mutasi Transaksi ${userData?.partner.name} ${startDate}`,
|
prefix: `Mutasi Transaksi ${userData?.partner.name} ${startDate} - ${endDate}`,
|
||||||
postfix: '.xlsx',
|
postfix: '.xlsx',
|
||||||
mode: parseInt('0600', 8),
|
mode: parseInt('0600', 8),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user