Compare commits

..

4 Commits

5 changed files with 51 additions and 13 deletions

View File

@ -26,14 +26,14 @@ echo '
<p>'.tr('Trascina le colonne per ordinare la struttura della tabella principale, seleziona e deseleziona le colonne per renderle visibili o meno').'.</p>
<div class="sortable">';
$fields = $dbo->fetchArray('SELECT * FROM zz_views WHERE id_module='.prepare($id_module).' ORDER BY `order` ASC');
$fields = $dbo->fetchArray('SELECT *, (SELECT GROUP_CONCAT(zz_groups.nome) FROM zz_group_view INNER JOIN zz_groups ON zz_group_view.id_gruppo = zz_groups.id WHERE zz_group_view.id_vista = zz_views.id) AS gruppi_con_accesso FROM zz_views WHERE id_module='.prepare($id_module).' ORDER BY `order` ASC');
foreach ($fields as $field) {
echo '
<div class="panel panel-default clickable col-md-4" data-id="'.$field['id'].'">
<div class="panel-body">
<input type="checkbox" name="visibile" '.($field['visible'] ? 'checked' : '').'>
<span class="text-'.($field['visible'] ? 'success' : 'danger').'">'.$field['name'].'</span>
<span class="text-'.($field['visible'] ? 'success' : 'danger').'">'.$field['name'].'<br><small>( '.$field['gruppi_con_accesso'].')</small></span>
<i class="fa fa-sort pull-right"></i>
</div>

View File

@ -244,7 +244,7 @@ switch ($resource) {
*/
case 'sedi':
if (isset($superselect['idanagrafica'])) {
$query = "SELECT * FROM (SELECT '0' AS id, (SELECT idzona FROM an_anagrafiche |where|) AS idzona, CONCAT_WS(' - ', 'Sede legale' , (SELECT CONCAT (citta, ' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, idzona, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab HAVING descrizione LIKE ".prepare('%'.$search.'%').' ORDER BY descrizione';
$query = "SELECT * FROM (SELECT '0' AS id, (SELECT idzona FROM an_anagrafiche |where|) AS idzona, CONCAT_WS(' - ', \"".tr('Sede legale')."\" , (SELECT CONCAT (citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), ''), ' (',ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, idzona, CONCAT_WS(' - ', nomesede, CONCAT(citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), '')) ) FROM an_sedi |where|) AS tab HAVING descrizione LIKE ".prepare('%'.$search.'%').' ORDER BY descrizione';
foreach ($elements as $element) {
$filter[] = 'id='.prepare($element);
@ -264,7 +264,7 @@ switch ($resource) {
$user = Auth::user();
$id_azienda = setting('Azienda predefinita');
$query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', 'Sede legale' , (SELECT CONCAT (citta, ' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione";
$query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', \"".tr('Sede legale')."\" , (SELECT CONCAT (citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), ''),' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, CONCAT(citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), '')) ) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione";
foreach ($elements as $element) {
$filter[] = 'id='.prepare($element);

View File

@ -225,7 +225,7 @@ echo '
</div>
</div>';
$sedi = $dbo->fetchArray('(SELECT "0" AS id, CONCAT_WS (" - ", "Sede legale", citta) AS nomesede FROM an_anagrafiche WHERE idanagrafica = '.prepare(setting('Azienda predefinita')).') UNION (SELECT id, CONCAT_WS(" - ", nomesede, citta ) AS nomesede FROM an_sedi WHERE idanagrafica='.prepare(setting('Azienda predefinita')).')');
$sedi = $dbo->fetchArray('(SELECT "0" AS id, IF(indirizzo!=\'\', CONCAT_WS(" - ", "'.tr('Sede legale').'", CONCAT(citta, \' (\', indirizzo, \')\')), CONCAT_WS(" - ", "'.tr('Sede legale').'", citta)) AS nomesede FROM an_anagrafiche WHERE idanagrafica = '.prepare(setting('Azienda predefinita')).') UNION (SELECT id, IF(indirizzo!=\'\',CONCAT_WS(" - ", nomesede, CONCAT(citta, \' (\', indirizzo, \')\')), CONCAT_WS(" - ", nomesede, citta )) AS nomesede FROM an_sedi WHERE idanagrafica='.prepare(setting('Azienda predefinita')).')');
$giacenze = $articolo->getGiacenze();
echo '

View File

@ -441,6 +441,14 @@ switch (post('op')) {
$qta = post('qta_da_evadere')[$riga->id];
$copia = $riga->copiaIn($intervento, $qta);
// Aggiornamento seriali
if ($copia->isArticolo()) {
$serials = is_array(post('serial')[$riga->id]) ? post('serial')[$riga->id] : [];
$copia->serials = $serials;
}
$copia->save();
}
}

View File

@ -22,7 +22,17 @@ include_once __DIR__.'/../../core.php';
// Imposto come azienda l'azienda predefinita per selezionare le sedi a cui ho accesso
// select-options
if (setting('Attiva scorciatoie da tastiera')) {
echo '<div class="alert alert-info">
<i class="fa fa-info-circle"></i> '.tr('Scorciatoie da tastiera: <b>F7</b> - Barcode, <b>F8</b> - Carico, <b>F9</b> - Sarico, <b>F10</b> - Spostamento').'
</div>';
}
?>
<form action="" method="post" id="add-form">
<input type="hidden" name="op" value="add">
<input type="hidden" name="backto" value="record-edit">
@ -87,8 +97,8 @@ echo '
<div id="messages"></div>
<div class="alert alert-info hidden" id="articolo-missing">
<i class="fa fa-exclamation-circle"></i> '.tr('Nessuna corrispondenza trovata!').'
<div class="alert alert-warning hidden" id="articolo-missing">
<h3><i class="fa fa-warning"></i> '.tr('Nessuna corrispondenza trovata!').'</h3>
</div>
<script>
@ -110,8 +120,11 @@ echo '
let key = window.event ? event.keyCode : event.which; // IE vs Netscape/Firefox/Opera
$("#articolo-missing").addClass("hidden");
let barcode = $("#barcode");
if (key === 13) {
if ( barcode.val() == "" && $("#idarticolo").val() == null && key === 13 ){
swal("'.tr('Inserisci barcode o seleziona un articolo').'", "", "warning");
}
else if (key === 13) {
let search = barcode.val().replace(/[^a-z0-9\s\-\.\/\\|]+/gmi, "");
ricercaBarcode(search);
} else if (key === 8) {
@ -180,6 +193,8 @@ echo '
else {
$("#messages").remove();
$("#articolo-missing").removeClass("hidden");
input("barcode").set("");
$("#barcode").focus();
}
}
);
@ -248,6 +263,14 @@ echo '
}
function EnableHotkeys(){
//Anable hotkeys in blocked input elements
hotkeys.filter = function(event){
var tagName = (event.target || event.srcElement).tagName;
hotkeys.setScope(/^(INPUT|TEXTAREA|SELECT)$/.test(tagName) ? "input" : "other");
return true;
}
hotkeys("f7,f8,f9,f10", function(event, handler) {
switch (handler.key) {
case "f7":
@ -277,9 +300,9 @@ echo '
<div class="hidden" id="info-articolo">
<div class="row">
<div class="col-md-6">
<div class="alert alert-info text-center">
<div class="alert alert-info text-left">
<h3>
|codice|
<b>'.tr('Codice').':</b> |codice|
</h3>
<p><b>'.tr('Descrizione').':</b> |descrizione|</p>
<p><b>'.tr('Prezzo acquisto').':</b> |prezzo_acquisto| '.currency().'</p>
@ -288,12 +311,19 @@ echo '
</div>
</div>
<div class="col-md-6">
<div class="alert |alert-type| text-center">
<div class="alert |alert-type| text-center" style="margin-bottom:6px;" >
<h3>
<i class="fa |icon|"></i> |descrizione-movimento| |movimento| |misura|
<i class="fa fa-arrow-circle-right"></i> |rimanente| |misura| rimanenti
</h3>
</div>
<div class="alert alert-info text-center">
<h3>
<i class="fa fa-cubes"></i> |rimanente| |misura| rimanenti
</h3>
</div>
</div>
</div>
</div>';