From d453082248015bf88c4a7638357159e8d211d6e8 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Fri, 1 Mar 2019 15:33:22 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20priorit=C3=A0=20dicitura?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/common.php b/lib/common.php index 6657713dc..570680376 100644 --- a/lib/common.php +++ b/lib/common.php @@ -213,18 +213,8 @@ function doc_references($info, $dir, $ignore = []) $module = null; $id = null; - // Ordine - if (!empty($info['idordine'])) { - $data = $dbo->fetchArray("SELECT IF(numero_esterno != '', numero_esterno, numero) AS numero, data FROM or_ordini WHERE id=".prepare($info['idordine'])); - - $module = ($dir == 'entrata') ? 'Ordini cliente' : 'Ordini fornitore'; - $id = $info['idordine']; - - $document = tr('Ordine'); - } - // DDT - elseif (!empty($info['idddt'])) { + if (!empty($info['idddt'])) { $data = $dbo->fetchArray("SELECT IF(numero_esterno != '', numero_esterno, numero) AS numero, data FROM dt_ddt WHERE id=".prepare($info['idddt'])); $module = ($dir == 'entrata') ? 'Ddt di vendita' : 'Ddt di acquisto'; @@ -233,6 +223,16 @@ function doc_references($info, $dir, $ignore = []) $document = tr('Ddt'); } + // Ordine + elseif (!empty($info['idordine'])) { + $data = $dbo->fetchArray("SELECT IF(numero_esterno != '', numero_esterno, numero) AS numero, data FROM or_ordini WHERE id=".prepare($info['idordine'])); + + $module = ($dir == 'entrata') ? 'Ordini cliente' : 'Ordini fornitore'; + $id = $info['idordine']; + + $document = tr('Ordine'); + } + // Preventivo elseif (!empty($info['idpreventivo'])) { $data = $dbo->fetchArray('SELECT numero, data_bozza AS data FROM co_preventivi WHERE id='.prepare($info['idpreventivo']));