. */ include_once __DIR__.'/../../../core.php'; use Carbon\Carbon; use Models\Module; if (!empty($is_title_request)) { echo tr('Notifiche interne'); return; } $notes = collect(); $moduli = Module::getAll()->where('permission', '<>', '-'); foreach ($moduli as $modulo) { $note = $modulo->notes()->whereNotNull('notification_date')->orderBy('notification_date', 'asc')->get(); $notes = $notes->merge($note); } if (!empty($is_number_request)) { echo $notes->count(); return; } if ($notes->count() < 1) { echo '
'.tr('Non ci sono note da notificare').'.
'; return; } $moduli = $notes->groupBy('id_module')->sortBy('notification_date'); foreach ($moduli as $module_id => $note) { $modulo = Module::pool($module_id); echo ''.tr('Riferimento').' | '.(($modulo->title == 'Fatture di acquisto' || $modulo->title == 'Ordini fornitore' || $modulo->title == 'Ddt in entrata') ? tr('Fornitore') : tr('Cliente')).' | '.tr('Contenuto').' | '.tr('Data di notifica').' | # |
---|---|---|---|---|
'.($documento['numero'] == null ? ' - ' : $documento['numero']).' | '.$documento['ragione_sociale'].' | '.$nota->content.' '.$nota->user->nome_completo.' | '.dateFormat($nota->notification_date).' ('.Carbon::parse($nota->notification_date)->diffForHumans().') | '.Modules::link($module_id, $nota->id_record, '', null, 'class="btn btn-primary btn-xs"', true, 'tab_note').' |