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

This commit is contained in:
Laurent Destailleur 2024-01-11 13:48:15 +01:00
commit 2a4578ef68
9 changed files with 25 additions and 9 deletions

View File

@ -1006,7 +1006,7 @@ if ($action == 'create') {
// Invoice subtype
if (getDolGlobalInt('INVOICE_SUBTYPE_ENABLED')) {
print "<tr><td>".$langs->trans("InvoiceSubtype")."</td><td>";
print $form->getSelectInvoiceSubtype(GETPOSTISSET('subtype') ? GETPOST('subtype') : $object->subtype, 'subtype', -1, 0, 0, '');
print $form->getSelectInvoiceSubtype(GETPOSTISSET('subtype') ? GETPOST('subtype') : $object->subtype, 'subtype', 0, 0, '');
print "</td></tr>";
}

View File

@ -582,7 +582,7 @@ class DiscountAbsolute extends CommonObject
$sql .= " AND f.type = ". (int) $invoice::TYPE_DEPOSIT;
} else {
$this->error = get_class($this)."::getSumDepositsUsed was called with a bad object as a first parameter";
dol_print_error($this->error);
dol_print_error($this->db, $this->error);
return -1;
}
@ -623,7 +623,7 @@ class DiscountAbsolute extends CommonObject
$sql .= " AND f.type IN (".$this->db->sanitize($invoice::TYPE_STANDARD.", ".$invoice::TYPE_CREDIT_NOTE).")"; // Find discount coming from credit note or excess paid
} else {
$this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter";
dol_print_error($this->error);
dol_print_error($this->db, $this->error);
return -1;
}
@ -661,7 +661,7 @@ class DiscountAbsolute extends CommonObject
$sql .= " WHERE rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_source = ".((int) $invoice->id);
} else {
$this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter";
dol_print_error($this->error);
dol_print_error($this->db, $this->error);
return -1;
}

View File

@ -1133,6 +1133,12 @@ if ($action == 'create') {
$numref = $object->ref;
}
$text = $langs->trans('ConfirmValidateIntervention', $numref);
if (isModEnabled('notification')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';
$text .= $notify->confirmMessage('FICHINTER_VALIDATE', $object->socid, $object);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate', '', 1, 1);
}

View File

@ -1527,6 +1527,10 @@ class CommandeFournisseur extends CommonOrder
$line->date_end,
$line->array_options,
$line->fk_unit,
$line->multicurrency_subprice, // pu_ht_devise
$line->origin, // origin
$line->origin_id, // origin_id
$line->rang, // rang
$line->special_code
);
if ($result < 0) {
@ -1806,7 +1810,7 @@ class CommandeFournisseur extends CommonOrder
* @param string $desc Description
* @param float $pu_ht Unit price (used if $price_base_type is 'HT')
* @param float $qty Quantity
* @param float $txtva Taux tva
* @param float $txtva VAT Rate
* @param float $txlocaltax1 Localtax1 tax
* @param float $txlocaltax2 Localtax2 tax
* @param int $fk_product Id product
@ -2051,7 +2055,7 @@ class CommandeFournisseur extends CommonOrder
// Multicurrency
$this->line->fk_multicurrency = $this->fk_multicurrency;
$this->line->multicurrency_code = $this->multicurrency_code;
$this->line->multicurrency_subprice = $pu_ht_devise;
$this->line->multicurrency_subprice = $pu_ht_devise;
$this->line->multicurrency_total_ht = $multicurrency_total_ht;
$this->line->multicurrency_total_tva = $multicurrency_total_tva;
$this->line->multicurrency_total_ttc = $multicurrency_total_ttc;

View File

@ -75,5 +75,6 @@ CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authen
STRIPE_CARD_PRESENT=Card Present for Stripe Terminals
TERMINAL_LOCATION=Location (address) for Stripe Terminals
RequestDirectDebitWithStripe=Request Direct Debit with Stripe
RequesCreditTransferWithStripe=Request Credit Transfer with Stripe
STRIPE_SEPA_DIRECT_DEBIT=Enable the Direct Debit payments through Stripe
StripeConnect_Mode=Stripe Connect mode

View File

@ -280,6 +280,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
}
// Delete dir and files that can be generated in sub tabs later if we need them (we want a minimal module first)
dol_delete_dir_recursive($destdir.'/ajax');
dol_delete_dir_recursive($destdir.'/build/doxygen');
dol_delete_dir_recursive($destdir.'/core/modules/mailings');
dol_delete_dir_recursive($destdir.'/core/modules/'.strtolower($modulename));
@ -311,7 +312,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
dol_delete_file($destdir.'/myobject_agenda.php');
dol_delete_file($destdir.'/myobject_list.php');
dol_delete_file($destdir.'/lib/'.strtolower($modulename).'_myobject.lib.php');
dol_delete_file($destdir.'/test/phpunit/functionnal/'.$modulename.'FunctionnalTest.php');
dol_delete_file($destdir.'/test/phpunit/functional/'.$modulename.'FunctionalTest.php');
dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php');
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.sql');
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql');

View File

@ -613,7 +613,7 @@ if ($resql) {
print $withdrawreceipt->getNomUrl(1);
}
if ($type != 'bank-transfer') {
if (!in_array($type, array('bank-transfer', 'salaire', 'salary'))) {
if (getDolGlobalString('STRIPE_SEPA_DIRECT_DEBIT')) {
$langs->load("stripe");
if ($obj->fk_prelevement_bons > 0) {
@ -627,7 +627,7 @@ if ($resql) {
if ($obj->fk_prelevement_bons > 0) {
print ' &nbsp; ';
}
print '<a href="'.$_SERVER["PHP_SELF"].'?action=sepastripecredittransfer&paymentservice=stripesepa&token='.newToken().'&did='.$obj->rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("RequestDirectDebitWithStripe").'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=sepastripecredittransfer&paymentservice=stripesepa&token='.newToken().'&did='.$obj->rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("RequesCreditTransferWithStripe").'</a>';
}
}
print '</td>';

View File

@ -2746,6 +2746,10 @@ if ($action == 'generatesitemaps' && $usercanedit) {
// Add the entry Sitemap: into the robot.txt file.
$robotcontent = @file_get_contents($filerobot);
$result = preg_replace('/<?php \/\/ BEGIN PHP[^?]END PHP ?>\n/ims', '', $robotcontent);
if ($result) {
$robotcontent = $result;
}
$robotsitemap = "Sitemap: ".$domainname."/".$xmlname;
$result = strpos($robotcontent, 'Sitemap: ');
if ($result) {