fix pianificazione fatturazione
This commit is contained in:
parent
dd56baaf6b
commit
55f440b312
|
@ -156,7 +156,6 @@ switch ($operazione) {
|
||||||
$id_rata = post('rata');
|
$id_rata = post('rata');
|
||||||
$accodare = post('accodare');
|
$accodare = post('accodare');
|
||||||
$pianificazione = Pianificazione::find($id_rata);
|
$pianificazione = Pianificazione::find($id_rata);
|
||||||
|
|
||||||
$contratto = $pianificazione->contratto;
|
$contratto = $pianificazione->contratto;
|
||||||
|
|
||||||
$data = post('data');
|
$data = post('data');
|
||||||
|
@ -175,7 +174,6 @@ switch ($operazione) {
|
||||||
} else {
|
} else {
|
||||||
$fattura = Fattura::find($id_documento);
|
$fattura = Fattura::find($id_documento);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fattura->note = post('note');
|
$fattura->note = post('note');
|
||||||
$fattura->save();
|
$fattura->save();
|
||||||
|
|
||||||
|
@ -183,7 +181,6 @@ switch ($operazione) {
|
||||||
|
|
||||||
// Copia righe
|
// Copia righe
|
||||||
$righe = $pianificazione->getRighe();
|
$righe = $pianificazione->getRighe();
|
||||||
|
|
||||||
foreach ($righe as $riga) {
|
foreach ($righe as $riga) {
|
||||||
$copia = $riga->copiaIn($fattura, $riga->qta);
|
$copia = $riga->copiaIn($fattura, $riga->qta);
|
||||||
$copia->id_conto = $id_conto;
|
$copia->id_conto = $id_conto;
|
||||||
|
@ -192,7 +189,6 @@ switch ($operazione) {
|
||||||
|
|
||||||
// Salvataggio fattura nella pianificazione
|
// Salvataggio fattura nella pianificazione
|
||||||
$pianificazione->fattura()->associate($fattura);
|
$pianificazione->fattura()->associate($fattura);
|
||||||
|
|
||||||
$pianificazione->save();
|
$pianificazione->save();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -86,65 +86,6 @@ echo
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
//gestione replace
|
|
||||||
/*$descrizione = get_var('Descrizione fattura pianificata');
|
|
||||||
$modules = MODULES::get('Contratti')['id'];
|
|
||||||
$variables = include Modules::filepath($modules, 'variables.php');
|
|
||||||
foreach ($variables as $variable => $value) {
|
|
||||||
$descrizione = str_replace('{'.$variable.'}', $value, $descrizione);
|
|
||||||
}
|
|
||||||
$descrizione = str_replace('{rata}', $numero_rata, $descrizione);
|
|
||||||
$descrizione = str_replace('{zona}', $zona, $descrizione);
|
|
||||||
|
|
||||||
echo '
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
{[ "type": "textarea", "label": "'.tr('Note della fattura').'", "name": "note", "value": "'.$descrizione.'" ]}
|
|
||||||
</div>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
// Righe
|
|
||||||
echo '
|
|
||||||
<div class="box box-info">
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<h3 class="box-title">
|
|
||||||
'.tr('Righe previste').'
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div class="box-body">
|
|
||||||
<table class="table table-bordered table-striped table-hover table-condensed">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="40%">'.tr('Descrizione').'</th>
|
|
||||||
<th class="text-center">'.tr('Q.tà').'</th>
|
|
||||||
<th class="text-center">'.tr('Prezzo unitario').'</th>
|
|
||||||
<th class="text-center">'.tr('IVA').'</th>
|
|
||||||
<th class="text-center">'.tr('Totale imponbile').'</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>';
|
|
||||||
|
|
||||||
$righe = $pianificazione[0]->getRighe();
|
|
||||||
foreach ($righe as $riga) {
|
|
||||||
echo '
|
|
||||||
<tr>
|
|
||||||
<td>'.$riga->descrizione.'</td>
|
|
||||||
<td class="text-center">'.$riga->qta.'</td>
|
|
||||||
<td class="text-right">'.moneyFormat($riga->prezzo_unitario).'</td>
|
|
||||||
<td class="text-right">
|
|
||||||
'.moneyFormat($riga->iva).'<br>
|
|
||||||
<small class="help-block">'.$riga->aliquota->descrizione.'</small>
|
|
||||||
</td>
|
|
||||||
<td class="text-right">'.moneyFormat($riga->totale_imponibile).'</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>';*/
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
'<div class="row">
|
'<div class="row">
|
||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
|
|
Loading…
Reference in New Issue