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

Conflicts:
	ChangeLog
	htdocs/compta/bank/class/account.class.php
	htdocs/core/class/extrafields.class.php
	htdocs/core/lib/security.lib.php
	htdocs/core/modules/societe/mod_codeclient_elephant.php
	htdocs/filefunc.inc.php
	test/phpunit/CodingPhpTest.php
This commit is contained in:
Laurent Destailleur 2021-05-11 20:34:46 +02:00
commit aa05788d62
7 changed files with 86 additions and 6 deletions

View File

@ -169,6 +169,64 @@ Following changes may create regressions for some external modules, but were nec
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
***** ChangeLog for 13.0.3 compared to 13.0.2 *****
FIX: 13.0 warning - missing quotes around 'label'
FIX: #16143 Old PG requires "()" on DROP FUNCTION
FIX: #16843
FIX: #17060
FIX: #17192 - With tz < 0, event is show in bad day on calendar views
FIX: #17363
FIX: #17476 releve.php: Fix SQL statement
FIX: Accountancy - Import in general ledger
FIX: Accountancy - Quadra export - wrong data on credit
FIX: Accountancy - Warning on the pages of the preparatory statements of accounting entries
FIX: Add function price2num for rounding values in productAlertStock box
FIX: Add parameter to function price2num()
FIX: Cannot delete a batch material from item receipts
FIX: cast int
FIX: Change parameters MF to MS for price2num() function
FIX: create event from contact card preselect contact correctly
FIX: create sociales : keep values error form
FIX: dol_print_date for %a and %b with some timezone
FIX: email is not case sensitive
FIX: error for duplicate thirdparty found correctly returned by ws
FIX: Espadon PDF shippment model with long public note now wroking
FIX: esupplier order: error 500 when using packaging with product where it is not defined
FIX: Filter on debit/credit
FIX: Filter on supplier payment list
FIX: fix checkbox displayed according to module project setup parameters - work in progress
FIX: inconsistency in margin recording with option "Force to sale price"
FIX: invoice PDF generation after payment
FIX: mask selector fournisseur if module not activate
FIX: merge thirparty also work for bank URL entry
FIX: Missing extrafields into export of agenda record
FIX: missing parameter in select for POP
FIX: missing return edit if update error
FIX: missing token on dolGetButtonAction for action delete
FIX: payment creation: re-generate invoice PDF with correct display options
FIX: payment validation: invoices PDF were no re-generated, make it with correct display options
FIX: Periodicity by default on fiscal year, according to the now date, we have plus 1 year added
FIX: pgsql: prevent 'WHERE 1'
FIX: PHP version requirement in composer.json
FIX: project visibility field with two option
FIX: saving template email
FIX: search accented words in product description (consumption page)
FIX: Search on date in accountancy
FIX: selection of project for reception must use
FIX: shhhhhh ! There is nothing here...
FIX: Show input field checkbox selection
FIX: Show Ref.Supplier in LinkToObjectBlock
FIX: SQL Error show_contacts : socialnetworks
FIX: Start hour on ACCOUNTING_DATE_START_BINDING
FIX: supplier order: error 500 when using packaging with product where it is not defined
FIX: test must be === and not ==
FIX: test on link type
FIX: type link extrafield case for advanced target emailing
FIX: Write right on document
>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
***** ChangeLog for 13.0.2 compared to 13.0.1 *****
FIX: 11.0 - $this->socid injected in query without checking for empty value

View File

@ -220,7 +220,7 @@ $sql .= " AND f.fk_statut > 0";
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
} else {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
}
// Add search filter like
if ($search_societe) {

View File

@ -629,6 +629,8 @@ class ExtraFields
*/
public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0)
{
global $hookmanager;
if ($elementtype == 'thirdparty') {
$elementtype = 'societe';
}
@ -674,6 +676,18 @@ class ExtraFields
}
$field_desc = array('type'=>$typedb, 'value'=>$lengthdb, 'null'=>($required ? 'NOT NULL' : 'NULL'), 'default'=>$default);
if (is_object($hookmanager))
{
$hookmanager->initHooks(array('extrafieldsdao'));
$parameters = array('field_desc'=>&$field_desc, 'table'=>$table, 'attr_name'=>$attrname, 'label'=>$label, 'type'=>$type, 'length'=>$length, 'unique'=>$unique, 'required'=>$required, 'pos'=>$pos, 'param'=>$param, 'alwayseditable'=>$alwayseditable, 'perms'=>$perms, 'list'=>$list, 'help'=>$help, 'default'=>$default, 'computed'=>$computed, 'entity'=>$entity, 'langfile'=>$langfile, 'enabled'=>$enabled, 'totalizable'=>$totalizable, 'printable'=>$printable);
$reshook = $hookmanager->executeHooks('updateExtrafields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->error = $this->db->lasterror();
return -1;
}
}
if ($type != 'separate') { // No table update when separate type
$result = $this->db->DDLUpdateField(MAIN_DB_PREFIX.$table, $attrname, $field_desc);
}

View File

@ -467,6 +467,10 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
if (!$user->rights->fournisseur->commande->supprimer) {
$deleteok = 0;
}
} elseif ($feature == 'payment_supplier') {
if (!$user->rights->fournisseur->facture->creer) {
$deleteok = 0;
}
} elseif ($feature == 'banque') {
if (!$user->rights->banque->modifier) {
$deleteok = 0;

View File

@ -348,6 +348,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
if ($soc->id > 0) {
$sql .= " AND rowid <> ".$soc->id;
}
$sql .= " AND entity IN (".getEntity('societe').")";
$resql = $db->query($sql);
if ($resql) {

View File

@ -254,7 +254,7 @@ if ($type_element == 'propal') {
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid);
$where .= " AND d.fk_propal = c.rowid";
$where .= " AND c.entity = ".$conf->entity;
$datePrint = 'c.datep';
$dateprint = 'c.datep';
$doc_number = 'c.ref';
$thirdTypeSelect = 'customer';
}

View File

@ -214,7 +214,7 @@ $styleuse = 'encoded'; // encoded/literal/literal wrapped
$server->register(
'getThirdParty',
// Entry values
array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'),
array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string', 'barcode'=>'xsd:string', 'profid1'=>'xsd:string', 'profid2'=>'xsd:string'),
// Exit values
array('result'=>'tns:result', 'thirdparty'=>'tns:thirdparty'),
$ns,
@ -290,13 +290,16 @@ $server->register(
* @param string $id internal id
* @param string $ref internal reference
* @param string $ref_ext external reference
* @param string $barcode barcode
* @param string $profid1 profid1
* @param string $profid2 profid2
* @return array Array result
*/
function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '')
function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '', $barcode = '', $profid1 = '', $profid2 = '')
{
global $db, $conf;
dol_syslog("Function: getThirdParty login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext);
dol_syslog("Function: getThirdParty login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext." barcode=".$barcode." profid1=".$profid1." profid2=".$profid2);
if ($authentication['entity']) {
$conf->entity = $authentication['entity'];
@ -320,7 +323,7 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '')
if ($fuser->rights->societe->lire) {
$thirdparty = new Societe($db);
$result = $thirdparty->fetch($id, $ref, $ref_ext);
$result = $thirdparty->fetch($id, $ref, $ref_ext, $barcode, $profid1, $profid2);
if ($result > 0) {
$thirdparty_result_fields = array(
'id' => $thirdparty->id,