mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-18 12:30:35 +01:00
Fix minori
This commit is contained in:
parent
4c30f237fd
commit
749f227b06
@ -53,7 +53,7 @@ echo '
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form action="" method="post" role="form" class="tab-pane active" id="inserimento">
|
||||
<form action="" method="post" role="form" class="tab-pane" id="inserimento">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="add_serials">
|
||||
|
||||
|
@ -111,49 +111,50 @@ switch (post('op')) {
|
||||
|
||||
$fattura->save();
|
||||
|
||||
if ($stato_precedente->descrizione == 'Bozza' && $stato['descrizione'] == 'Emessa') {
|
||||
if ($fattura->direzione == 'entrata' && $stato_precedente->descrizione == 'Bozza' && $stato['descrizione'] == 'Emessa') {
|
||||
// Generazione automatica della Fattura Elettronica
|
||||
$stato_fe = empty($fattura->codice_stato_fe) || in_array($fattura->codice_stato_fe, ['GEN', 'NS', 'EC02']);
|
||||
$checks = FatturaElettronica::controllaFattura($fattura);
|
||||
if ($stato_fe && empty($checks)) {
|
||||
try {
|
||||
$fattura_pa = new FatturaElettronica($id_record);
|
||||
$file = $fattura_pa->save(DOCROOT.'/'.FatturaElettronica::getDirectory());
|
||||
$file = $fattura_pa->save(DOCROOT . '/' . FatturaElettronica::getDirectory());
|
||||
|
||||
flash()->info(tr('Fattura elettronica generata correttamente!'));
|
||||
|
||||
if (!$fattura_pa->isValid()) {
|
||||
$errors = $fattura_pa->getErrors();
|
||||
|
||||
flash()->warning(tr('La fattura elettronica potrebbe avere delle irregolarità!').' '.tr('Controllare i seguenti campi: _LIST_', [
|
||||
flash()->warning(tr('La fattura elettronica potrebbe avere delle irregolarità!') . ' ' . tr('Controllare i seguenti campi: _LIST_', [
|
||||
'_LIST_' => implode(', ', $errors),
|
||||
]).'.');
|
||||
]) . '.');
|
||||
}
|
||||
} catch (UnexpectedValueException $e) {
|
||||
}
|
||||
} elseif (!empty($checks)) {
|
||||
$message = tr('La fattura elettronica non è stata generata a causa di alcune informazioni mancanti').':';
|
||||
$message = tr('La fattura elettronica non è stata generata a causa di alcune informazioni mancanti') . ':';
|
||||
|
||||
foreach ($checks as $check) {
|
||||
$message .= '
|
||||
<p><b>'.$check['name'].' '.$check['link'].'</b></p>
|
||||
<ul>';
|
||||
<p><b>' . $check['name'] . ' ' . $check['link'] . '</b></p>
|
||||
<ul>';
|
||||
|
||||
foreach ($check['errors'] as $error) {
|
||||
if (!empty($error)) {
|
||||
$message .= '
|
||||
<li>'.$error.'</li>';
|
||||
<li>' . $error . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
$message .= '
|
||||
</ul>';
|
||||
</ul>';
|
||||
}
|
||||
|
||||
flash()->warning($message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
aggiorna_sedi_movimenti('documenti', $id_record);
|
||||
|
||||
flash()->info(tr('Fattura modificata correttamente!'));
|
||||
|
@ -13,9 +13,10 @@ switch (filter('op')) {
|
||||
|
||||
// Verifico che questo nome gruppo non sia già stato usato
|
||||
if ($dbo->fetchNum('SELECT nome FROM zz_groups WHERE nome='.prepare($nome)) == 0) {
|
||||
$dbo->query('INSERT INTO zz_groups( nome, editable ) VALUES('.prepare($nome).', 1)');
|
||||
flash()->info(tr('Gruppo aggiunto!'));
|
||||
$dbo->query('INSERT INTO zz_groups(nome, editable) VALUES('.prepare($nome).', 1)');
|
||||
$id_record = $dbo->lastInsertedID();
|
||||
|
||||
flash()->info(tr('Gruppo aggiunto!'));
|
||||
} else {
|
||||
flash()->error(tr('Gruppo già esistente!'));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user