This commit is contained in:
MatteoPistorello 2021-11-15 11:19:56 +01:00
commit 4e3da9a1ca
3 changed files with 4 additions and 6 deletions

View File

@ -27,9 +27,7 @@ switch (filter('op')) {
$id_record = $combinazione->id;
// Selezione attributi per la combinazione
if ($combinazione->articoli()->count() == 0) {
$combinazione->attributi()->sync((array) post('attributi'));
}
$combinazione->attributi()->sync((array) post('attributi'));
flash()->info(tr('Combinazione aggiornata correttamente!'));
} else {

View File

@ -38,7 +38,7 @@ echo '
<div class="row">
<div class="col-md-12">
{[ "type": "select", "label": "'.tr('Attributi').'", "name": "attributi[]", "value": "'.implode(',', $combinazione->attributi->pluck('id')->all()).'", "values": "query=SELECT id, nome AS descrizione FROM mg_attributi WHERE deleted_at IS NULL", "required": 1, "multiple": 1, "help": "'.tr('Attributi abilitati per la combinazione corrente').'", "disabled": "'.($numero_varianti !== 0).'" ]}
{[ "type": "select", "label": "'.tr('Attributi').'", "name": "attributi[]", "value": "'.implode(',', $combinazione->attributi->pluck('id')->all()).'", "values": "query=SELECT id, nome AS descrizione FROM mg_attributi WHERE deleted_at IS NULL", "required": 1, "multiple": 1, "help": "'.tr('Attributi abilitati per la combinazione corrente').'" ]}
</div>
</div>
</div>

View File

@ -16,8 +16,8 @@ INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`,
UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM `co_iva` WHERE 1=1 AND deleted_at IS NULL HAVING 2=2' WHERE `name` = 'IVA';
-- Aggiunta colonna Codice in Combinazioni
INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default`, `created_at`, `updated_at`) VALUES
(442, 94, 'Codice', 'mg_combinazioni.codice', 1, 1, 0, 0, '', '', 1, 0, 0, '2021-11-08 10:17:47', '2021-11-08 10:18:07');
INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default`) VALUES
(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Combinazioni'), 'Codice', 'mg_combinazioni.codice', 1, 1, 0, 0, '', '', 1, 0, 0);
-- Aggiunta impostazione per impostare o meno il riferimento del documento
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Aggiungi riferimento tra documenti', '1', 'boolean', '1', 'Generali', '18', 'Permette l\'aggiunta del riferimento al documento nella descrizione della riga importata');