From 1b0f2577c7cb18ce9a0c7b6e495076545d65fdcb Mon Sep 17 00:00:00 2001 From: Beppe Date: Tue, 10 Nov 2020 14:55:00 +0100 Subject: [PATCH] Aggiornamento date vuote su movimenti --- modules/articoli/src/Articolo.php | 1 + update/2_4_19.sql | 3 +++ 2 files changed, 4 insertions(+) diff --git a/modules/articoli/src/Articolo.php b/modules/articoli/src/Articolo.php index 0ff907f31..274086a76 100755 --- a/modules/articoli/src/Articolo.php +++ b/modules/articoli/src/Articolo.php @@ -72,6 +72,7 @@ class Articolo extends Model */ public function movimenta($qta, $descrizone = null, $data = null, $manuale = false, $array = []) { + $data = ($data ?: date("Y-m-d H:i:s")); $id = $this->registra($qta, $descrizone, $data, $manuale, $array); if ($this->servizio == 0) { diff --git a/update/2_4_19.sql b/update/2_4_19.sql index 68300319b..73ac35297 100644 --- a/update/2_4_19.sql +++ b/update/2_4_19.sql @@ -44,3 +44,6 @@ ALTER TABLE `in_righe_interventi` ADD `qta_evasa` decimal(15, 6) NOT NULL AFTER UPDATE `in_righe_interventi` SET `in_righe_interventi`.`qta_evasa` = `in_righe_interventi`.`qta` WHERE `in_righe_interventi`.`idintervento` IN ( SELECT DISTINCT( `idintervento`) FROM `co_righe_documenti` WHERE `idintervento` IS NOT NULL ); + +-- Aggiornamento date vuote su movimenti +UPDATE `mg_movimenti` SET `data`=`created_at` WHERE `data` IS NULL; \ No newline at end of file