mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-01-22 12:00:19 +01:00
Merge branch 'master' of https://github.com/devcode-it/openstamanager
This commit is contained in:
commit
41d30d515b
@ -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;
|
||||
|
@ -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">
|
||||
|
@ -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">
|
||||
|
42
modules/impianti/validation.php
Normal file
42
modules/impianti/validation.php
Normal 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
7
update/2_4_36.sql
Normal 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;
|
Loading…
Reference in New Issue
Block a user