feat(settlement): v4.0.6 酒厂 T+3 每 3 天出一期并与订单完全比对
含现场提货入账、零应付仍出账、核对补生成,以及线上历史账单修复 SQL。
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { BadRequestException, Body, Controller, Get, Param, Post, Put, Query, UseGuards } from '@nestjs/common';
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
import { parseShanghaiYmd } from '@dukang/domain';
|
||||
import { DEFAULT_PARTNER_STORE_STAFF_PERMISSIONS } from '@dukang/shared-types';
|
||||
import { SettlementService } from './settlement.service';
|
||||
import { JwtAuthGuard, AuthUser } from '../../common/guards/jwt-auth.guard';
|
||||
@@ -464,8 +465,23 @@ export class AdminWineryBillController {
|
||||
}
|
||||
|
||||
@Post('generate')
|
||||
generate() {
|
||||
return this.settlementService.generateWineryBillForDay();
|
||||
generate(@Body() body?: { date?: string }) {
|
||||
const anchor = body?.date?.trim() ? parseShanghaiYmd(body.date.trim()) : new Date();
|
||||
if (body?.date?.trim() && Number.isNaN(anchor.getTime())) {
|
||||
throw new BadRequestException('日期格式无效,请使用 YYYY-MM-DD');
|
||||
}
|
||||
return this.settlementService.generateWineryBillForDay(anchor);
|
||||
}
|
||||
|
||||
@Post('reconcile')
|
||||
@HqOperation({
|
||||
action: HqOperationAction.WINERY_BILL_RECONCILE,
|
||||
refType: 'WINERY_BILL',
|
||||
batch: true,
|
||||
includeBody: true,
|
||||
})
|
||||
reconcile(@Body() body?: { dateFrom?: string; dateTo?: string }) {
|
||||
return this.settlementService.reconcileWineryBills(body);
|
||||
}
|
||||
|
||||
@Post('batch-confirm')
|
||||
|
||||
Reference in New Issue
Block a user