Replace quarter-based declaration numbering with month-based
Declaration Numbering Changes: - Replace 'Q2' (quarter) with month numbers (2 characters) - Single month: 'CA3-2024-05-20241002123456' - Multiple months: 'CA3-2024-05-07-20241002123456' (May to July) - Updated both generateDeclarationNumber() and generateDeclarationNumberFromDates() - More precise period identification in declaration numbers
This commit is contained in:
parent
f42b31fb4d
commit
66037a03f7
@ -354,9 +354,16 @@ class DeclarationTVA
|
|||||||
public function generateDeclarationNumber($period)
|
public function generateDeclarationNumber($period)
|
||||||
{
|
{
|
||||||
$year = date('Y', strtotime($period['start_date']));
|
$year = date('Y', strtotime($period['start_date']));
|
||||||
$quarter = ceil(date('n', strtotime($period['start_date'])) / 3);
|
$start_month = date('m', strtotime($period['start_date']));
|
||||||
|
$end_month = date('m', strtotime($period['end_date']));
|
||||||
|
|
||||||
return 'CA3-' . $year . '-Q' . $quarter . '-' . date('YmdHis');
|
if ($start_month == $end_month) {
|
||||||
|
$month_part = $start_month;
|
||||||
|
} else {
|
||||||
|
$month_part = $start_month . '-' . $end_month;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'CA3-' . $year . '-' . $month_part . '-' . date('YmdHis');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -369,9 +376,16 @@ class DeclarationTVA
|
|||||||
public function generateDeclarationNumberFromDates($start_date, $end_date)
|
public function generateDeclarationNumberFromDates($start_date, $end_date)
|
||||||
{
|
{
|
||||||
$year = date('Y', strtotime($start_date));
|
$year = date('Y', strtotime($start_date));
|
||||||
$quarter = ceil(date('n', strtotime($start_date)) / 3);
|
$start_month = date('m', strtotime($start_date));
|
||||||
|
$end_month = date('m', strtotime($end_date));
|
||||||
|
|
||||||
return 'CA3-' . $year . '-Q' . $quarter . '-' . date('YmdHis');
|
if ($start_month == $end_month) {
|
||||||
|
$month_part = $start_month;
|
||||||
|
} else {
|
||||||
|
$month_part = $start_month . '-' . $end_month;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'CA3-' . $year . '-' . $month_part . '-' . date('YmdHis');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user