1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-11 07:05:22 +01:00

Miglioramenti grafici

This commit is contained in:
Thomas Zilio 2018-10-13 10:15:54 +02:00
parent eb19f8610a
commit 9356f368cc
2 changed files with 76 additions and 42 deletions

View File

@ -74,42 +74,37 @@ if (!empty($missing)) {
</div>';
}
if ($generated) {
echo '
<div class="row">
<div class="col-md-6">';
}
echo '
<p>'.tr("Per effettuare la generazione dell'XML della fattura elettronica clicca sul pulsante _BTN_", [
'_BTN_' => '<b>Genera</b>'
]).'. '.tr("Successivamente sarà possibile procedere alla visualizzazione e al download della fattura generata attraverso i pulsanti dedicati").'.</p>';
echo '
<form action="" method="post" role="form">
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
<input type="hidden" name="id_record" value="'.$id_record.'">
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="generate">
<div class="text-center">
<form action="" method="post" role="form" style="display:inline-block">
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
<input type="hidden" name="id_record" value="'.$id_record.'">
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="generate">
<button type="submit" class="btn btn-primary btn-lg btn-block'.($disabled ? ' disabled' : null).'" '.($disabled ? ' disabled' : null).'>
<i class="fa fa-file"></i> '.tr('Genera').'
</button>
</form>';
<button type="submit" class="btn btn-primary btn-lg '.($disabled ? 'disabled' : '').'" '.($disabled ? ' disabled' : null).'>
<i class="fa fa-file"></i> '.tr('Genera').'
</button>
</form>';
if ($generated) {
echo '
</div>
echo '
<i class="fa fa-arrow-right fa-fw text-muted"></i>
<a href="'.ROOTDIR.'/editor.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'&id_record='.$id_record.'&op=download" class="btn btn-success btn-lg '.($generated ? '' : 'disabled').'" target="_blank" '.($generated ? '' : 'disabled').'>
<i class="fa fa-download"></i> '.tr('Scarica').'
</a>
<i class="fa fa-arrow-right fa-fw text-muted"></i>';
echo '
<a href="'.ROOTDIR.'/plugins/exportPA/view.php?id_record='.$id_record.'" class="btn btn-info btn-lg '.($generated ? '' : 'disabled').'" target="_blank" '.($generated ? '' : 'disabled').'>
<i class="fa fa-eye"></i> '.tr('Visualizza').'
</a>
<div class="col-md-6">
<a href="'.ROOTDIR.'/editor.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'&id_record='.$id_record.'&op=download" class="btn btn-success btn-lg btn-block" target="_blank">
<i class="fa fa-download"></i> '.tr('Scarica').'
</a>
</div>
</div>';
echo '
<hr>
<div class="row">
<div class="col-md-12">
<a href="'.ROOTDIR.'/plugins/exportPA/view.php?id_record='.$id_record.'" class="btn btn-info btn-lg btn-block" target="_blank">
<i class="fa fa-eye"></i> '.tr('Visualizza').'
</a>
</div>
</div>';
}

View File

@ -7,8 +7,34 @@ $directory = Uploads::getDirectory($id_module);
$xml = file_get_contents(DOCROOT.'/'.$directory.'/'.get('filename'));
$fattura_pa = new Plugins\ImportPA\FatturaElettronica($xml, post('id_segment'));
$righe = $fattura_pa->getRighe();
echo '
<form action="'.$rootdir.'/actions.php" method="post">
<input type="hidden" name="id_module" value="'.$id_module.'">
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
<input type="hidden" name="filename" value="'.get('filename').'">
<input type="hidden" name="id_segment" value="'.get('id_segment').'">
<input type="hidden" name="id" value="'.get('id').'">
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="generate">';
// Fornitore
$fornitore = $fattura_pa->getHeader()['CedentePrestatore']['DatiAnagrafici'];
$ragione_sociale = $fornitore['Anagrafica']['Denominazione'] ?: $fornitore['Anagrafica']['Nome'].' '.$fornitore['Anagrafica']['Cognome'];
$codice_fiscale = $fornitore['CodiceFiscale'];
$partita_iva = $fornitore['IdFiscaleIVA']['IdCodice'];
echo '
<h4>'.tr('Fornitore').'</h4>
<p>'.tr('Le informazioni principali del fornitore sono le seguenti').':</p>
<ul>
<li>'.tr('Ragione Sociale').': '.$ragione_sociale.'</li>
<li>'.tr('Codice Fiscale').': '.$codice_fiscale.'</li>
<li>'.tr('Partita IVA').': '.$partita_iva.'</li>
</ul>';
// Pagamenti
$pagamenti = $fattura_pa->getBody()['DatiPagamento'];
$metodi = $pagamenti['DettaglioPagamento'];
@ -18,19 +44,32 @@ $metodi = isset($metodi[0]) ? $metodi : [$metodi];
$query = 'SELECT id, descrizione FROM co_pagamenti WHERE codice_modalita_pagamento_fe = '.prepare($metodi[0]['ModalitaPagamento']).' GROUP BY descrizione ORDER BY descrizione ASC';
echo '
<form action="'.$rootdir.'/actions.php" method="post">
<input type="hidden" name="id_module" value="'.$id_module.'">
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
<input type="hidden" name="filename" value="'.get('filename').'">
<input type="hidden" name="id_segment" value="'.get('id_segment').'">
<input type="hidden" name="id" value="'.get('id').'">
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="generate">
<h4>'.tr('Pagamento').'</h4>
<p>'.tr('La fattura importata presenta _NUM_ rate di pagamento con le seguenti scadenze', [
'_NUM_' => count($metodi)
]).':</p>
<ul>';
// Scadenze di pagamento
foreach ($metodi as $metodo) {
echo '
<li>'.Translator::dateToLocale($metodo['DataScadenzaPagamento']).'</li>';
}
echo '
</ul>';
echo '
{[ "type": "select", "label": "'.tr('Pagamento').'", "name": "pagamento", "required": 1, "values": "query='.$query.'" ]}';
// Righe
$righe = $fattura_pa->getRighe();
if (!empty($righe)) {
echo '
<h4>'.tr('Righe').'</h4>
<table class="table table-hover table-striped">
<tr>
<th width="10%">'.tr('Riga').'</th>