mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 17:07:01 +01:00
Fix stampa fatturato
This commit is contained in:
parent
ffeca4f223
commit
ab36baaabe
@ -57,11 +57,11 @@ $totale_finale = 0;
|
||||
|
||||
// Nel fatturato totale è corretto NON tenere in considerazione eventuali rivalse, ritenute acconto o contributi.
|
||||
foreach ($raggruppamenti as $raggruppamento) {
|
||||
$data = new \Carbon\Carbon($raggruppamento['data']);
|
||||
$data = new \Carbon\Carbon($raggruppamento['data_competenza']);
|
||||
$mese = ucfirst($data->formatLocalized('%B %Y'));
|
||||
|
||||
$imponibile = $raggruppamento['imponibile'];
|
||||
$iva = $raggruppamento['iva'];
|
||||
$imponibile = SUM($raggruppamento['imponibile'], null, 2);
|
||||
$iva = SUM($raggruppamento['iva'], null, 2);
|
||||
$totale = $imponibile + $iva;
|
||||
|
||||
echo '
|
||||
|
@ -27,9 +27,9 @@ $date_end = $_SESSION['period_end'];
|
||||
|
||||
$raggruppamenti = $dbo->fetchArray('
|
||||
SELECT
|
||||
data,
|
||||
data_competenza,
|
||||
DATE_FORMAT(data_competenza, \'%m-%Y\') AS periodo,
|
||||
SUM(round((subtotale-sconto+co_righe_documenti.rivalsainps) *percentuale/100 *(100-indetraibile)/100 *(IF(co_tipidocumento.reversed = 0, 1,-1 )), 2)) AS iva,
|
||||
SUM((subtotale-sconto+co_righe_documenti.rivalsainps) *percentuale/100 *(100-indetraibile)/100 *(IF(co_tipidocumento.reversed = 0, 1,-1 ))) AS iva,
|
||||
SUM((co_righe_documenti.subtotale - co_righe_documenti.sconto + co_righe_documenti.rivalsainps) *(IF(co_tipidocumento.reversed = 0,1,-1))) AS imponibile
|
||||
FROM
|
||||
co_iva
|
||||
@ -39,6 +39,6 @@ $raggruppamenti = $dbo->fetchArray('
|
||||
WHERE
|
||||
co_tipidocumento.dir = '.prepare($dir).' AND co_righe_documenti.is_descrizione = 0 AND idstatodocumento NOT IN(SELECT id FROM co_statidocumento WHERE descrizione = "Bozza" OR descrizione = "Annullata") AND co_documenti.data_competenza >= '.prepare($date_start).' AND co_documenti.data_competenza <= '.prepare($date_end).'
|
||||
GROUP BY
|
||||
data, periodo
|
||||
periodo
|
||||
ORDER BY
|
||||
data ASC');
|
||||
periodo ASC');
|
||||
|
Loading…
x
Reference in New Issue
Block a user