diff --git a/modules/contratti/row-add.php b/modules/contratti/row-add.php index ca30eb2bd..b426a3776 100755 --- a/modules/contratti/row-add.php +++ b/modules/contratti/row-add.php @@ -18,7 +18,7 @@ $options = [ 'articoli' => [ 'idanagrafica' => $documento->idanagrafica, 'dir' => $documento->direzione, - 'permetti_movimento_a_zero' => true, + 'permetti_movimento_a_zero' => 1, ], ], ]; diff --git a/modules/contratti/row-edit.php b/modules/contratti/row-edit.php index a8f7be628..adb148b77 100755 --- a/modules/contratti/row-edit.php +++ b/modules/contratti/row-edit.php @@ -18,7 +18,7 @@ $options = [ 'articoli' => [ 'idanagrafica' => $documento->idanagrafica, 'dir' => $documento->direzione, - 'permetti_movimento_a_zero' => true, + 'permetti_movimento_a_zero' => 1, ], ], ]; diff --git a/modules/ddt/row-add.php b/modules/ddt/row-add.php index 77bef634b..21f332ad8 100755 --- a/modules/ddt/row-add.php +++ b/modules/ddt/row-add.php @@ -21,7 +21,7 @@ $options = [ 'dir' => $documento->direzione, 'idsede_partenza' => $documento->idsede_partenza, 'idsede_destinazione' => $documento->idsede_destinazione, - 'permetti_movimento_a_zero' => $documento->direzione == 'uscita', + 'permetti_movimento_a_zero' => intval($documento->direzione == 'uscita'), ], ], ]; diff --git a/modules/ddt/row-edit.php b/modules/ddt/row-edit.php index fe38539ac..9e081123f 100755 --- a/modules/ddt/row-edit.php +++ b/modules/ddt/row-edit.php @@ -20,8 +20,8 @@ $options = [ 'dir' => $documento->direzione, 'idsede_partenza' => $documento->idsede_partenza, 'idsede_destinazione' => $documento->idsede_destinazione, - 'permetti_movimento_a_zero' => $documento->direzione == 'uscita', - ], + 'permetti_movimento_a_zero' => intval($documento->direzione == 'uscita'), +], ], ]; diff --git a/modules/fatture/row-add.php b/modules/fatture/row-add.php index 310d6e643..ddc111348 100755 --- a/modules/fatture/row-add.php +++ b/modules/fatture/row-add.php @@ -22,7 +22,7 @@ $options = [ 'dir' => $documento->direzione, 'idsede_partenza' => $documento->idsede_partenza, 'idsede_destinazione' => $documento->idsede_destinazione, - 'permetti_movimento_a_zero' => $documento->direzione == 'uscita', + 'permetti_movimento_a_zero' => intval($documento->direzione == 'uscita'), ], 'iva' => [ 'split_payment' => $documento['split_payment'], diff --git a/modules/fatture/row-edit.php b/modules/fatture/row-edit.php index 6730c0e29..23b4662d5 100755 --- a/modules/fatture/row-edit.php +++ b/modules/fatture/row-edit.php @@ -21,7 +21,7 @@ $options = [ 'dir' => $documento->direzione, 'idsede_partenza' => $documento->idsede_partenza, 'idsede_destinazione' => $documento->idsede_destinazione, - 'permetti_movimento_a_zero' => $documento->direzione == 'uscita', + 'permetti_movimento_a_zero' => intval($documento->direzione == 'uscita'), ], 'iva' => [ 'split_payment' => $documento['split_payment'], diff --git a/modules/interventi/add.php b/modules/interventi/add.php index 1aae109ad..e31ace7fd 100755 --- a/modules/interventi/add.php +++ b/modules/interventi/add.php @@ -209,7 +209,7 @@ echo '
- {[ "type": "select", "label": "'.tr('Impianto').'", "multiple": 1, "name": "idimpianti[]", "value": "'.$impianti_collegati.'", "ajax-source": "impianti-cliente", "select-options": {"idanagrafica": '.$id_anagrafica.'}, "icon-after": "add|'.Modules::get('Impianti')['id'].'|id_anagrafica='.$id_anagrafica.'" ]} + {[ "type": "select", "label": "'.tr('Impianto').'", "multiple": 1, "name": "idimpianti[]", "value": "'.$impianti_collegati.'", "ajax-source": "impianti-cliente", "select-options": {"idanagrafica": '.($id_anagrafica ?: '""').'}, "icon-after": "add|'.Modules::get('Impianti')['id'].'|id_anagrafica='.$id_anagrafica.'" ]}
diff --git a/modules/interventi/row-add.php b/modules/interventi/row-add.php index da40da1d4..089ba8a63 100755 --- a/modules/interventi/row-add.php +++ b/modules/interventi/row-add.php @@ -21,7 +21,7 @@ $options = [ 'dir' => $documento->direzione, 'idsede_partenza' => $documento->idsede_partenza, 'idsede_destinazione' => $documento->idsede_destinazione, - 'permetti_movimento_a_zero' => $documento->direzione == 'uscita', + 'permetti_movimento_a_zero' => 0, ], 'impianti' => [ 'idintervento' => $documento->id, diff --git a/modules/interventi/row-edit.php b/modules/interventi/row-edit.php index c43bbd23d..6b979c7c1 100755 --- a/modules/interventi/row-edit.php +++ b/modules/interventi/row-edit.php @@ -21,7 +21,7 @@ $options = [ 'dir' => $documento->direzione, 'idsede_partenza' => $documento->idsede_partenza, 'idsede_destinazione' => $documento->idsede_destinazione, - 'permetti_movimento_a_zero' => $documento->direzione == 'uscita', + 'permetti_movimento_a_zero' => 0, ], 'impianti' => [ 'idintervento' => $documento->id, diff --git a/modules/iva/ajax/select.php b/modules/iva/ajax/select.php index 82b8cd8e8..7ad8a533e 100755 --- a/modules/iva/ajax/select.php +++ b/modules/iva/ajax/select.php @@ -13,6 +13,7 @@ switch ($resource) { foreach ($elements as $element) { $filter[] = 'id='.prepare($element); } + if (!empty($search)) { $search_fields[] = 'descrizione LIKE '.prepare('%'.$search.'%'); $search_fields[] = 'codice LIKE '.prepare('%'.$search.'%'); @@ -23,7 +24,7 @@ switch ($resource) { //se sto valorizzando un documento con lo split payment impedisco la selezione delle aliquote iva con natura N6 (reverse charge) if (isset($superselect['split_payment']) and !empty($superselect['split_payment'])) { - $where[] = '(codice_natura_fe IS NULL OR codice_natura_fe != "N6")'; + $where[] = '(codice_natura_fe IS NULL OR codice_natura_fe NOT LIKE "N6%")'; } } diff --git a/modules/ordini/row-add.php b/modules/ordini/row-add.php index 18e3c72c9..359071dd3 100755 --- a/modules/ordini/row-add.php +++ b/modules/ordini/row-add.php @@ -19,7 +19,7 @@ $options = [ 'articoli' => [ 'idanagrafica' => $documento->idanagrafica, 'dir' => $documento->direzione, - 'permetti_movimento_a_zero' => true, + 'permetti_movimento_a_zero' => 1, ], ], ]; diff --git a/modules/ordini/row-edit.php b/modules/ordini/row-edit.php index 8a9338fab..113a8f6d7 100755 --- a/modules/ordini/row-edit.php +++ b/modules/ordini/row-edit.php @@ -18,7 +18,7 @@ $options = [ 'articoli' => [ 'idanagrafica' => $documento->idanagrafica, 'dir' => $documento->direzione, - 'permetti_movimento_a_zero' => true, + 'permetti_movimento_a_zero' => 1, ], ], ]; diff --git a/modules/preventivi/row-add.php b/modules/preventivi/row-add.php index 13b74d576..5018c203d 100755 --- a/modules/preventivi/row-add.php +++ b/modules/preventivi/row-add.php @@ -18,7 +18,7 @@ $options = [ 'articoli' => [ 'idanagrafica' => $documento->idanagrafica, 'dir' => $documento->direzione, - 'permetti_movimento_a_zero' => true, + 'permetti_movimento_a_zero' => 1, ], ], ]; diff --git a/modules/preventivi/row-edit.php b/modules/preventivi/row-edit.php index 135730e7b..edcbeb682 100755 --- a/modules/preventivi/row-edit.php +++ b/modules/preventivi/row-edit.php @@ -18,7 +18,7 @@ $options = [ 'articoli' => [ 'idanagrafica' => $documento->idanagrafica, 'dir' => $documento->direzione, - 'permetti_movimento_a_zero' => true, + 'permetti_movimento_a_zero' => 1, ], ], ];