';
- // Informazioni sui preventivi
+ // Informazioni sulle attivitÃ
+ $modulo_interventi = Module::where('name', 'Interventi')->first();
+ if ($modulo_interventi->permission != '-') {
+ // Preventivi attivi
+ $interventi = Intervento::where('idanagrafica', '=', $id_anagrafica)
+ ->latest()->take($numero_documenti)->get();
+ echo '
+
+
'.tr('Ultime _NUM_ Attività ', ['_NUM_' => $numero_documenti]).':';
+ if (!$interventi->isEmpty()) {
+ foreach ($interventi as $intervento) {
+ echo '
+ - '.Modules::link('Interventi', $intervento->id, $intervento->getReference().' ['.$intervento->stato->getTranslation('title').']').'
';
+ }
+ } else {
+ echo '
+ - '.tr('Nessun intervento per questo cliente').'
';
+ }
+ echo '
+
+
';
+ }
+
+ // Informazioni sulle fatture
$modulo_fatture_vendita = Module::where('name', 'Fatture di vendita')->first();
if ($modulo_fatture_vendita->permission != '-') {
// Fatture attive
@@ -81,14 +111,14 @@ switch ($op) {
})
->latest()->take($numero_documenti)->get();
echo '
-
-
'.tr('Fatture').':';
+
+
'.tr('Ultime _NUM_ Fatture', ['_NUM_' => $numero_documenti]).':';
if (!$fatture->isEmpty()) {
foreach ($fatture as $fattura) {
$scadenze = $fattura->scadenze;
$da_pagare = $scadenze->sum('da_pagare') - $scadenze->sum('pagato');
echo '
- - '.$fattura->getReference().': '.moneyFormat($da_pagare).'
';
+ - '.Modules::link('Fatture di vendita', $fattura->id, $fattura->getReference().': '.moneyFormat($da_pagare)).'
';
}
} else {
echo '