Rimossa stampa ex spesometro

This commit is contained in:
Pek5892 2023-05-17 10:50:50 +02:00
parent be1e934804
commit 01f1e20ac8
6 changed files with 70 additions and 300 deletions

View File

@ -26,86 +26,85 @@ echo '
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-6 text-center">
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">'.tr('Registri IVA').'</h3> <h3 class="panel-title">'.tr('Registri IVA').'</h3>
<br>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<button type="button" class="btn btn-primary col-md-3" data-toggle="modal" data-title="'.tr('Stampa registro IVA vendite').'" data-href="'.base_path().'/modules/stampe_contabili/stampe_contabili.php?dir=entrata&nome_stampa=Registro IVA&id_record='.$id_record.'" ><i class="fa fa-print fa-2x"></i><br>'.tr('Registro').'<br>'.tr('IVA vendite').'</button> <div class="col-md-4">
<button type="button" class="btn btn-primary col-md-12" data-toggle="modal" data-title="'.tr('Stampa registro IVA vendite').'" data-href="'.base_path().'/modules/stampe_contabili/stampe_contabili.php?dir=entrata&nome_stampa=Registro IVA&id_record='.$id_record.'" ><i class="fa fa-print fa-2x"></i><br>'.tr('Registro').'<br>'.tr('IVA vendite').'</button>
<button type="button" class="btn btn-primary col-md-3 col-md-push-1" data-toggle="modal" data-title="'.tr('Stampa registro IVA acquisti').'" data-href="'.base_path().'/modules/stampe_contabili/stampe_contabili.php?dir=uscita&nome_stampa=Registro IVA&id_record='.$id_record.'" ><i class="fa fa-print fa-2x"></i><br>'.tr('Registro').'<br>'.tr('IVA acquisti').'</button> </div>
<div class="col-md-4">
<button type="button" class="btn btn-primary col-md-4 col-md-push-2" data-toggle="modal" data-title="'.tr('Stampa liquidazione IVA').'" data-href="'.base_path().'/modules/stampe_contabili/stampe_contabili.php?nome_stampa=Liquidazione IVA&id_record='.$id_record.'" ><i class="fa fa-print fa-2x"></i><br>'.tr('Liquidazione').'<br>'.tr('IVA').'</button> <button type="button" class="btn btn-primary col-md-12" data-toggle="modal" data-title="'.tr('Stampa registro IVA acquisti').'" data-href="'.base_path().'/modules/stampe_contabili/stampe_contabili.php?dir=uscita&nome_stampa=Registro IVA&id_record='.$id_record.'" ><i class="fa fa-print fa-2x"></i><br>'.tr('Registro').'<br>'.tr('IVA acquisti').'</button>
</div>
<div class="col-md-4">
<button type="button" class="btn btn-primary col-md-12" data-toggle="modal" data-title="'.tr('Stampa liquidazione IVA').'" data-href="'.base_path().'/modules/stampe_contabili/stampe_contabili.php?nome_stampa=Liquidazione IVA&id_record='.$id_record.'" ><i class="fa fa-print fa-2x"></i><br>'.tr('Liquidazione').'<br>'.tr('IVA').'</button>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">'.tr('Comunicazione dati fatture (ex-spesometro)<br> dal _START_ al _END_', [
'_START_' => Translator::dateToLocale($_SESSION['period_start']),
'_END_' => Translator::dateToLocale($_SESSION['period_end']),
]).'</h3>
</div>
<div class="panel-body">
'.Prints::getLink('Spesometro', $id_record, 'btn-primary col-md-5', '<br>'.tr('Dati fatture').'<br>'.tr(' vendite e acquisti'), '|default| fa-2x', 'dir=uscita').'
</div>
</div>
</div>
<div class="col-md-4"> <div class="col-md-6 text-center">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">'.tr('Dati economici<br> dal _START_ al _END_', [
'_START_' => Translator::dateToLocale($_SESSION['period_start']),
'_END_' => Translator::dateToLocale($_SESSION['period_end']),
]).'</h3>
</div>
<div class="panel-body">
'.Prints::getLink('Fatturato', $id_record, 'btn-primary col-md-5', '<br>'.tr('Stampa').'<br>'.tr('Fatturato'), '|default| fa-2x', 'dir=entrata').'
'.Prints::getLink('Fatturato', $id_record, 'btn-primary col-md-5 col-md-push-2', '<br>'.tr('Stampa').'<br>'.tr('Acquisti').'<br>', '|default| fa-2x', 'dir=uscita').'
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">'.tr('Contabilità').'</h3> <h3 class="panel-title">'.tr('Contabilità').'</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<button type="button" class="btn btn-primary col-md-3" data-toggle="modal" data-title="'.tr('Stampa Bilancio').'" data-href="'.base_path().'/modules/stampe_contabili/stampa_bilancio.php" ><i class="fa fa-print fa-2x"></i> <br>'.tr('Stampa').'<br>'.tr('Bilancio').'<br></button> <div class="col-md-4">
<button type="button" class="btn btn-primary col-md-12" data-toggle="modal" data-title="'.tr('Stampa Bilancio').'" data-href="'.base_path().'/modules/stampe_contabili/stampa_bilancio.php" ><i class="fa fa-print fa-2x"></i> <br>'.tr('Stampa').'<br>'.tr('Bilancio').'<br></button>
'.Prints::getLink('Mastrino', 1, 'btn-primary col-md-3 col-md-push-1', '<br>'.tr('Situazione').'<br>'.tr('patrimoniale'), '|default| fa-2x', 'lev=1').' </div>
<div class="col-md-4">
'.Prints::getLink('Mastrino', 1, 'btn-primary col-md-12', '<br>'.tr('Situazione').'<br>'.tr('patrimoniale'), '|default| fa-2x', 'lev=1').'
</div>
<div class="col-md-4">
'.Prints::getLink('Mastrino', 2, 'btn-primary col-md-12', '<br>'.tr('Situazione').'<br>'.tr('economica'), '|default| fa-2x', 'lev=1').'
</div>
</div>
</div>
</div>
</div>
'.Prints::getLink('Mastrino', 2, 'btn-primary col-md-3 col-md-push-2', '<br>'.tr('Situazione').'<br>'.tr('economica'), '|default| fa-2x', 'lev=1').' <div class="row">
<div class="col-md-4 text-center">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">'.tr('Dati economici dal _START_ al _END_', [
'_START_' => Translator::dateToLocale($_SESSION['period_start']),
'_END_' => Translator::dateToLocale($_SESSION['period_end']),
]).'</h3>
</div>
<div class="panel-body">
<div class="col-md-6">
'.Prints::getLink('Fatturato', $id_record, 'btn-primary col-md-12', '<br>'.tr('Stampa').'<br>'.tr('Fatturato'), '|default| fa-2x', 'dir=entrata').'
</div>
<div class="col-md-6">
'.Prints::getLink('Fatturato', $id_record, 'btn-primary col-md-12', '<br>'.tr('Stampa').'<br>'.tr('Acquisti').'<br>', '|default| fa-2x', 'dir=uscita').'
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4 text-center">
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">'.tr('Libro giornale').'</h3> <h3 class="panel-title">'.tr('Libro giornale').'</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
'.Prints::getLink('Libro giornale', 2, 'btn-primary col-md-4', '<br>'.tr('Libro').'<br>'.tr('giornale'), '|default| fa-2x').' <div class="col-md-6">
'.Prints::getLink('Libro giornale', 2, 'btn-primary col-md-12', '<br>'.tr('Libro').'<br>'.tr('giornale'), '|default| fa-2x').'
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4 text-center">
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">'.tr('Scadenzario').'</h3> <h3 class="panel-title">'.tr('Scadenzario').'</h3>
@ -121,9 +120,12 @@ if (empty($dbo->fetchArray('SELECT * FROM co_scadenziario'))) {
$disabled = ''; $disabled = '';
} }
echo ' <button type="button" '.$disabled.' class="btn btn-'.$class.' col-md-5" data-toggle="modal" data-title="'.tr('Stampa scadenzario').'" data-href="'.base_path().'/modules/stampe_contabili/stampa_scadenzario.php" > echo '
<i class="fa fa-print fa-2x"></i><br>'.tr('Stampa<br>scadenzario').' <div class="col-md-6">
</button>'; <button type="button" '.$disabled.' class="btn btn-'.$class.' col-md-12" data-toggle="modal" data-title="'.tr('Stampa scadenzario').'" data-href="'.base_path().'/modules/stampe_contabili/stampa_scadenzario.php" >
<i class="fa fa-print fa-2x"></i><br>'.tr('Stampa<br>scadenzario').'
</button>
</div>';
echo ' echo '
</div> </div>

View File

@ -1,196 +0,0 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
include_once __DIR__.'/../../core.php';
$date_start = $_SESSION['period_start'];
$date_end = $_SESSION['period_end'];
// Intestazione tabella per righe
echo "
<h3 class='text-bold'>".tr('Spesometro dal _START_ al _END_', [
'_START_' => Translator::dateToLocale($date_start),
'_END_' => Translator::dateToLocale($date_end),
], ['upper' => true])."</h3>
<table class='table table-bordered'>
<thead>
<tr>
<th class='text-center' style='width:10%'>".tr('Ragione sociale', [], ['upper' => true])."</th>
<th class='text-center' style='width:15%'>".tr('P.Iva', [], ['upper' => true])."</th>
<th class='text-center' style='width:25%'>".tr('Documento', [], ['upper' => true])."</th>
<th class='text-center' style='width:20%'>".tr('Aliquota', [], ['upper' => true])."</th>
<th class='text-center' style='width:10%'>".tr('Imponibile', [], ['upper' => true])."</th>
<th class='text-center' style='width:10%'>".tr('IVA', [], ['upper' => true])."</th>
<th class='text-center' style='width:10%'>".tr('Totale', [], ['upper' => true]).'</th>
</tr>
</thead>
<tbody>';
$imponibile = [];
$iva = [];
$totale = [];
$anagrafiche = $dbo->fetchArray('SELECT idanagrafica, piva, ragione_sociale FROM `an_anagrafiche` WHERE `idanagrafica` IN (SELECT DISTINCT `idanagrafica` FROM `co_documenti` WHERE co_documenti.data>='.prepare($date_start).' AND co_documenti.data<='.prepare($date_end).' AND `co_documenti`.`id` IN (SELECT `iddocumento` FROM co_movimenti WHERE primanota = 1)) ORDER BY `ragione_sociale`');
foreach ($anagrafiche as $i => $anagrafica) {
$fatture = $dbo->fetchArray('SELECT `co_documenti`.*, `co_tipidocumento`.`descrizione` AS tipo_documento, `co_tipidocumento`.`dir` FROM `co_documenti` JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` WHERE `co_documenti`.`idanagrafica` = '.prepare($anagrafica['idanagrafica']).' AND `co_documenti`.`id` IN (SELECT `iddocumento` FROM co_movimenti WHERE primanota = 1) AND co_documenti.data>='.prepare($date_start).' AND co_documenti.data<='.prepare($date_end).' ORDER BY `data`');
$num = 0;
foreach ($fatture as $key => $fattura) {
$righe = $dbo->fetchArray('SELECT `idiva`, `desc_iva`, SUM(subtotale) - SUM(sconto) AS imponibile, SUM(iva) AS iva, SUM(subtotale) - SUM(sconto) + SUM(iva) AS totale FROM `co_righe_documenti` WHERE iddocumento='.prepare($fattura['id']).' GROUP BY `idiva`, `desc_iva` ORDER BY `idiva`');
$fatture[$key]['righe'] = $righe;
$num += count($righe);
}
$extra = ($i % 2) != 0 ? ' class="row-bg"' : '';
if ($num > 0) {
echo '
<tr'.$extra.'>
<td rowspan="'.$num.'">
'.$anagrafica['ragione_sociale'].'
</td>';
// Partita IVA
echo '
<td rowspan="'.$num.'">
'.$anagrafica['piva'].'
</td>';
$count = 0;
foreach ($fatture as $fattura) {
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
'_DOC_' => $fattura['tipo_documento'],
'_NUM_' => !empty($fattura['numero_esterno']) ? $fattura['numero_esterno'] : $fattura['numero'],
'_DATE_' => Translator::dateToLocale($fattura['data']),
]);
// Documenti replicati per IVA
foreach ($fattura['righe'] as $riga) {
if ($count != 0) {
echo '
<tr'.$extra.'>';
}
++$count;
// Documento
echo '
<td>
'.$descrizione.'
</td>';
// Descrizione IVA
echo '
<td>
'.$riga['desc_iva'].'
</td>';
// Imponible
echo '
<td class="text-center">
'.moneyFormat($riga['imponibile'], 2).'
</td>';
// IVA
echo '
<td class="text-center">
'.moneyFormat($riga['iva'], 2).'
</td>';
// Totale
echo '
<td class="text-center">
'.moneyFormat($riga['totale'], 2).'
</td>
</tr>';
if (empty($iva[$riga['desc_iva']])) {
$iva[$riga['desc_iva']] = [];
}
$imponibile[] = $riga['imponibile'];
$iva[$riga['desc_iva']][] = $riga['iva'];
$totale[] = $riga['totale'];
}
}
}
}
echo '
</tbody>';
// Totale imponibile
echo '
<tr>
<td colspan="4" class="text-right">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<th colspan="3" class="text-center">
<b>'.moneyFormat(sum($imponibile), 2).'</b>
</th>
</tr>';
foreach ($iva as $desc => $values) {
$sum = sum($values);
// Totale IVA
echo '
<tr>
<td colspan="4" class="text-right">
<b>'.tr('IVA "_TYPE_"', [
'_TYPE_' => $desc,
], ['upper' => true]).':</b>
</td>
<th colspan="3" class="text-center">
<b>'.moneyFormat($sum, 2).'</b>
</th>
</tr>';
$totale_iva += $sum;
}
// Totale IVA
echo '
<tr>
<td colspan="4" class="text-right">
<b>'.tr('Totale IVA', [], ['upper' => true]).':</b>
</td>
<th colspan="3" class="text-center">
<b>'.moneyFormat($totale_iva, 2).'</b>
</th>
</tr>';
// TOTALE
echo '
<tr>
<td colspan="4" class="text-right">
<b>'.tr('Totale', [], ['upper' => true]).':</b>
</td>
<th colspan="3" class="text-center">
<b>'.moneyFormat(sum($totale), 2).'</b>
</th>
</tr>';
echo '
</table>';

View File

@ -1,31 +0,0 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
echo '
<!-- Intestazione fornitore -->
<div class="row">
<div class="col-xs-6">
<p><b>$f_ragionesociale$</b></p>
<p>$f_indirizzo$ $f_citta_full$</p>
<p>'.(!empty($f_piva) ? tr('P.Iva').': ' : '').'$f_piva$</p>
<p>'.(!empty($f_codicefiscale) ? tr('C.F.').': ' : '').'$f_codicefiscale$</p>
<p>'.(!empty($f_capsoc) ? tr('Cap.Soc.').': ' : '').'$f_capsoc$</p>
<p>'.(!empty($f_telefono) ? tr('Tel').': ' : '').'$f_telefono$</p>
</div>
</div>';

View File

@ -1,22 +0,0 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
return [
'orientation' => 'L',
];

14
update/2_4_46.php Normal file
View File

@ -0,0 +1,14 @@
<?php
// File e cartelle deprecate
$files = [
'templates/spesometro',
];
foreach ($files as $key => $value) {
$files[$key] = realpath(base_dir().'/'.$value);
}
delete($files);
?>

View File

@ -19,4 +19,7 @@ WHERE
HAVING HAVING
2=2 2=2
ORDER BY ORDER BY
`scadenza` ASC" WHERE `name` = 'Scadenzario'; `scadenza` ASC" WHERE `name` = 'Scadenzario';
-- Rimozione stampa spesometro
DELETE FROM `zz_prints` WHERE `name` = 'Spesometro';