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

This commit is contained in:
Laurent Destailleur 2024-01-23 22:03:28 +01:00
commit b05d1c5f6e
12 changed files with 25 additions and 12 deletions

View File

@ -559,6 +559,8 @@ class Account extends CommonObject
*/
public function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = null, $num_releve = '', $amount_main_currency = null)
{
global $langs;
// Deprecation warning
if (is_numeric($oper)) {
dol_syslog(__METHOD__.": using numeric operations is deprecated", LOG_WARNING);
@ -591,11 +593,11 @@ class Account extends CommonObject
// Check parameters
if (!$oper) {
$this->error = "oper not defined";
$this->error = $langs->trans("OperNotDefined");
return -1;
}
if (!$this->id) {
$this->error = "this->id not defined";
$this->error = $langs->trans("ThisIdNotDefined");
return -2;
}
if ($this->courant == Account::TYPE_CASH && $oper != 'LIQ') {

View File

@ -275,7 +275,7 @@ class Paiement extends CommonObject
// Add controls of input validity
if ($value_converted === false) {
// We failed to find the conversion for one invoice
$this->error = 'FailedToFoundTheConversionRateForInvoice';
$this->error = $langs->trans('FailedToFoundTheConversionRateForInvoice');
return -1;
}
if (empty($currencyofpayment)) {
@ -324,7 +324,7 @@ class Paiement extends CommonObject
// Check parameters
if (empty($totalamount) && empty($atleastonepaymentnotnull)) { // We accept negative amounts for withdraw reject but not empty arrays
$this->errors[] = 'TotalAmountEmpty';
$this->error = 'TotalAmountEmpty';
$this->error = $langs->trans('TotalAmountEmpty');
return -1;
}

View File

@ -1863,6 +1863,7 @@ class Contact extends CommonObject
$sql .= " WHERE sc.fk_soc =".((int) $this->socid);
$sql .= " AND sc.fk_c_type_contact=tc.rowid";
$sql .= " AND tc.element = '".$this->db->escape($element)."'";
$sql .= " AND sp.entity IN (".getEntity('contact').")";
$sql .= " AND tc.active = 1";
dol_syslog(__METHOD__, LOG_DEBUG);

View File

@ -71,6 +71,7 @@ function societe_prepare_head(Societe $object)
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " WHERE p.fk_soc = ".((int) $object->id);
$sql .= " AND entity IN (".getEntity($object->element).")";
// Add where from hooks
$parameters = array('contacttab' => true);
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
@ -1150,6 +1151,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
$sql .= " WHERE t.fk_soc = ".((int) $object->id);
$sql .= " AND t.entity IN (".getEntity($object->element).")";
$sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)";
if ($search_rowid) {
$sql .= natural_search('t.rowid', $search_rowid);

View File

@ -35,7 +35,7 @@ function showOnlineSignatureUrl($type, $ref, $obj = null)
$servicename = 'Online';
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlineSignature", $servicename).'</span><br>';
$url = getOnlineSignatureUrl(0, $type, $ref, $obj);
$url = getOnlineSignatureUrl(0, $type, $ref, 1, $obj);
$out .= '<div class="urllink">';
if ($url == $langs->trans("FeatureOnlineSignDisabled")) {
$out .= $url;

View File

@ -6,6 +6,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -510,7 +511,7 @@ class modFacture extends DolibarrModules
's.code_compta_fournisseur'=>'SupplierAccountancyCode',
's.tva_intra'=>'VATIntra',
't.libelle'=>"ThirdPartyType", // 'ce.code'=>"Staff", "cfj.libelle"=>"JuridicalStatus",
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.fk_facture_source'=>'SourceInvoiceId',
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total_ht'=>"TotalHT",
'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
'none.rest'=>'Rest',
@ -553,7 +554,7 @@ class modFacture extends DolibarrModules
's.rowid'=>'Numeric', 's.nom'=>'Text', 'ps.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
't.libelle'=>"Text", // 'ce.code'=>"List:c_effectif:libelle:code", "cfj.libelle"=>"Text",
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric',
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.fk_facture_source'=>'Numeric', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric',
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.close_code'=>'Text', 'f.close_note'=>'Text',
'none.rest'=>"NumericCompute",
'f.note_private'=>"Text", 'f.note_public'=>"Text",
@ -637,7 +638,7 @@ class modFacture extends DolibarrModules
's.phone'=>'Phone',
's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode',
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.fk_facture_source'=>'SourceInvoiceId',
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total_ht'=>"TotalHT",
'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
'none.rest'=>'Rest',
@ -662,7 +663,7 @@ class modFacture extends DolibarrModules
$this->export_TypeFields_array[$r] = array(
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.fk_facture_source'=>'Numeric', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.close_code'=>'Text', 'f.close_note'=>'Text',
'none.rest'=>'NumericCompute',
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',

View File

@ -198,7 +198,7 @@ class PaiementFourn extends Paiement
// Add controls of input validity
if ($value_converted === false) {
// We failed to find the conversion for one invoice
$this->error = 'FailedToFoundTheConversionRateForInvoice';
$this->error = $langs->trans('FailedToFoundTheConversionRateForInvoice');
return -1;
}
if (empty($currencyofpayment)) {

View File

@ -1133,13 +1133,13 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) {
}
if ($key == 'js') {
$value = $obj->value;
$valuearray = json_decode($value);
$valuearray = (array) json_decode($value); // Force cast into array because sometimes it is a stdClass
$reloffile = $valuearray[0];
$reloffile = preg_replace('/^\//', '', $valuearray[0]);
}
if ($key == 'css') {
$value = $obj->value;
$valuearray = json_decode($value);
$valuearray = (array) json_decode($value); // Force cast into array because sometimes it is a stdClass
if ($value && (!is_array($valuearray) || count($valuearray) == 0)) {
$valuearray = array();
$valuearray[0] = $value; // If value was not a json array but a string

View File

@ -350,6 +350,7 @@ HelpAbandonOther=This amount has been abandoned since it was an error (wrong cus
IdSocialContribution=Social/fiscal tax payment id
PaymentId=Payment id
PaymentRef=Payment ref.
SourceInvoiceId=Source invoice id
InvoiceId=Invoice id
InvoiceRef=Invoice ref.
InvoiceDateCreation=Invoice creation date

View File

@ -392,3 +392,7 @@ BadSetupOfField = Error bad setup of field
BadSetupOfFieldClassNotFoundForValidation = Error bad setup of field : Class not found for validation
BadSetupOfFieldFileNotFound = Error bad setup of field : File not found for inclusion
BadSetupOfFieldFetchNotCallable = Error bad setup of field : Fetch not callable on class
TotalAmountEmpty=Total Amount Empty
FailedToFoundTheConversionRateForInvoice=Failed to found the conversion rate for invoice
ThisIdNotDefined=$this->id not defined
OperNotDefined=Oper not defined

View File

@ -351,6 +351,7 @@ HelpAbandonOther=Ce montant a été abandonné car il s'agissait d'une erreur de
IdSocialContribution=Id de paiement charge fiscale ou sociale
PaymentId=Id paiement
PaymentRef=Ref paiement
SourceInvoiceId=Id facture source
InvoiceId=Id facture
InvoiceRef=Réf. facture
InvoiceDateCreation=Date création facture

View File

@ -3061,6 +3061,7 @@ class Societe extends CommonObject
$sql = "SELECT rowid, email, statut as status, phone_mobile, lastname, poste, firstname";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople";
$sql .= " WHERE fk_soc = ".((int) $this->id);
$sql .= " AND entity IN (".getEntity($this->element).")";
$sql .= " ORDER BY lastname, firstname";
$resql = $this->db->query($sql);