mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-23 14:57:46 +01:00
Fix nodi rivalsa (cassa previdenziale) e ritenuta
This commit is contained in:
parent
ea924937af
commit
b25b272dea
@ -554,11 +554,16 @@ switch (post('op')) {
|
||||
if (post('calcolo_ritenuta_acconto')) {
|
||||
$articolo->calcolo_ritenuta_acconto = post('calcolo_ritenuta_acconto');
|
||||
$articolo->id_ritenuta_acconto = post('id_ritenuta_acconto');
|
||||
}
|
||||
}else{
|
||||
$articolo->calcolo_ritenuta_acconto = null;
|
||||
$articolo->id_ritenuta_acconto = null;
|
||||
}
|
||||
|
||||
if (post('id_rivalsa_inps')) {
|
||||
$articolo->id_rivalsa_inps = post('id_rivalsa_inps');
|
||||
}
|
||||
}else{
|
||||
$articolo->id_rivalsa_inps = null;
|
||||
}
|
||||
|
||||
if (post('prezzo_acquisto')) {
|
||||
$riga->prezzo_unitario_acquisto = post('prezzo_acquisto');
|
||||
@ -612,11 +617,16 @@ switch (post('op')) {
|
||||
if (post('calcolo_ritenuta_acconto')) {
|
||||
$riga->calcolo_ritenuta_acconto = post('calcolo_ritenuta_acconto');
|
||||
$riga->id_ritenuta_acconto = post('id_ritenuta_acconto');
|
||||
}
|
||||
}else{
|
||||
$riga->calcolo_ritenuta_acconto = null;
|
||||
$riga->id_ritenuta_acconto = null;
|
||||
}
|
||||
|
||||
if (post('id_rivalsa_inps')) {
|
||||
$riga->id_rivalsa_inps = post('id_rivalsa_inps');
|
||||
}
|
||||
}else{
|
||||
$riga->id_rivalsa_inps = null;
|
||||
}
|
||||
|
||||
if (post('prezzo_acquisto')) {
|
||||
$riga->prezzo_unitario_acquisto = post('prezzo_acquisto');
|
||||
|
@ -596,19 +596,24 @@ class FatturaElettronica
|
||||
// TODO: 'Causale' => $documento['causale'],
|
||||
];
|
||||
|
||||
// Ritenuta d'Acconto
|
||||
|
||||
$righe = $fattura->getRighe();
|
||||
|
||||
// Ritenuta d'Acconto
|
||||
$id_ritenuta = null;
|
||||
$id_rivalsainps = null;
|
||||
$totale_ritenutaacconto = 0;
|
||||
|
||||
// Rivalsa
|
||||
$id_rivalsainps = null;
|
||||
$totale_rivalsainps = 0;
|
||||
$totale_ritenutaacconto = 0;
|
||||
|
||||
foreach ($righe as $riga) {
|
||||
if (!empty($riga['idritenutaacconto'])) {
|
||||
if (!empty($riga['idritenutaacconto']) and empty($riga['is_descrizione']) ) {
|
||||
$id_ritenuta = $riga['idritenutaacconto'];
|
||||
$totale_ritenutaacconto += $riga['ritenutaacconto'];
|
||||
}
|
||||
|
||||
if (!empty($riga['idrivalsainps'])) {
|
||||
if (!empty($riga['idrivalsainps']) and empty($riga['is_descrizione'])) {
|
||||
$id_rivalsainps = $riga['idrivalsainps'];
|
||||
$totale_rivalsainps += $riga['rivalsainps'];
|
||||
$aliquota_iva_rivalsainps = $riga['idiva'];
|
||||
@ -635,7 +640,7 @@ class FatturaElettronica
|
||||
];
|
||||
}
|
||||
|
||||
// Cassa Previdenziale (2.1.1.7)
|
||||
// Cassa Previdenziale (Rivalsa) (2.1.1.7)
|
||||
if (!empty($id_rivalsainps)) {
|
||||
$iva = database()->fetchOne('SELECT `percentuale`, `codice_natura_fe` FROM `co_iva` WHERE `id` = '.prepare($aliquota_iva_rivalsainps));
|
||||
$percentuale = database()->fetchOne('SELECT percentuale FROM co_rivalse WHERE id = '.prepare($id_rivalsainps))['percentuale'];
|
||||
@ -982,7 +987,7 @@ class FatturaElettronica
|
||||
$dettaglio['PrezzoTotale'] = $prezzo_totale;
|
||||
$dettaglio['AliquotaIVA'] = $percentuale;
|
||||
|
||||
if (!empty($riga['idritenutaacconto'])) {
|
||||
if (!empty($riga['idritenutaacconto']) and empty($riga['is_descrizione'])) {
|
||||
$dettaglio['Ritenuta'] = 'SI';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user