This commit is contained in:
Beppe 2022-09-01 12:51:33 +02:00
commit 41d30d515b
5 changed files with 52 additions and 3 deletions

View File

@ -247,7 +247,7 @@ switch (post('op')) {
echo json_encode([
'stored' => round($totale_documento,2),
'calculated' => round($fattura->netto,2),
'calculated' => round($fattura->totale,2),
]);
break;

View File

@ -27,7 +27,7 @@ $id_anagrafica = filter('id_anagrafica');
<div class="row">
<div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('Matricola'); ?>", "name": "matricola", "required": 1, "class": "text-center alphanumeric-mask", "maxlength": 25 ]}
{[ "type": "text", "label": "<?php echo tr('Matricola'); ?>", "name": "matricola", "required": 1, "class": "text-center alphanumeric-mask", "maxlength": 25, "validation": "matricola" ]}
</div>
<div class="col-md-8">

View File

@ -48,7 +48,7 @@ if (!empty($record['immagine'])) {
<div class="col-md-9">
<div class="row">
<div class="col-md-6">
{[ "type": "text", "label": "<?php echo tr('Matricola'); ?>", "name": "matricola", "required": 1, "class": "text-center", "maxlength": 25, "value": "$matricola$" ]}
{[ "type": "text", "label": "<?php echo tr('Matricola'); ?>", "name": "matricola", "required": 1, "class": "text-center", "maxlength": 25, "value": "$matricola$", "validation": "matricola" ]}
</div>
<div class="col-md-6">

View File

@ -0,0 +1,42 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
include_once __DIR__.'/../../core.php';
use Modules\Impianti\Impianto;
$name = filter('name');
$value = filter('value');
switch ($name) {
case 'matricola':
$disponibile = Impianto::where([
['matricola', $value],
['id', '<>', $id_record],
])->count() == 0;
$message = $disponibile ? tr('La matricola è disponbile') : tr('La matricola è già utilizzata in un altro impianto');
$response = [
'result' => $disponibile,
'message' => $message,
];
break;
}

7
update/2_4_36.sql Normal file
View File

@ -0,0 +1,7 @@
-- Fix eliminazione attività collegata
ALTER TABLE `in_interventi` DROP FOREIGN KEY `in_interventi_ibfk_3`;
ALTER TABLE `in_interventi` ADD CONSTRAINT `in_interventi_ibfk_3` FOREIGN KEY (`id_preventivo`) REFERENCES `co_preventivi`(`id`) ON DELETE SET NULL ON UPDATE RESTRICT;
ALTER TABLE `in_interventi` DROP FOREIGN KEY `in_interventi_ibfk_4`;
ALTER TABLE `in_interventi` ADD CONSTRAINT `in_interventi_ibfk_4` FOREIGN KEY (`id_contratto`) REFERENCES `co_contratti`(`id`) ON DELETE SET NULL ON UPDATE RESTRICT;
ALTER TABLE `in_interventi` DROP FOREIGN KEY `in_interventi_ibfk_7`;
ALTER TABLE `in_interventi` ADD CONSTRAINT `in_interventi_ibfk_7` FOREIGN KEY (`id_ordine`) REFERENCES `or_ordini`(`id`) ON DELETE SET NULL ON UPDATE RESTRICT;