From dcc9cb4a165d88befaefc45d881e5b65b34d0a36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Sep 2017 14:29:27 +0200 Subject: [PATCH] Some fixes in various payment --- htdocs/core/class/html.formprojet.class.php | 3 +++ htdocs/install/mysql/tables/llx_payment_various.sql | 4 ++-- htdocs/projet/element.php | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 524bd82ddd1..798c4981eba 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -509,6 +509,9 @@ class FormProjets $sql = 'SELECT t.rowid, t.label as ref'; $projectkey='fk_origin'; break; + case "payment_various": + $sql = "SELECT t.rowid, t.num_payment as ref"; + break; case "chargesociales": default: $sql = "SELECT t.rowid, t.ref"; diff --git a/htdocs/install/mysql/tables/llx_payment_various.sql b/htdocs/install/mysql/tables/llx_payment_various.sql index e92b244b009..e719dae7d8c 100644 --- a/htdocs/install/mysql/tables/llx_payment_various.sql +++ b/htdocs/install/mysql/tables/llx_payment_various.sql @@ -19,6 +19,8 @@ create table llx_payment_various ( rowid integer AUTO_INCREMENT PRIMARY KEY, + num_payment varchar(50), -- ref + label varchar(255), tms timestamp, datec datetime, -- Create date datep date, -- date de paiement @@ -26,8 +28,6 @@ create table llx_payment_various sens smallint DEFAULT 0 NOT NULL,-- Sens of the operation: 0 for debit operation, 1 for credit operation amount double(24,8) DEFAULT 0 NOT NULL, fk_typepayment integer NOT NULL, - num_payment varchar(50), -- ref - label varchar(255), accountancy_code varchar(32), fk_projet integer DEFAULT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 0dcb710cfb5..1e4d4132944 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -448,7 +448,7 @@ $listofreferent=array( 'datefieldname'=>'datev', 'margin'=>'minus', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/compta/bank_various_payment/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id.'&socid='.$socid, 'lang'=>'banks', 'buttonnew'=>'AddVariousPayment', 'testnew'=>$user->rights->banque->modifier, @@ -731,7 +731,7 @@ foreach ($listofreferent as $key => $value) if (! empty($conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS)) $idtofilterthirdparty.=','.$conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS; } - if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty) + if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, array('payment_various'))) { $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300'); if (! $selectList || ($selectList<0))