进货业绩每月20号结算
parent
b2ef9cbc3f
commit
161478fdca
|
|
@ -56,17 +56,13 @@ class PurchaseSubsidySettleCommand extends Command
|
||||||
$tz = now();
|
$tz = now();
|
||||||
|
|
||||||
if ($tz->day >= 20) {
|
if ($tz->day >= 20) {
|
||||||
// 结算当月5号-19号的管理津贴
|
// 上月20号-当月19号的进货业绩
|
||||||
$startAt = $tz->copy()->setDay(5)->startOfDay();
|
$startAt = $tz->copy()->subMonthNoOverflow()->setDay(20)->startOfDay();
|
||||||
$endAt = $tz->copy()->setDay(19)->endOfDay();
|
$endAt = $tz->copy()->setDay(19)->endOfDay();
|
||||||
} elseif ($tz->day >= 5) {
|
|
||||||
// 结算上月20号-到当月4号的管理津贴
|
|
||||||
$startAt = $tz->copy()->subMonthNoOverflow()->set('day', 20)->startOfDay();
|
|
||||||
$endAt = $tz->copy()->set('day', 4)->endOfDay();
|
|
||||||
} else {
|
} else {
|
||||||
// 结算上月5号-到19号的管理津贴
|
// 上上月20号-上月19号的进货业绩
|
||||||
$startAt = $tz->copy()->subMonthNoOverflow()->setDay(5)->startOfDay();
|
$startAt = $tz->copy()->subMonthsNoOverflow(2)->setDay(20)->startOfDay();
|
||||||
$endAt = $startAt->copy()->setDay(19)->endOfDay();
|
$endAt = $tz->copy()->subMonthNoOverflow()->setDay(19)->endOfDay();
|
||||||
}
|
}
|
||||||
|
|
||||||
$head = '【'.$startAt->format('Y/m/d').'-'.$endAt->format('Y/m/d').'】';
|
$head = '【'.$startAt->format('Y/m/d').'-'.$endAt->format('Y/m/d').'】';
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class Kernel extends ConsoleKernel
|
||||||
->runInBackground();
|
->runInBackground();
|
||||||
|
|
||||||
$schedule->command('dealer:purchase-subsidy-settle')
|
$schedule->command('dealer:purchase-subsidy-settle')
|
||||||
->twiceMonthly(5, 20, '3:00')
|
->twiceMonthly(20, '3:00')
|
||||||
->runInBackground();
|
->runInBackground();
|
||||||
|
|
||||||
$schedule->command('dealer:manager-subsidy-settle')
|
$schedule->command('dealer:manager-subsidy-settle')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue