Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0

This commit is contained in:
Laurent Destailleur 2020-06-17 13:30:43 +02:00
commit fdbb6debc9
4 changed files with 64 additions and 37 deletions

View File

@ -985,7 +985,7 @@ class AccountancyExport
print $racine_subledger_account . $separator; // deprecated CPTG & CPTA use instead print $racine_subledger_account . $separator; // deprecated CPTG & CPTA use instead
// MONT // MONT
print price(abs($line->montant), 0, '', 1, 2).$separator; print price(abs($line->montant), 0, '', 1, 2, 2).$separator;
// CODC // CODC
print $line->sens.$separator; print $line->sens.$separator;
// CPTG // CPTG

View File

@ -68,9 +68,10 @@ class Paiement extends CommonObject
*/ */
public $montant; public $montant;
public $amount; // Total amount of payment public $amount; // Total amount of payment (in the main currency)
public $amounts=array(); // Array of amounts public $multicurrency_amount; // Total amount of payment (in the currency of the bank account)
public $multicurrency_amounts=array(); // Array of amounts public $amounts=array(); // array: invoice ID => amount for that invoice (in the main currency)>
public $multicurrency_amounts=array(); // array: invoice ID => amount for that invoice (in the invoice's currency)>
public $author; public $author;
public $paiementid; // Type of payment. Id saved into fields fk_paiement on llx_paiement public $paiementid; // Type of payment. Id saved into fields fk_paiement on llx_paiement
public $paiementcode; // Code of payment. public $paiementcode; // Code of payment.
@ -159,7 +160,7 @@ class Paiement extends CommonObject
*/ */
public function fetch($id, $ref = '', $fk_bank = '') public function fetch($id, $ref = '', $fk_bank = '')
{ {
$sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.ext_payment_id, p.ext_payment_site, p.fk_bank,'; $sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.ext_payment_id, p.ext_payment_site, p.fk_bank, p.multicurrency_amount,';
$sql.= ' c.code as type_code, c.libelle as type_label,'; $sql.= ' c.code as type_code, c.libelle as type_label,';
$sql.= ' p.num_paiement as num_payment, p.note,'; $sql.= ' p.num_paiement as num_payment, p.note,';
$sql.= ' b.fk_account'; $sql.= ' b.fk_account';
@ -179,20 +180,21 @@ class Paiement extends CommonObject
if ($this->db->num_rows($resql)) if ($this->db->num_rows($resql))
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->ref?$obj->ref:$obj->rowid; $this->ref = $obj->ref?$obj->ref:$obj->rowid;
$this->date = $this->db->jdate($obj->dp); $this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp); $this->datepaye = $this->db->jdate($obj->dp);
$this->num_paiement = $obj->num_payment; // deprecated $this->num_paiement = $obj->num_payment; // deprecated
$this->num_payment = $obj->num_payment; $this->num_payment = $obj->num_payment;
$this->montant = $obj->amount; // deprecated $this->montant = $obj->amount; // deprecated
$this->amount = $obj->amount; $this->amount = $obj->amount;
$this->note = $obj->note; $this->multicurrency_amount = $obj->multicurrency_amount;
$this->type_label = $obj->type_label; $this->note = $obj->note;
$this->type_code = $obj->type_code; $this->type_label = $obj->type_label;
$this->statut = $obj->statut; $this->type_code = $obj->type_code;
$this->ext_payment_id = $obj->ext_payment_id; $this->statut = $obj->statut;
$this->ext_payment_site = $obj->ext_payment_site; $this->ext_payment_id = $obj->ext_payment_id;
$this->ext_payment_site = $obj->ext_payment_site;
$this->bank_account = $obj->fk_account; // deprecated $this->bank_account = $obj->fk_account; // deprecated
$this->fk_account = $obj->fk_account; $this->fk_account = $obj->fk_account;

View File

@ -297,6 +297,14 @@ class modFournisseur extends DolibarrModules
'p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_buy'=>'ProductAccountancyBuyCode','project.rowid'=>'ProjectId', 'p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_buy'=>'ProductAccountancyBuyCode','project.rowid'=>'ProjectId',
'project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' 'project.ref'=>'ProjectRef','project.title'=>'ProjectLabel'
); );
if (! empty($conf->multicurrency->enabled))
{
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
$this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
}
//$this->export_TypeFields_array[$r]=array( //$this->export_TypeFields_array[$r]=array(
// 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text', // 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text',
// 's.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric", // 's.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",
@ -423,6 +431,14 @@ class modFournisseur extends DolibarrModules
'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment', 'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment',
'p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','p.fk_bank'=>'IdTransaction','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' 'p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','p.fk_bank'=>'IdTransaction','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel'
); );
if (! empty($conf->multicurrency->enabled))
{
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
$this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
}
//$this->export_TypeFields_array[$r]=array( //$this->export_TypeFields_array[$r]=array(
// 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text', // 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text',
// 's.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date", // 's.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",
@ -508,6 +524,14 @@ class modFournisseur extends DolibarrModules
'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.ref'=>'RefSupplier','fd.fk_product'=>'ProductId', 'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.ref'=>'RefSupplier','fd.fk_product'=>'ProductId',
'p.ref'=>'ProductRef','p.label'=>'ProductLabel','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' 'p.ref'=>'ProductRef','p.label'=>'ProductLabel','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel'
); );
if (! empty($conf->multicurrency->enabled))
{
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
$this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
}
if (empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) if (empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED))
{ {
unset($this->export_fields_array['f.date_approve2']); unset($this->export_fields_array['f.date_approve2']);

View File

@ -89,7 +89,7 @@ class PaiementFourn extends Paiement
{ {
$error=0; $error=0;
$sql = 'SELECT p.rowid, p.ref, p.entity, p.datep as dp, p.amount, p.statut, p.fk_bank,'; $sql = 'SELECT p.rowid, p.ref, p.entity, p.datep as dp, p.amount, p.statut, p.fk_bank, p.multicurrency_amount,';
$sql.= ' c.code as paiement_code, c.libelle as paiement_type,'; $sql.= ' c.code as paiement_code, c.libelle as paiement_type,';
$sql.= ' p.num_paiement as num_payment, 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.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
@ -111,23 +111,24 @@ class PaiementFourn extends Paiement
if ($num > 0) if ($num > 0)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->ref; $this->ref = $obj->ref;
$this->entity = $obj->entity; $this->entity = $obj->entity;
$this->date = $this->db->jdate($obj->dp); $this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp); $this->datepaye = $this->db->jdate($obj->dp);
$this->num_paiement = $obj->num_payment; $this->num_paiement = $obj->num_payment;
$this->num_payment = $obj->num_payment; $this->num_payment = $obj->num_payment;
$this->bank_account = $obj->fk_account; $this->bank_account = $obj->fk_account;
$this->fk_account = $obj->fk_account; $this->fk_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank; $this->bank_line = $obj->fk_bank;
$this->montant = $obj->amount; $this->montant = $obj->amount;
$this->amount = $obj->amount; $this->amount = $obj->amount;
$this->note = $obj->note; $this->multicurrency_amount = $obj->multicurrency_amount;
$this->note_private = $obj->note; $this->note = $obj->note;
$this->type_code = $obj->paiement_code; $this->note_private = $obj->note;
$this->type_label = $obj->paiement_type; $this->type_code = $obj->paiement_code;
$this->statut = $obj->statut; $this->type_label = $obj->paiement_type;
$this->statut = $obj->statut;
$error = 1; $error = 1;
} }
else else