Fix update segmenti

This commit is contained in:
Luca 2018-03-22 13:28:45 +01:00
parent f998adc626
commit 02fc65e82b
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ function get_new_numerofattura($data)
global $dir;
global $id_segment;
if ($dir = 'uscita'){
if ($dir == 'uscita'){
// recupero maschera per questo segmento
$rs_maschera = $dbo->fetchArray("SELECT pattern FROM zz_segments WHERE id = '".$id_segment."'");

View File

@ -175,9 +175,9 @@ CREATE TABLE IF NOT EXISTS `zz_segments` (
);
-- Popolo con i segmenti di default
INSERT INTO `zz_segments` (`id`, `id_module`, `name`, `pattern`,`note`, `predefined`) VALUES
(1, 14, 'Standard vendite', '####/YY', '', 1),
(2, 15, 'Standard acquisti', '####', '', 1);
INSERT INTO `zz_segments` (`id`, `id_module`, `name`, `clause`, `position`, `pattern`,`note`, `predefined`) VALUES
(1, 14, 'Standard vendite', '1=1', 'WHR', '####/YY', '', 1),
(2, 15, 'Standard acquisti', '1=1', 'WHR', '####', '', 1);
-- Collego le fatture esistenti al segmento di default
UPDATE `co_documenti` SET `id_segment`='1' WHERE `idtipodocumento` IN (SELECT `id` FROM `co_tipidocumento` WHERE `co_tipidocumento`.`dir`='entrata');