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/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/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/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(
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 5d4f6346af3..731480db581 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -2663,10 +2663,7 @@ if ($action == 'create') {
//print '