Fix minori

This commit is contained in:
Luca 2020-02-01 11:40:23 +01:00
parent 45da8a4976
commit 528d881e16
3 changed files with 21 additions and 7 deletions

View File

@ -39,18 +39,18 @@ if (!empty($search['descrizione'])) {
}
if (!empty($search['categoria'])) {
$where[] = 'id_categoria IN (SELECT id FROM mg_categorie WHERE descrizione LIKE '.prepare('%'.$search['categoria'].'%').')';
$where[] = 'id_categoria IN (SELECT id FROM mg_categorie WHERE nome LIKE '.prepare('%'.$search['categoria'].'%').' AND parent IS NULL)';
}
if (!empty($search['subcategoria'])) {
$where[] = 'id_sottocategoria IN (SELECT id FROM mg_categorie WHERE descrizione LIKE '.prepare('%'.$search['subcategoria'].'%').')';
$where[] = 'id_sottocategoria IN (SELECT id FROM mg_categorie WHERE nome LIKE '.prepare('%'.$search['subcategoria'].'%').' AND parent NOT NULL)';
}
$period_end = $_SESSION['period_end'];
$query = 'SELECT *,
(SELECT SUM(qta) FROM mg_movimenti WHERE mg_movimenti.idarticolo=mg_articoli.id AND (mg_movimenti.idintervento IS NULL) AND data <= '.prepare($period_end).') AS qta
FROM mg_articoli WHERE 1=1
FROM mg_articoli LEFT OUTER JOIN (SELECT id, nome FROM mg_categorie) AS categoria ON mg_articoli.id_categoria = categoria.id WHERE 1=1
ORDER BY codice ASC';
$query = str_replace('1=1', '1=1'.(!empty($where) ? ' AND '.implode(' AND ', $where) : ''), $query);
@ -65,6 +65,7 @@ echo '
<thead>
<tr>
<th class="text-center" width="150">'.tr('Codice', [], ['upper' => true]).'</th>
<th class="text-center">'.tr('Categoria', [], ['upper' => true]).'</th>
<th class="text-center">'.tr('Descrizione', [], ['upper' => true]).'</th>
<th class="text-center" width="70">'.tr('Prezzo di vendita', [], ['upper' => true]).'</th>
<th class="text-center" width="70">'.tr('Q.', [], ['upper' => true]).'</th>
@ -82,6 +83,7 @@ foreach ($rs as $r) {
echo '
<tr>
<td>'.$r['codice'].'</td>
<td>'.$r['nome'].'</td>
<td>'.$r['descrizione'].'</td>
<td class="text-right">'.moneyFormat($r['prezzo_vendita']).'</td>
<td class="text-right">'.Translator::numberToLocale($r['qta']).' '.$r['um'].'</td>

View File

@ -1,6 +1,6 @@
<?php
return [
//'orientation' => 'L',
'orientation' => 'L',
'font-size' => '11pt',
];

View File

@ -19,13 +19,25 @@ $pricing = isset($pricing) ? $pricing : true;
// Informazioni intervento
echo '
<tr>
<td colspan="2">
<td colspan="2">';
if (dateFormat($intervento->inizio)){
echo '
<p>'.tr('Intervento _NUM_ del _DATE_', [
'_NUM_' => $intervento->codice,
'_DATE_' => dateFormat($intervento->inizio),
]).'</p>
]).'</p>';
}else{
echo '
<p>'.tr('Promemoria _NUM_', [
'_NUM_' => $intervento->codice,
]).'</p>';
}
echo '
<p><small><b>'.tr('Cliente').':</b> '.$intervento->anagrafica->ragione_sociale.'</small></p>
<p><small><b>'.tr('Stato').':</b> '.$intervento->stato->descrizione.'</small></p>
<p><small><b>'.tr('Data richiesta').':</b> '.dateFormat($intervento->data_richiesta).'</small></p>
<p><small><b>'.tr('Richiesta').':</b> '.$intervento->richiesta.'</small></p>
</td>
<td class="text-center">'.($pricing ? moneyFormat($imponibile, 2) : '-').'</td>
<td class="text-center">'.($pricing && empty($options['dir']) ? moneyFormat($sconto, 2) : '-').'</td>
@ -34,7 +46,7 @@ echo '
// Sessioni
$sessioni = $intervento->sessioni;
if (!empty($sessioni)) {
if (count($sessioni)>0) {
echo '
<tr>
<td style="border-top: 0; border-bottom: 0;"></td>