Fix minore stampe liquidazione iva

This commit is contained in:
Pek5892 2023-04-07 11:51:06 +02:00
parent 9bd6dbba01
commit 00f69a483e
1 changed files with 22 additions and 17 deletions

View File

@ -36,25 +36,30 @@ $periodi[] = [
$month_start = 1;
$month_end = 3;
for ($i=1; $i<=4; $i++) {
$periodi[] = [
'id' => ''.$i.'_trimestre',
'text' => tr('_NUM_° Trimestre _YEAR_', ['_NUM_' => $i, '_YEAR_' => $year]),
'date_start' => $year.','.$month_start.',01',
'date_end' => $year.','.$month_end.','.(new Carbon($year.'-'.$month_end.'-01'))->endOfMonth()->format('d'),
];
$month_start += 3;
$month_end += 3;
if (setting('Liquidazione iva') == 'Trimestrale') {
for ($i=1; $i<=4; $i++) {
$periodi[] = [
'id' => ''.$i.'_trimestre',
'text' => tr('_NUM_° Trimestre _YEAR_', ['_NUM_' => $i, '_YEAR_' => $year]),
'date_start' => $year.','.$month_start.',01',
'date_end' => $year.','.$month_end.','.(new Carbon($year.'-'.$month_end.'-01'))->endOfMonth()->format('d'),
];
$month_start += 3;
$month_end += 3;
}
}
for ($i=1; $i<=12; $i++) {
$month = (new Carbon($year.'-'.$i.'-01'))->locale('it')->getTranslatedMonthName('IT MMMM');
$periodi[] = [
'id' => ''.$i.'_mese',
'text' => tr('_MONTH_ _YEAR_', ['_MONTH_' => $month, '_YEAR_' => $year]),
'date_start' => $year.','.$i.',01',
'date_end' => $year.','.$i.','.(new Carbon($year.'-'.$i.'-01'))->endOfMonth()->format('d'),
];
if (setting('Liquidazione iva') == 'Mensile') {
for ($i=1; $i<=12; $i++) {
$month = (new Carbon($year.'-'.$i.'-01'))->locale('it')->getTranslatedMonthName('IT MMMM');
$periodi[] = [
'id' => ''.$i.'_mese',
'text' => tr('_MONTH_ _YEAR_', ['_MONTH_' => $month, '_YEAR_' => $year]),
'date_start' => $year.','.$i.',01',
'date_end' => $year.','.$i.','.(new Carbon($year.'-'.$i.'-01'))->endOfMonth()->format('d'),
];
}
}