From 2967d653c6da61c78c98065be9f9c810ef8a6207 Mon Sep 17 00:00:00 2001 From: Florent Poinsaut Date: Fri, 5 May 2023 09:53:35 +0200 Subject: [PATCH 1/4] Fix date form for order --- htdocs/fourn/commande/card.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 3b0f4fdb6e5..71732626819 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2642,10 +2642,7 @@ if ($action == 'create') { //print ''.$langs->trans("ToOrder").''; print ''.$langs->trans("OrderDate").''; $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 ''; // Force mandatory order method From d8dd1ebd19721f38e9d129cfdb14d3685e511542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Tue, 9 May 2023 17:43:31 +0200 Subject: [PATCH 2/4] FIX: Authorize '0' subprice --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 3155ab3ae0a..88ba4a07022 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -3048,7 +3048,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').","; From 3039c627387c572a0d0093ba0dab1d7a9e28132a Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sun, 21 May 2023 18:18:12 +0200 Subject: [PATCH 3/4] FIX better box member by tag Fix total is missing for each row Fix Link on category points now in the adherent list filtered by category Fix order in box is now same as the select in the list --- htdocs/adherents/class/adherentstats.class.php | 4 ++-- htdocs/core/boxes/box_members_by_tags.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index d3fe283a716..5124e1ba612 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -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); diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php index 468fc2d52a0..c4f192e7490 100644 --- a/htdocs/core/boxes/box_members_by_tags.php +++ b/htdocs/core/boxes/box_members_by_tags.php @@ -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' => ''.dol_trunc(($adhtag->ref ? $adhtag->ref : $adhtag->label), dol_size(32)).'', 'asis' => 1, ); $this->info_box_contents[$line][] = array( From 5bc87a590cf318424801ba37d28f2ab2db31b39c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 May 2023 22:29:46 +0200 Subject: [PATCH 4/4] NEW Add partial payment reason "withholding tax" --- ChangeLog | 1 + htdocs/compta/facture/card.php | 8 +++++++- htdocs/compta/paiement.php | 3 ++- htdocs/compta/paiement/class/paiement.class.php | 8 ++++++-- htdocs/langs/en_US/bills.lang | 4 +++- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 045ff0b61fa..6cd8025ebe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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: ------------------------------ diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 77ecc4e4a05..aa0c99ec4ff 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -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 diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index bcc420ddfbc..9d1e3b39a03 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -475,6 +475,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; print ''; + print ''; 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 '
'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); }*/ - print '


'; + print '


'; print ''; } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index dd1c121094a..7df61ebefcb 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -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); diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 95877a47d4d..9c1bc1791ca 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -196,7 +196,8 @@ ConfirmClassifyPaidPartiallyReasonDiscount=Remaining unpaid (%s %s) is a ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I accept to lose the VAT on this discount. ConfirmClassifyPaidPartiallyReasonDiscountVat=Remaining unpaid (%s %s) 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 bad customer 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 intermediary bank fees, deducted directly from the correct amount 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:
- payment not complete because some products were shipped back
- amount claimed too important because a discount was forgotten
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.