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

This commit is contained in:
Laurent Destailleur 2023-05-03 04:54:49 +02:00
commit 7a781840ca
7 changed files with 26 additions and 12 deletions

View File

@ -903,10 +903,6 @@ if ($rowid > 0) {
print "</table>\n";
print '</div>';
print '</form>';
if ($num > $limit) {
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
}
} else {
dol_print_error($db);
}

View File

@ -515,6 +515,7 @@ if (empty($reshook)) {
} else {
$lineid = 0;
$error++;
$errors[] = $objecttmp->error;
break;
}
// Defined the new fk_parent_line

View File

@ -752,7 +752,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
$arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'\.pdf$';
}
foreach ($listofobjectref as $tmppdf) {
$arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\']+\.pdf$'; // To include PDF generated from ODX files
$arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files
}
$listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true);

View File

@ -544,7 +544,7 @@ class modFacture extends DolibarrModules
$this->export_fields_array[$r] = $this->export_fields_array[$r] + array(
'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription",
'fd.subprice'=>"LineUnitPrice", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.total_ht'=>"LineTotalHT", 'fd.total_tva'=>"LineTotalVAT",
'fd.total_ttc'=>"LineTotalTTC", 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode',
'fd.total_ttc'=>"LineTotalTTC", 'fd.buy_price_ht'=>'BuyingPrice', 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode',
'fd.product_type'=>"TypeOfLineServiceOrProduct", 'fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel',
$alias_product_perentity . '.accountancy_code_sell'=>'ProductAccountancySellCode',
'aa.account_number' => 'AccountingAffectation'
@ -562,7 +562,7 @@ class modFacture extends DolibarrModules
'f.entity'=>'List:entity:label:rowid',
'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',
'pj.ref'=>'Text', 'pj.title'=>'Text', 'fd.rowid'=>'Numeric', 'fd.description'=>"Text", 'fd.subprice'=>"Numeric", 'fd.tva_tx'=>"Numeric",
'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.date_start'=>"Date", 'fd.date_end'=>"Date",
'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.buy_price_ht'=>"Numeric", 'fd.date_start'=>"Date", 'fd.date_end'=>"Date",
'fd.special_code'=>'Numeric', 'fd.product_type'=>"Numeric", 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text',
$alias_product_perentity . '.accountancy_code_sell'=>'Text',
'aa.account_number' => 'Text'
@ -572,12 +572,13 @@ class modFacture extends DolibarrModules
's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company',
't.libelle'=>'company', // 'ce.code'=>'company', 'cfj.libelle'=>'company'
'pj.ref'=>'project', 'pj.title'=>'project', 'fd.rowid'=>'invoice_line', 'fd.description'=>"invoice_line",
'fd.subprice'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva_tx'=>"invoice_line",
'fd.subprice'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.buy_price_ht'=>'invoice_line', 'fd.tva_tx'=>"invoice_line",
'fd.qty'=>"invoice_line", 'fd.date_start'=>"invoice_line", 'fd.date_end'=>"invoice_line", 'fd.special_code'=>'invoice_line',
'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product', 'p.ref'=>'product', 'p.label'=>'product', $alias_product_perentity . '.accountancy_code_sell'=>'product',
'f.fk_user_author'=>'user', 'uc.login'=>'user', 'f.fk_user_valid'=>'user', 'uv.login'=>'user',
'aa.account_number' => "invoice_line",
);
$this->export_help_array[$r] = array('fd.buy_price_ht'=>'CostPriceUsage');
$this->export_special_array[$r] = array('none.rest'=>'getRemainToPay');
$this->export_dependencies_array[$r] = array('invoice_line'=>'fd.rowid', 'product'=>'fd.rowid', 'none.rest'=>array('f.rowid', 'f.total_ttc', 'f.close_code')); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$keyforselect = 'facture';

View File

@ -301,6 +301,7 @@ if ($massaction == 'presend') {
$formmail->param['id'] = join(',', $arrayofselected);
// $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedrecipientobjid) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
// Note: MAILING_LIMIT_SENDBYWEB may be forced by conf.php file and variable $dolibarr_mailing_limit_sendbyweb
$langs->load("errors");
print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB);
print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>';

View File

@ -2620,10 +2620,22 @@ if ($action == 'create') {
,async:false
,dataType:"json"
,success:function(response) {
if (response.response_status == "success"){
jQuery("#value_unit_ht").val(response.data);
jQuery("#value_unit_ht").trigger("change");
jQuery("#value_unit").val("");
if (response.response_status == "success"){';
if (!empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY)) {
print '
jQuery("#value_unit").val(parseFloat(response.data) * (100 + parseFloat(tva)) / 100);
jQuery("#value_unit").trigger("change");
';
} else {
print '
jQuery("#value_unit_ht").val(response.data);
jQuery("#value_unit_ht").trigger("change");
jQuery("#value_unit").val("");
';
}
print '
} else if(response.response_status == "error" && response.errorMessage != undefined && response.errorMessage.length > 0 ){
$.jnotify(response.errorMessage, "error", {timeout: 0, type: "error"},{ remove: function (){} } );
}

View File

@ -1582,6 +1582,9 @@ if ($source == 'member' || $source == 'membersubscription') {
$_GET['newamount'] = $member->last_subscription_amount;
$_GET['amount'] = $member->last_subscription_amount;
}
if (!empty($member->last_subscription_amount) && !GETPOSTISSET('newamount') && is_numeric($amount)) {
$amount = max($member->last_subscription_amount, $amount);
}
}
if ($member->type) {