[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 66/107: Code cleaning : rename table mod_paym
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 66/107: Code cleaning : rename table mod_payment to payment_method |
Date: |
Mon, 26 Aug 2019 10:32:01 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 56007e9d3dd715793af4d151bf1d9599a8a313ae
Author: Dany De Bontridder <address@hidden>
Date: Tue Aug 6 21:55:59 2019 +0200
Code cleaning : rename table mod_payment to payment_method
---
include/class/acc_payment.class.php | 24 ++++++++++++------------
include/payment_middle.inc.php | 2 +-
sql/upgrade.sql | 15 +++++++++++++++
3 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/include/class/acc_payment.class.php
b/include/class/acc_payment.class.php
index 4a655aa..5f64c33 100644
--- a/include/class/acc_payment.class.php
+++ b/include/class/acc_payment.class.php
@@ -20,7 +20,7 @@
// Copyright Author Dany De Bontridder address@hidden
/*!\file
- * \brief Handle the table mod_payment
+ * \brief Handle the table payment_method
*/
require_once NOALYSS_INCLUDE.'/lib/iselect.class.php';
require_once NOALYSS_INCLUDE.'/lib/icard.class.php';
@@ -31,7 +31,7 @@ require_once NOALYSS_INCLUDE.'/class/fiche_def.class.php';
require_once NOALYSS_INCLUDE.'/constant.php';
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
-/*!\brief Handle the table mod_payment
+/*!\brief Handle the table payment_method
*\note the private data member are accessed via
- mp_id ==> id ( Primary key )
- mp_lib ==> lib (label)
@@ -106,7 +106,7 @@ class Acc_Payment
public function insert()
{
if ( $this->verify() != 0 ) return;
- $sql='INSERT INTO mod_payment(
+ $sql='INSERT INTO payment_method(
mp_lib, mp_jrn_def_id, mp_fd_id, mp_qcode,jrn_def_id)
VALUES ($1, $2, $3, upper($4),$5) returning mp_id';
$this->mp_id=$this->cn->exec_sql($sql,array(
@@ -121,7 +121,7 @@ class Acc_Payment
{
if ( $this->verify() != 0 ) return;
- $sql="update mod_payment set
mp_lib=$1,mp_qcode=$2,mp_jrn_def_id=$3,mp_fd_id=$4,jrn_def_id=$5 ".
+ $sql="update payment_method set
mp_lib=$1,mp_qcode=$2,mp_jrn_def_id=$3,mp_fd_id=$4,jrn_def_id=$5 ".
" where mp_id = $6";
$res=$this->cn->exec_sql(
$sql,
@@ -134,22 +134,22 @@ class Acc_Payment
);
if ( strlen (trim($this->mp_jrn_def_id))==0)
$this->cn->exec_sql(
- 'update mod_payment '.
+ 'update payment_method '.
'set mp_jrn_def_id = null where mp_id=$1',
array($this->mp_id));
if ( strlen (trim($this->jrn_def_id))==0)
$this->cn->exec_sql(
- 'update mod_payment '.
+ 'update payment_method '.
'set mp_jrn_def_id = null where mp_id=$1',
array($this->mp_id));
if ( strlen (trim($this->mp_qcode))==0)
$this->cn->exec_sql(
- 'update mod_payment '.
+ 'update payment_method '.
'set mp_qcode = null where mp_id=$1',
array($this->mp_id));
if ( strlen (trim($this->mp_fd_id))==0)
$this->cn->exec_sql(
- 'update mod_payment '.
+ 'update payment_method '.
'set mp_fd_id = null where mp_id=$1',
array($this->mp_id));
@@ -157,7 +157,7 @@ class Acc_Payment
public function load()
{
- $sql='select mp_id,mp_lib,mp_fd_id,mp_jrn_def_id,mp_qcode,jrn_def_id
from mod_payment '.
+ $sql='select mp_id,mp_lib,mp_fd_id,mp_jrn_def_id,mp_qcode,jrn_def_id
from payment_method '.
' where mp_id = $1';
$res=$this->cn->exec_sql(
$sql,
@@ -177,7 +177,7 @@ class Acc_Payment
*/
public function delete()
{
- $sql="delete from mod_payment where mp_id=$1";
+ $sql="delete from payment_method where mp_id=$1";
$this->cn->exec_sql($sql,array($this->mp_id));
}
/*!\brief retrieve all the data for all ledgers
@@ -187,7 +187,7 @@ class Acc_Payment
public function get_all()
{
$sql='select mp_id,mp_lib '.
- ' from mod_payment order by mp_lib';
+ ' from payment_method order by mp_lib';
$array=$this->cn->get_array($sql);
$ret=array();
if ( !empty($array) )
@@ -209,7 +209,7 @@ class Acc_Payment
public function get_valide()
{
$sql='select mp_id '.
- ' from mod_payment '.
+ ' from payment_method '.
' where jrn_def_id=$1 and mp_jrn_def_id is not null and '.
' (mp_fd_id is not null or mp_qcode is not null)';
$array=$this->cn->get_array($sql,array($this->jrn_def_id));
diff --git a/include/payment_middle.inc.php b/include/payment_middle.inc.php
index 1fadaee..a8db6f0 100644
--- a/include/payment_middle.inc.php
+++ b/include/payment_middle.inc.php
@@ -134,7 +134,7 @@ $array=$cn->get_array("
j2.jrn_def_name as jrn_target,
fd_label,
coalesce(mp_qcode,'A choisir à l''encodage') as vw_name
- from mod_payment as mp
+ from payment_method as mp
left join jrn_def as j on (j.jrn_def_id=mp.jrn_def_id)
left join jrn_def as j2 on
(j2.jrn_def_id=mp.mp_jrn_def_id)
left join fiche_def as fd on (mp.mp_fd_id=fd.fd_id)
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index 2abcfb5..3d2788c 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -1 +1,16 @@
update attr_def set ad_extra = '[sql] fd_id in (select fd_id from fiche_def
where frd_id in (4,8,9,14))' where ad_id=25;
+
+alter table mod_payment rename to payment_method;
+
+alter table payment_method add column type_payment_id varchar(6);
+
+
+comment on column payment_method.type_payment_id is 'Type of payment method';
+
+create table type_payment_ref (id varchar(6 ) primary key,tp_description
varchar(80) not null);
+
+insert into type_payment_ref (id,tp_description) values ('CACRD','Carte de
crédit'),
+ ('CHCK','Chèque'),
+ ('CASH','Liquide'),
+
('ELECT','Electronique'),
+ ('VIRT','Virement');
- [Noalyss-commit] [noalyss] 47/107: Improve doxygen, (continued)
- [Noalyss-commit] [noalyss] 47/107: Improve doxygen, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 51/107: Code Cleaning split sendmail between sendmail_core (not related to noalyss) and sendmail which is used by noalyss, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 54/107: Merge branch 'dev7109', Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 59/107: #0001729: Preference : ne plus recharger la page, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 85/107: Cosmetic : Icon_Trash in Todo_List, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 80/107: translation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 82/107: DatabaseCore fix silent when not debug, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 72/107: Improve message progress bar + translation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 94/107: Bug : Database::fetch_all returns an array or FALSE, because of pg_fetch_all, the version PHP7 cannot use anymore a boolean with count()., Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 63/107: remove background color, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 66/107: Code cleaning : rename table mod_payment to payment_method,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 53/107: Select_Box new Object, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 55/107: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 57/107: PDF_Core : code cleaning, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 71/107: Select_Box add a search, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 77/107: Security : replace direct use of $_GET, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 45/107: Replace PHPCOMPTA by NOALYSS, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 90/107: Cosmetic : add button close in history card & accounting, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 88/107: SQL : correct SQL script to take care of users who delete the profile no 2, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 104/107: 0001728: Aide à l'encodage - Journaux négatifs (note de crédit) Unit test, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 48/107: Doxygen does not allow to document javascript Remove tag for using with jsdoc, Dany De Bontridder, 2019/08/26