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

This commit is contained in:
Laurent Destailleur 2023-12-11 23:34:48 +01:00
commit f9b045bf59
12 changed files with 60 additions and 24 deletions

View file

@ -41,6 +41,8 @@ return (new PhpCsFixer\Config())
// So we use target PHP70 for the moment.
'@PHP70Migration' => true,
//'@PHP71Migration' => true,
// Avoid adding public to const (incompatible with PHP 7.0):
'visibility_required' => ['elements'=>['property', 'method']],
//'strict_param' => true,
//'array_syntax' => ['syntax' => 'short'],

View file

@ -43,8 +43,9 @@ class PrestaShopWebservice
/** @var string PS version */
protected $version;
/** @var array compatible versions of PrestaShop Webservice */
/** @var string compatible min version of PrestaShop Webservice */
const PSCOMPATIBLEVERSIONMIN = '1.4.0.0';
/** @var string compatible max version of PrestaShop Webservice */
const PSCOMPATIBLEVERSIONMAX = '1.7.99.99';

View file

@ -707,7 +707,7 @@ if ($action == 'edit') {
// SMTPS PW
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') != "XOAUTH2") {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW')).'</td></tr>';
}
// SMTPS oauth service

View file

@ -70,7 +70,7 @@ $now = dol_now();
//restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0);
if (!$user->hasRight('propal', 'read') && !$user->hasRight('supplier_proposal', 'read') && !$user->hasRight('commande', 'read') && !$user->hasRight('fournisseur', 'commande', 'read')
&& !$user->hasRight('supplier_order', 'read') && !$user->hasRight('fichinter', 'read')) {
&& !$user->hasRight('supplier_order', 'read') && !$user->hasRight('fichinter', 'read') && !$user->hasRight('contrat', 'read')) {
accessforbidden();
}

View file

@ -181,8 +181,6 @@ class Facture extends CommonInvoice
public $fk_facture_source;
public $linked_objects = array();
public $date_lim_reglement;
/**
* @var int ID Field to store bank id to use when payment mode is withdraw
*/

View file

@ -49,6 +49,12 @@ abstract class CommonInvoice extends CommonObject
*/
public $subtype;
/**
* @var int Thirdparty ID
* @deprecated
* @see $socid
*/
public $fk_soc;
/**
* @var int Thirdparty ID
*/
@ -63,6 +69,8 @@ abstract class CommonInvoice extends CommonObject
*/
public $date;
public $date_lim_reglement;
public $cond_reglement_id; // Id in llx_c_paiement
public $cond_reglement_code; // Code in llx_c_paiement
public $cond_reglement_label;

View file

@ -101,7 +101,7 @@ $arrayofjs = array();
$arrayofcss = array();
top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
print '<body>'."\n";
print '<body class="getmenudiv">'."\n";
// Javascript to make menu active like Jmobile did.
print '
@ -125,6 +125,22 @@ print '
padding-left: 40px; /* width = 20 for level0, 20 for level1 */
}
.getmenudiv a:hover {
text-decoration: none;
}
.pictofixedwidth {
text-align: left;
padding-right: 10px !important;
}
li.lilevel1 > a, li.lilevel1 > i {
padding-left: 30px !important;
}
li.lilevel2 a {
padding-left: 60px !important;
}
a.alilevel0, span.spanlilevel0 {
background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/next.png\') !important;
background-repeat: no-repeat !important;';

View file

@ -364,6 +364,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir)
$filearray[$key]['position'] = '999999'; // File not indexed are at end. So if we add a file, it will not replace an existing position
$filearray[$key]['cover'] = 0;
$filearray[$key]['acl'] = '';
$filearray[$key]['share'] = 0;
$rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filearray[$key]['fullname']);

View file

@ -2256,7 +2256,7 @@ class FactureFournisseur extends CommonInvoice
$supplierinvoiceline->fk_remise_except = $fk_remise_except;
$supplierinvoiceline->special_code = ((string) $special_code != '' ? $special_code : $this->special_code);
$supplierinvoiceline->special_code = (string) $special_code;
$supplierinvoiceline->fk_parent_line = $fk_parent_line;
$supplierinvoiceline->origin = $this->origin;
$supplierinvoiceline->origin_id = $origin_id;
@ -3699,7 +3699,6 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->product_type = $obj->product_type;
$this->product_label = $obj->product_label;
$this->info_bits = $obj->info_bits;
$this->tva_npr = ($obj->info_bits & 1 == 1) ? 1 : 0;
$this->fk_parent_line = $obj->fk_parent_line;
$this->special_code = $obj->special_code;
$this->rang = $obj->rang;
@ -3723,7 +3722,7 @@ class SupplierInvoiceLine extends CommonObjectLine
*/
public function delete($notrigger = 0)
{
global $user, $conf;
global $user;
dol_syslog(get_class($this)."::deleteline rowid=".((int) $this->id), LOG_DEBUG);

View file

@ -67,6 +67,11 @@ class ProductFournisseur extends Product
public $desc_supplier;
public $vatrate_supplier; // default vat rate for this supplier/qty/product (can be set by get_buyprice)
/**
* @deprecated
* @see $product_id
*/
public $fk_product;
public $product_id;
public $product_ref;

View file

@ -45,17 +45,20 @@ $langs->loadLangs(array("intracommreport"));
// Get Parameters
$id = GETPOST('id', 'int');
$action = GETPOST('action');
$exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB or DES
$year = GETPOSTINT('year');
$month = GETPOSTINT('month');
$label = (string) GETPOST('label', 'alphanohtml');
$type_declaration = (string) GETPOST('type_declaration', 'alphanohtml');
$exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB or DES
$type_declaration = (string) GETPOST('type_declaration', 'alphanohtml'); // 'introduction' or 'expedition'
$backtopage = GETPOST('backtopage', 'alpha');
$declaration = array(
"deb" => $langs->trans("DEB"),
"des" => $langs->trans("DES"),
);
$typeOfDeclaration = array(
"introduction" => $langs->trans("Introduction"),
"expedition" => $langs->trans("Expedition"),
@ -121,8 +124,8 @@ if ($permissiontodelete && $action == 'confirm_delete' && $confirm == 'yes') {
if ($action == 'add' && $permissiontoadd) {
$object->label = trim($label);
$object->type = trim($exporttype);
$object->type_declaration = $type_declaration;
$object->exporttype = trim($exporttype); // 'des' or 'deb'
$object->type_declaration = $type_declaration; // 'introduction' or 'expedition'
//$object->subscription = (int) $subscription;
// Fill array 'array_options' with data from add form
@ -272,7 +275,7 @@ if ($id > 0 && $action != 'edit') {
print '</tr>';
// Type of Declaration
print '<tr><td>'.$langs->trans("TypeOfDeclaration").'</td><td class="valeur">'.$object->type_declaration.'</td>';
print '<tr><td>'.$langs->trans("TypeOfDeclaration").'</td><td class="valeur">'.$object->exporttype.'</td>';
print '</tr>';
print "</table>\n";

View file

@ -67,7 +67,9 @@ class IntracommReport extends CommonObject
*/
public $declaration_number;
public $type_declaration; // deb or des
public $exporttype; // deb or des
public $type_declaration; // 'introduction' or 'expedition'
public $numero_declaration;
/**
@ -199,7 +201,7 @@ class IntracommReport extends CommonObject
*
* @param int $period_year Year of declaration
* @param int $period_month Month of declaration
* @param string $type_declaration Declaration type by default - introduction or expedition (always 'expedition' for Des)
* @param string $type_declaration Declaration type by default - 'introduction' or 'expedition' (always 'expedition' for Des)
* @return SimpleXMLElement|int
*/
public function getXMLDes($period_year, $period_month, $type_declaration = 'expedition')
@ -214,9 +216,8 @@ class IntracommReport extends CommonObject
$declaration_des->addChild('mois_des', $period_month);
$declaration_des->addChild('an_des', $period_year);
/**************Ajout des lignes de factures**************************/
// Add invoice lines
$res = $this->addItemsFact($declaration_des, $type_declaration, $period_year.'-'.$period_month, 'des');
/********************************************************************/
$this->errors = array_unique($this->errors);
@ -231,9 +232,9 @@ class IntracommReport extends CommonObject
* Add line from invoice
*
* @param SimpleXMLElement $declaration Reference declaration
* @param string $type Declaration type by default - introduction or expedition (always 'expedition' for Des)
* @param string $type Declaration type by default - 'introduction' or 'expedition' (always 'expedition' for Des)
* @param int $period_reference Reference period
* @param string $exporttype deb=DEB, des=DES
* @param string $exporttype 'deb' for DEB, 'des' for DES
* @return int Return integer <0 if KO, >0 if OK
*/
public function addItemsFact(&$declaration, $type, $period_reference, $exporttype = 'deb')
@ -297,7 +298,7 @@ class IntracommReport extends CommonObject
* @param string $type Declaration type by default - introduction or expedition (always 'expedition' for Des)
* @param int $period_reference Reference declaration
* @param string $exporttype deb=DEB, des=DES
* @return string Return integer <0 if KO, >0 if OK
* @return string Return integer <0 if KO, >0 if OK
*/
public function getSQLFactLines($type, $period_reference, $exporttype = 'deb')
{
@ -454,7 +455,8 @@ class IntracommReport extends CommonObject
*/
public function getNextDeclarationNumber()
{
$sql = "SELECT MAX(numero_declaration) as max_declaration_number FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql = "SELECT MAX(numero_declaration) as max_declaration_number";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE exporttype = '".$this->db->escape($this->exporttype)."'";
$resql = $this->db->query($sql);
if ($resql) {
@ -478,9 +480,10 @@ class IntracommReport extends CommonObject
/**
* Generate XML file
*
* @param string $content_xml Content
* @return void
*/
public function generateXMLFile()
public function generateXMLFile($content_xml)
{
$name = $this->period.'.xml';
@ -488,7 +491,7 @@ class IntracommReport extends CommonObject
$fname = sys_get_temp_dir().'/'.$name;
$f = fopen($fname, 'w+');
fwrite($f, $this->content_xml);
fwrite($f, $content_xml);
fclose($f);
header('Content-Description: File Transfer');