diff --git a/plugins/exportFE/actions.php b/plugins/exportFE/actions.php index 35ad6cf10..d05be6761 100644 --- a/plugins/exportFE/actions.php +++ b/plugins/exportFE/actions.php @@ -31,6 +31,8 @@ switch (filter('op')) { if ($result) { database()->update('co_documenti', [ 'codice_stato_fe' => 'WAIT', + 'descrizione_stato_fe' => 'Fattura in elaborazione...', + 'data_stato_fe' => date('Y-m-d H:i:s'), ], ['id' => $id_record]); } diff --git a/plugins/exportFE/edit.php b/plugins/exportFE/edit.php index 2e2d79c1f..294601772 100644 --- a/plugins/exportFE/edit.php +++ b/plugins/exportFE/edit.php @@ -151,7 +151,8 @@ echo ' '.tr('Visualizza').' '; -$send = Interaction::isEnabled() && $generated && $record['codice_stato_fe'] == 'GEN'; +// Scelgo quando posso inviarla +$send = Interaction::isEnabled() && $generated && in_array( $record['codice_stato_fe'], array('GEN', 'ERVAL') ); echo ' @@ -159,8 +160,34 @@ echo ' +

'; +// Messaggio esito invio +if ($record['codice_stato_fe'] == '') { + +} elseif ($record['codice_stato_fe'] == 'GEN') { + echo ' +
'.tr('La fattura è stata generata ed è pronta per l\'invio.').'
+ '; +} else { + $stato_fe = database()->fetchOne('SELECT codice, descrizione, icon FROM fe_stati_documento WHERE codice='.prepare($record['codice_stato_fe'])); + + if (in_array($stato_fe['codice'], array('EC01', 'RC'))) { + $class = 'success'; + } elseif (in_array($stato_fe['codice'], array('ERVAL', 'GEN', 'MC', 'WAIT'))) { + $class = 'warning'; + } else { + $class = 'danger'; + } + + echo ' +
'.$record['codice_stato_fe'].' - '.$record['descrizione_stato_fe'].'
'.date('d/m/Y H:i', strtotime($record['data_stato_fe'])).'
+ '; +} + + + +echo '