Merge branch 'develop' of github.com:Dolibarr/dolibarr into dev_contactdefault

This commit is contained in:
florian HENRY 2019-09-09 10:16:09 +02:00
commit f5a669e02b
4 changed files with 13 additions and 9 deletions

View File

@ -1740,8 +1740,7 @@ class Adherent extends CommonObject
$paiement->datepaye = $paymentdate;
$paiement->amounts = $amounts;
$paiement->paiementid = dol_getIdFromCode($this->db, $operation, 'c_paiement', 'code', 'id', 1);
$paiement->num_paiement = $num_chq;
$paiement->note = $label;
$paiement->num_payment = $num_chq;
$paiement->note_public = $label;
if (! $error)

View File

@ -813,7 +813,7 @@ class RemiseCheque extends CommonObject
$rejectedPayment->amounts = array();
$rejectedPayment->datepaye = $rejection_date;
$rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement', 'code', 'id', 1);
$rejectedPayment->num_paiement = $payment->numero;
$rejectedPayment->num_payment = $payment->num_payment;
while($obj = $db->fetch_object($resql))
{

View File

@ -117,6 +117,7 @@ class Paiement extends CommonObject
/**
* @var int bank account id of payment
* @deprecated
* @see $fk_account
*/
public $bank_account;
@ -182,7 +183,6 @@ class Paiement extends CommonObject
$this->ref = $obj->ref?$obj->ref:$obj->rowid;
$this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp);
$this->numero = $obj->num_payment; // deprecated
$this->num_paiement = $obj->num_payment; // deprecated
$this->num_payment = $obj->num_payment;
$this->montant = $obj->amount; // deprecated
@ -286,10 +286,12 @@ class Paiement extends CommonObject
$total = $totalamount_converted; // Maybe use price2num with MT for the converted value
$mtotal = $totalamount;
}
$num_payment = ($this->num_payment?$this->num_payment:$this->num_paiement);
$note = ($this->note_public?$this->note_public:$this->note);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat)";
$sql.= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($this->num_paiement)."', '".$this->db->escape($note)."', ".($this->ext_payment_id?"'".$this->db->escape($this->ext_payment_id)."'":"null").", ".($this->ext_payment_site?"'".$this->db->escape($this->ext_payment_site)."'":"null").", ".$user->id.")";
$sql.= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($num_payment)."', '".$this->db->escape($note)."', ".($this->ext_payment_id?"'".$this->db->escape($this->ext_payment_id)."'":"null").", ".($this->ext_payment_site?"'".$this->db->escape($this->ext_payment_site)."'":"null").", ".$user->id.")";
dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -885,7 +887,7 @@ class Paiement extends CommonObject
$result = $this->db->query($sql);
if ($result)
{
$this->numero = $this->db->escape($num);
$this->num_payment = $this->db->escape($num);
return 0;
}
else

View File

@ -88,7 +88,7 @@ class PaiementFourn extends Paiement
$sql = 'SELECT p.rowid, p.ref, p.entity, p.datep as dp, p.amount, p.statut, p.fk_bank,';
$sql.= ' c.code as paiement_code, c.libelle as paiement_type,';
$sql.= ' p.num_paiement, p.note, b.fk_account';
$sql.= ' p.num_paiement as num_payment, p.note, b.fk_account';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
@ -113,12 +113,15 @@ class PaiementFourn extends Paiement
$this->entity = $obj->entity;
$this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp);
$this->numero = $obj->num_paiement;
$this->num_paiement = $obj->num_paiement;
$this->num_paiement = $obj->num_payment;
$this->num_payment = $obj->num_payment;
$this->bank_account = $obj->fk_account;
$this->fk_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank;
$this->montant = $obj->amount;
$this->amount = $obj->amount;
$this->note = $obj->note;
$this->note_private = $obj->note;
$this->type_code = $obj->paiement_code;
$this->type_libelle = $obj->paiement_type;
$this->statut = $obj->statut;