Dimensione dei file caricati

Quantità a magazzino su select articoli
This commit is contained in:
Luca 2019-03-19 19:23:07 +01:00
parent 4f11ff8a23
commit 36870e6e5e
5 changed files with 26 additions and 14 deletions

View File

@ -8,6 +8,7 @@ switch ($resource) {
mg_articoli.id, mg_articoli.id,
mg_articoli.codice, mg_articoli.codice,
mg_articoli.descrizione, mg_articoli.descrizione,
round(mg_articoli.qta,'.setting('Cifre decimali per quantità').') AS qta,
mg_articoli.um, mg_articoli.um,
mg_articoli.idiva_vendita, mg_articoli.idiva_vendita,
mg_articoli.idconto_vendita, mg_articoli.idconto_vendita,
@ -47,6 +48,7 @@ switch ($resource) {
'id' => 'id', 'id' => 'id',
'codice' => 'codice', 'codice' => 'codice',
'descrizione' => 'descrizione', 'descrizione' => 'descrizione',
'qta' => 'qta',
'um' => 'um', 'um' => 'um',
'categoria' => 'categoria', 'categoria' => 'categoria',
'sottocategoria' => 'sottocategoria', 'sottocategoria' => 'sottocategoria',
@ -120,9 +122,10 @@ switch ($resource) {
$results[count($results) - 1]['children'][] = [ $results[count($results) - 1]['children'][] = [
'id' => $r['id'], 'id' => $r['id'],
'text' => $r['codice'].' - '.$r['descrizione'], 'text' => $r['codice'].' - '.$r['descrizione'].' ('.Translator::numberToLocale($r['qta']).(!empty($r['um']) ? ' '.$r['um']: '').')',
'codice' => $r['codice'], 'codice' => $r['codice'],
'descrizione' => $r['descrizione'], 'descrizione' => $r['descrizione'],
'qta' => $r['qta'],
'um' => $r['um'], 'um' => $r['um'],
'idiva_vendita' => $idiva, 'idiva_vendita' => $idiva,
'iva_vendita' => $iva, 'iva_vendita' => $iva,

View File

@ -273,7 +273,7 @@ if (!empty($id_intervento)) {
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
{[ "type": "select", "label": "<?php echo tr('Tecnici'); ?>", "multiple": "1", "name": "idtecnico[]", "required": <?php echo get('ref') ? 1 : 0; ?>, "ajax-source": "tecnici", "value": "<?php echo $idtecnico; ?>" ]} {[ "type": "select", "label": "<?php echo tr('Tecnici'); ?>", "multiple": "1", "name": "idtecnico[]", "required": <?php echo get('ref') ? 1 : 0; ?>, "ajax-source": "tecnici", "value": "<?php echo $idtecnico; ?>", "icon-after": "add|<?php echo Modules::get('Anagrafiche')['id']; ?>|tipoanagrafica=Tecnico||<?php echo (empty($idtecnico)) ? '' : 'disabled'; ?>" ]}
</div> </div>
</div> </div>
</div> </div>

View File

@ -67,13 +67,16 @@ class FileManager implements ManagerInterface
</button> </button>
</div> </div>
</div> </div>
<div class="box-body no-padding"> <div class="box-body no-padding table-responsive">
<table class="table"> <table class="table table-striped table-condensed ">
<thead>
<tr> <tr>
<th>'.tr('Nome').'</th> <th scope="col" >'.tr('Nome').'</th>
<th>'.tr('Data').'</th> <th scope="col" width="15%" >'.tr('Data').'</th>
<th width="15%" class="text-center">'.tr('Opzioni').'</th> <th scope="col" width="15%" class="text-right"></th>
</tr>'; </tr>
</thead>
<tbody>';
foreach ($rs as $r) { foreach ($rs as $r) {
$file = Upload::find($r['id']); $file = Upload::find($r['id']);
@ -83,10 +86,10 @@ class FileManager implements ManagerInterface
<td align="left"> <td align="left">
<a href="'.ROOTDIR.'/view.php?file_id='.$r['id'].'" target="_blank"> <a href="'.ROOTDIR.'/view.php?file_id='.$r['id'].'" target="_blank">
<i class="fa fa-external-link"></i> '.$r['name'].' <i class="fa fa-external-link"></i> '.$r['name'].'
</a> ('.$file->extension.')'.' </a><small> ('.$file->extension.')'.((!empty($file->size)) ? ' ('.\Util\FileSystem::formatBytes($file->size).')':'').'</small>'.'
</td> </td>
<td>'.\Translator::timestampToLocale($r['created_at']).'</td> <td>'.\Translator::timestampToLocale($r['created_at']).'</td>
<td class="text-center"> <td class="text-right">
<a class="btn btn-xs btn-primary" href="'.ROOTDIR.'/actions.php?id_module='.$options['id_module'].'&op=download_file&id='.$r['id'].'&filename='.$r['filename'].'" target="_blank"> <a class="btn btn-xs btn-primary" href="'.ROOTDIR.'/actions.php?id_module='.$options['id_module'].'&op=download_file&id='.$r['id'].'&filename='.$r['filename'].'" target="_blank">
<i class="fa fa-download"></i> <i class="fa fa-download"></i>
</a>'; </a>';
@ -119,6 +122,7 @@ class FileManager implements ManagerInterface
} }
$result .= ' $result .= '
</tbody>
</table> </table>
</div> </div>
</div> </div>

View File

@ -215,6 +215,7 @@ class Uploads
// Registrazione del file // Registrazione del file
$data['filename'] = $filename; $data['filename'] = $filename;
$data['original'] = $original; $data['original'] = $original;
$data['size'] = $source['size'];
self::register($data); self::register($data);
// Operazioni finali // Operazioni finali
@ -240,6 +241,7 @@ class Uploads
'id_module' => !empty($data['id_module']) && empty($data['id_plugin']) ? $data['id_module'] : null, 'id_module' => !empty($data['id_module']) && empty($data['id_plugin']) ? $data['id_module'] : null,
'id_plugin' => !empty($data['id_plugin']) ? $data['id_plugin'] : null, 'id_plugin' => !empty($data['id_plugin']) ? $data['id_plugin'] : null,
'id_record' => $data['id_record'], 'id_record' => $data['id_record'],
'size' => $data['size'],
]); ]);
} }

View File

@ -18,3 +18,6 @@ UPDATE `zz_settings` SET `valore` = '2' WHERE `zz_settings`.`nome` = 'Importo ma
-- Stampa preventivo (senza totali) -- Stampa preventivo (senza totali)
INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES
(NULL, (SELECT id FROM zz_modules WHERE name='Preventivi'), 1, 'Preventivo (senza totali)', 'Preventivo (senza totali)', 'preventivi', 'idpreventivo', '{"pricing":true, "hide_total":true}', 'fa fa-print', '', '', 0, 0, 1, 1); (NULL, (SELECT id FROM zz_modules WHERE name='Preventivi'), 1, 'Preventivo (senza totali)', 'Preventivo (senza totali)', 'preventivi', 'idpreventivo', '{"pricing":true, "hide_total":true}', 'fa fa-print', '', '', 0, 0, 1, 1);
-- Dimensione dei file caricati
ALTER TABLE `zz_files` ADD `size` INT(11) NULL AFTER `category`;