Roberto Santini před 1 týdnem
rodič
revize
fdba820de7

+ 1
- 0
app/Models/ContrattoServizio.php Zobrazit soubor

@@ -155,6 +155,7 @@ class ContrattoServizio extends \App\Models\AbstractModels\AbstractContrattoServ
155 155
         return match ($this->periodo_ore) {
156 156
             'mensile' => ($mesi[(int) $oggi->month] ?? $oggi->format('m')).' '.$oggi->format('Y'),
157 157
             'trimestrale' => 'Q'.$oggi->quarter.' '.$oggi->format('Y'),
158
+            'semestrale' => ($oggi->month <= 6 ? '1°' : '2°').' semestre '.$oggi->format('Y'),
158 159
             'annuale' => $oggi->format('Y'),
159 160
             default => 'una tantum',
160 161
         };

+ 2
- 0
app/Models/ContrattoServizioRiga.php Zobrazit soubor

@@ -171,6 +171,7 @@ class ContrattoServizioRiga extends \App\Models\AbstractModels\AbstractContratto
171 171
         return match ($periodoRiga) {
172 172
             'mensile' => max(1, $mesi),
173 173
             'trimestrale' => max(1, intdiv($mesi, 3)),
174
+            'semestrale' => max(1, intdiv($mesi, 6)),
174 175
             'annuale' => max(1, intdiv($mesi, 12)),
175 176
             default => 1,
176 177
         };
@@ -186,6 +187,7 @@ class ContrattoServizioRiga extends \App\Models\AbstractModels\AbstractContratto
186 187
         return match ($this->periodo) {
187 188
             'mensile' => '× '.$n.' mesi',
188 189
             'trimestrale' => '× '.$n.' trimestri',
190
+            'semestrale' => '× '.$n.' semestri',
189 191
             'annuale' => '× '.$n.' anni',
190 192
             default => '× '.$n,
191 193
         };

+ 1
- 0
app/Models/Prodotto.php Zobrazit soubor

@@ -13,6 +13,7 @@ class Prodotto extends \App\Models\AbstractModels\AbstractProdotto
13 13
         'una_tantum' => 'Una tantum',
14 14
         'mensile' => 'Mensile',
15 15
         'trimestrale' => 'Trimestrale',
16
+        'semestrale' => 'Semestrale',
16 17
         'annuale' => 'Annuale',
17 18
         'a_consumo' => 'A consumo',
18 19
     ];

+ 1
- 0
resources/views/contratto_servizio/form.blade.php Zobrazit soubor

@@ -567,6 +567,7 @@
567 567
     const mesi = rigaMesiValidita(tr);
568 568
     if (periodo === 'mensile') return Math.max(1, mesi);
569 569
     if (periodo === 'trimestrale') return Math.max(1, Math.floor(mesi / 3));
570
+    if (periodo === 'semestrale') return Math.max(1, Math.floor(mesi / 6));
570 571
     if (periodo === 'annuale') return Math.max(1, Math.floor(mesi / 12));
571 572
     return 1;
572 573
   }

Loading…
Zrušit
Uložit