1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-26 07:44:02 +01:00

Migliorie minori

This commit is contained in:
Pek5892 2023-11-27 10:06:30 +01:00
parent b0ddbc5e7a
commit 3eb359d25c
2 changed files with 28 additions and 29 deletions

View File

@ -154,14 +154,14 @@ echo '
<table class="table table-hover table-condensed table-bordered text-center"> <table class="table table-hover table-condensed table-bordered text-center">
<thead> <thead>
<tr> <tr>
<th style="width:3%;">'.tr('Rata').'</th>
<th style="width:10%;">'.tr('Data').'</th>
<th style="width:10%;">'.tr('Importo').'</th>
<th style="width:10%;">'.tr('Pagato').'</th>
<th style="width:10%;">'.tr('Data concordata').'</th>
<th style="width:20%;">'.tr('Banca accredito').'</th> <th style="width:20%;">'.tr('Banca accredito').'</th>
<th style="width:20%;">'.tr('Banca addebito').'</th> <th style="width:20%;">'.tr('Banca addebito').'</th>
<th style="width:20%;">'.tr('Tipologia').'</th> <th style="width:20%;">'.tr('Tipologia').'</th>
<th style="width:10%;">'.tr('Data').'</th>
<th style="width:10%;">'.tr('Data concordata').'</th>
<th style="width:10%;">'.tr('Importo').'</th>
<th style="width:10%;">'.tr('Pagato').'</th>
<th style="width:3%;">'.tr('Rata').'</th>
</tr> </tr>
</thead> </thead>
@ -181,29 +181,6 @@ foreach ($scadenze as $i => $scadenza) {
echo ' echo '
<tr class="'.$class.'"> <tr class="'.$class.'">
<input type="hidden" name="id_scadenza['.$i.']" value="'.$scadenza['id'].'"> <input type="hidden" name="id_scadenza['.$i.']" value="'.$scadenza['id'].'">
<td align="center">
<a onclick="launch_modal(\''.tr('Registra contabile pagamento').'\', \''.base_path().'/add.php?id_module='.Modules::get('Prima nota')['id'].'&id_scadenze='.$scadenza['id'].'\');" class="btn btn-sm btn-primary">
<i class="fa fa-euro"></i> '.($scadenza['da_pagare'] > 0 ? tr('Incassa') : tr('Paga')).'
</a>
</td>
<td align="center">
{[ "type": "date", "name": "scadenza['.$i.']", "value": "'.$scadenza['scadenza'].'" ]}
</td>
<td class="text-right">
{[ "type": "number", "name": "da_pagare['.$i.']", "decimals": 2, "value": "'.numberFormat($scadenza['da_pagare'], 2).'", "onchange": "controlloTotale()" ]}
</td>
<td class="text-right">
{[ "type": "number", "name": "pagato['.$i.']", "decimals": 2, "value": "'.numberFormat($scadenza['pagato']).'" ]}
</td>
<td align="center">
{[ "type": "date", "name": "data_concordata['.$i.']", "value": "'.$scadenza['data_concordata'].'" ]}
</td>
<td align="center"> <td align="center">
'.($scadenza['da_pagare'] > 0 ? '.($scadenza['da_pagare'] > 0 ?
'{[ "type": "select", "name": "id_banca_azienda['.$i.']", "ajax-source": "banche", "select-options": '.json_encode(['id_anagrafica' => $anagrafica_azienda->id]).', "value": "'.$scadenza['id_banca_azienda'].'", "icon-after": "add|'.Modules::get('Banche')['id'].'|id_anagrafica='.$anagrafica_azienda->id.'" ]}' '{[ "type": "select", "name": "id_banca_azienda['.$i.']", "ajax-source": "banche", "select-options": '.json_encode(['id_anagrafica' => $anagrafica_azienda->id]).', "value": "'.$scadenza['id_banca_azienda'].'", "icon-after": "add|'.Modules::get('Banche')['id'].'|id_anagrafica='.$anagrafica_azienda->id.'" ]}'
@ -223,6 +200,28 @@ foreach ($scadenze as $i => $scadenza) {
<td> <td>
{[ "type": "select", "name": "tipo_pagamento['.$i.']", "ajax-source": "pagamenti", "select-options": '.json_encode(['id_anagrafica' => $anagrafica_azienda->id]).', "value": "'.$scadenza['tipo_pagamento'].'" ]} {[ "type": "select", "name": "tipo_pagamento['.$i.']", "ajax-source": "pagamenti", "select-options": '.json_encode(['id_anagrafica' => $anagrafica_azienda->id]).', "value": "'.$scadenza['tipo_pagamento'].'" ]}
</td> </td>
<td align="center">
{[ "type": "date", "name": "scadenza['.$i.']", "value": "'.$scadenza['scadenza'].'" ]}
</td>
<td align="center">
{[ "type": "date", "name": "data_concordata['.$i.']", "value": "'.$scadenza['data_concordata'].'" ]}
</td>
<td class="text-right">
{[ "type": "number", "name": "da_pagare['.$i.']", "decimals": 2, "value": "'.numberFormat($scadenza['da_pagare'], 2).'", "onchange": "controlloTotale()" ]}
</td>
<td class="text-right">
{[ "type": "number", "name": "pagato['.$i.']", "decimals": 2, "value": "'.numberFormat($scadenza['pagato']).'" ]}
</td>
<td align="center">
<a onclick="launch_modal(\''.tr('Registra contabile pagamento').'\', \''.base_path().'/add.php?id_module='.Modules::get('Prima nota')['id'].'&id_scadenze='.$scadenza['id'].'\');" class="btn btn-sm btn-primary">
<i class="fa fa-euro"></i> '.($scadenza['da_pagare'] > 0 ? tr('Incassa') : tr('Paga')).'
</a>
</td>
</tr>'; </tr>';
} }

View File

@ -73,7 +73,7 @@ echo "
$rs2 = $dbo->fetchArray('SELECT * FROM co_scadenziario WHERE iddocumento='.prepare($id_record).' ORDER BY `scadenza` ASC'); $rs2 = $dbo->fetchArray('SELECT * FROM co_scadenziario WHERE iddocumento='.prepare($id_record).' ORDER BY `scadenza` ASC');
if (!empty($rs2)) { if (!empty($rs2)) {
for ($i = 0; $i < sizeof($rs2); ++$i) { for ($i = 0; $i < sizeof($rs2); ++$i) {
$pagamento = $dbo->fetchOne('SELECT descrizione FROM co_pagamenti WHERE id='.$rs2[$i]['tipo_pagamento'])['descrizione']; $pagamento = $dbo->fetchOne('SELECT fe_modalita_pagamento.descrizione FROM co_pagamenti INNER JOIN fe_modalita_pagamento ON fe_modalita_pagamento.codice = co_pagamenti.codice_modalita_pagamento_fe WHERE co_pagamenti.id='.$rs2[$i]['tipo_pagamento'])['descrizione'];
echo ' echo '
<tr> <tr>
<td style=\'width:15%;\'> <td style=\'width:15%;\'>