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

This commit is contained in:
Laurent Destailleur 2023-05-22 10:04:42 +02:00
commit 1ff1c8d48c
9 changed files with 24 additions and 13 deletions

View file

@ -179,6 +179,7 @@ NEW: Widgets: Add widget "The next upcoming events"
NEW: Widgets: Add widget of open opportunities
NEW: Use an ajax component to swith prospection status on thidparty list
NEW: Comment on survey is possible only after vote.
NEW: Add partial payment reason "withholding tax"
For developers or integrators:
------------------------------

View file

@ -279,7 +279,7 @@ class AdherentStats extends Stats
$sql .= " AND d.datefin > '".$this->db->idate(dol_get_first_day($startYear))."'";
}
$sql .= " AND c.fk_parent = 0";
$sql .= " GROUP BY c.rowid";
$sql .= " GROUP BY c.rowid ORDER BY label ASC";
dol_syslog("box_members_by_type::select nb of members per type", LOG_DEBUG);
$result = $this->db->query($sql);
@ -315,7 +315,7 @@ class AdherentStats extends Stats
$totalstatus[$key] += $nb;
}
}
$MembersCountArray[$objp->fk_categorie]['total_adhtype'] = $totalrow;
$MembersCountArray[$objp->fk_categorie]['total_adhtag'] = $totalrow;
$i++;
}
$this->db->free($result);

View file

@ -4248,6 +4248,8 @@ if ($action == 'create') {
$i++;
$close[$i]['code'] = 'bankcharge';
$i++;
$close[$i]['code'] = 'withholdingtax';
$i++;
$close[$i]['code'] = 'other';
$i++;
// Help
@ -4258,6 +4260,8 @@ if ($action == 'create') {
$i++;
$close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBankChargeDesc");
$i++;
$close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonWithholdingTaxDesc");
$i++;
$close[$i]['label'] = $langs->trans("Other");
$i++;
// Texte
@ -4268,6 +4272,8 @@ if ($action == 'create') {
$i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBankCharge", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1);
$i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonWithholdingTax"), $close[$i]['label'], 1);
$i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("Other"), $close[$i]['label'], 1);
$i++;
// arrayreasons[code]=reason
@ -4278,7 +4284,7 @@ if ($action == 'create') {
// Cree un tableau formulaire
$formquestion = array('text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"), array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
// Paiement incomplet. On demande si motif = escompte ou autre
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidPartially', $object->ref), 'confirm_paid_partially', $formquestion, "yes", 1, 340, 600);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidPartially', $object->ref), 'confirm_paid_partially', $formquestion, "yes", 1, 380, 600);
}
// Confirmation du classement abandonne

View file

@ -475,6 +475,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<input type="hidden" name="socid" value="'.$facture->socid.'">';
print '<input type="hidden" name="type" id="invoice_type" value="'.$facture->type.'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($facture->thirdparty->name).'">';
print '<input type="hidden" name="page_y" value="">';
print dol_get_fiche_head();
@ -868,7 +869,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$langs->load("withdrawals");
if (!empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '<br>'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed");
}*/
print '<br><input type="submit" class="button" value="'.dol_escape_htmltag($buttontitle).'"><br><br>';
print '<br><input type="submit" class="button reposition" value="'.dol_escape_htmltag($buttontitle).'"><br><br>';
print '</div>';
}

View file

@ -266,7 +266,7 @@ class Paiement extends CommonObject
$currencyofpayment = '';
$currencytxofpayment = '';
foreach ($amounts as $key => $value) { // How payment is dispatch
foreach ($amounts as $key => $value) { // How payment is dispatched
if (empty($value)) {
continue;
}
@ -300,6 +300,10 @@ class Paiement extends CommonObject
}
}
if (empty($currencyofpayment)) { // Should not happen. For the case the multicurrency_code was not saved into invoices
$currencyofpayment = $conf->currency;
}
if (!empty($currencyofpayment)) {
// We must check that the currency of invoices is the same than the currency of the bank
$bankaccount = new Account($this->db);
@ -358,7 +362,7 @@ class Paiement extends CommonObject
if (is_numeric($amount) && $amount <> 0) {
$amount = price2num($amount);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount, multicurrency_amount, multicurrency_code, multicurrency_tx)";
$sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).", ".((float) $this->multicurrency_amounts[$key]).", ".($this->multicurrency_code ? $this->db->escape($currencyofpayment) : 'NULL').", ".(!empty($this->multicurrency_tx) ? (double) $currencytxofpayment : 1).")";
$sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).", ".((float) $this->multicurrency_amounts[$key]).", ".($currencyofpayment ? "'".$this->db->escape($currencyofpayment)."'" : 'NULL').", ".(!empty($this->multicurrency_tx) ? (double) $currencytxofpayment : 1).")";
dol_syslog(get_class($this).'::create Amount line '.$key.' insert paiement_facture', LOG_DEBUG);
$resql = $this->db->query($sql);

View file

@ -160,7 +160,7 @@ class box_members_by_tags extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $adhtag->getNomUrl(0, '', dol_size(32), '&backtolist='.urlencode($_SERVER["PHP_SELF"])),
'text' => '<a href="'.$DOL_MAIN_URL_ROOT.'/adherents/list.php?search_categ='.$adhtag->id.'&sortfield=d.datefin,t.subscription&sortorder=desc,desc&backtopage='.urlencode($_SERVER['PHP_SELF']).'">'.dol_trunc(($adhtag->ref ? $adhtag->ref : $adhtag->label), dol_size(32)).'</a>',
'asis' => 1,
);
$this->info_box_contents[$line][] = array(

View file

@ -2663,10 +2663,7 @@ if ($action == 'create') {
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("OrderDate").'</td><td>';
$date_com = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
if (empty($date_com)) {
$date_com = dol_now();
}
print $form->selectDate($date_com, '', 1, 1, '', "commande", 1, 1);
print $form->selectDate($date_com ?: '', '', 0, 0, '', "commande", 1, 1);
print '</td></tr>';
// Force mandatory order method

View file

@ -196,7 +196,8 @@ ConfirmClassifyPaidPartiallyReasonDiscount=Remaining unpaid <b>(%s %s)</b> is a
ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Remaining unpaid <b>(%s %s)</b> is a discount granted because payment was made before term. I accept to lose the VAT on this discount.
ConfirmClassifyPaidPartiallyReasonDiscountVat=Remaining unpaid <b>(%s %s)</b> is a discount granted because payment was made before term. I recover the VAT on this discount without a credit note.
ConfirmClassifyPaidPartiallyReasonBadCustomer=Bad customer
ConfirmClassifyPaidPartiallyReasonBankCharge=Deduction by bank (intermediary bank fees)
ConfirmClassifyPaidPartiallyReasonBankCharge=Deduction by bank (intermediary bank fee)
ConfirmClassifyPaidPartiallyReasonWithholdingTax=Withholding tax
ConfirmClassifyPaidPartiallyReasonProductReturned=Products partially returned
ConfirmClassifyPaidPartiallyReasonOther=Amount abandoned for other reason
ConfirmClassifyPaidPartiallyReasonDiscountNoVatDesc=This choice is possible if your invoice has been provided with suitable comments. (Example «Only the tax corresponding to the price that has been actually paid gives rights to deduction»)
@ -205,6 +206,7 @@ ConfirmClassifyPaidPartiallyReasonAvoirDesc=Use this choice if all other does no
ConfirmClassifyPaidPartiallyReasonBadCustomerDesc=A <b>bad customer</b> is a customer that refuses to pay his debt.
ConfirmClassifyPaidPartiallyReasonProductReturnedDesc=This choice is used when payment is not complete because some of products were returned
ConfirmClassifyPaidPartiallyReasonBankChargeDesc=The unpaid amount is <b>intermediary bank fees</b>, deducted directly from the <b>correct amount</b> paid by the Customer.
ConfirmClassifyPaidPartiallyReasonWithholdingTaxDesc=The unpaid amount will never be paid as it is a withholding tax
ConfirmClassifyPaidPartiallyReasonOtherDesc=Use this choice if all others are not suitable, for example in following situation:<br>- payment not complete because some products were shipped back<br>- amount claimed too important because a discount was forgotten<br>In all cases, amount over-claimed must be corrected in accountancy system by creating a credit note.
ConfirmClassifyAbandonReasonOther=Other
ConfirmClassifyAbandonReasonOtherDesc=This choice will be used in all other cases. For example because you plan to create a replacing invoice.

View file

@ -3161,7 +3161,7 @@ class SupplierProposalLine extends CommonObjectLine
$sql .= " ".price2num($this->localtax2_tx).",";
$sql .= " '".$this->db->escape($this->localtax1_type)."',";
$sql .= " '".$this->db->escape($this->localtax2_type)."',";
$sql .= " ".(!empty($this->subprice) ? price2num($this->subprice, 'MU') : "null").",";
$sql .= " ".price2num($this->subprice, 'MU') .",";
$sql .= " ".((float) $this->remise_percent).",";
$sql .= " ".(isset($this->info_bits) ? ((int) $this->info_bits) : "null").",";
$sql .= " ".price2num($this->total_ht, 'MT').",";