mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-18 12:30:35 +01:00
Merge branch 'master' of https://github.com/devcode-it/openstamanager
This commit is contained in:
commit
621224ae95
@ -785,6 +785,10 @@ function aggiorna_sconto($tables, $fields, $id_record, $options = [])
|
||||
|
||||
$descrizione = $descrizione.' '.Translator::numberToLocale($sconto[0]['sconto_globale']).'%';
|
||||
} else {
|
||||
$rs = $dbo->fetchArray('SELECT SUM(subtotale - sconto) AS imponibile, SUM(iva) AS iva FROM (SELECT '.$tables['row'].'.subtotale, '.$tables['row'].'.sconto, '.$tables['row'].'.iva FROM '.$tables['row'].' WHERE '.$fields['row'].'='.prepare($id_record).') AS t');
|
||||
$subtotale = $rs[0]['imponibile'];
|
||||
$iva += $sconto[0]['sconto_globale'] * $rs[0]['iva'] / $subtotale;
|
||||
|
||||
$subtotale = -$sconto[0]['sconto_globale'];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user