diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index fa4500b8c31..d1780c1f6e8 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -69,7 +69,7 @@ if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="p.rowid";
$optioncss = GETPOST('optioncss', 'alpha');
-$amounts = array();array();
+$amounts = array();
$amountsresttopay=array();
$addwarning=0;
@@ -249,6 +249,22 @@ if (empty($reshook))
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
+ // Clean parameters amount if payment is for a credit note
+ if (GETPOST('type') == FactureFournisseur::TYPE_CREDIT_NOTE)
+ {
+ foreach ($amounts as $key => $value) // How payment is dispatch
+ {
+ $newvalue = price2num($value,'MT');
+ $amounts[$key] = -$newvalue;
+ }
+
+ foreach ($multicurrency_amounts as $key => $value) // How payment is dispatch
+ {
+ $newvalue = price2num($value,'MT');
+ $multicurrency_amounts[$key] = -$newvalue;
+ }
+ }
+
if (! $error)
{
$db->begin();
@@ -432,6 +448,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '';
print '';
print '';
+ print '';
print '';
dol_fiche_head(null);
@@ -620,14 +637,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '';
}
- print '
'.price($objp->total_ttc).' | ';
+ print ''.price($sign * $objp->total_ttc).' | ';
- print ''.price($objp->am);
+ print ' | '.price($sign * $objp->am);
if ($creditnotes) print '+'.price($creditnotes);
if ($deposits) print '+'.price($deposits);
print ' | ';
- print ''.price($remaintopay).' | ';
+ print ''.price($sign * $remaintopay).' | ';
// Amount
print '';
diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php
index 26e0884bdd6..ccc92ad2cba 100644
--- a/htdocs/fourn/facture/rapport.php
+++ b/htdocs/fourn/facture/rapport.php
@@ -26,6 +26,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement_fourn.class.p
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+$langs->loadLangs(array('bills'));
+
// Security check
$socid='';
if (! empty($user->societe_id)) $socid=$user->societe_id;
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index e5caac88387..d74681d3118 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -986,7 +986,7 @@ else
$object->idprof6 = GETPOST('idprof6', 'alpha');
$object->typent_id = GETPOST('typent_id', 'int');
$object->effectif_id = GETPOST('effectif_id', 'int');
- $object->civility_id = GETPOST('civility_id', 'int');
+ $object->civility_id = GETPOST('civility_id', 'alpha');
$object->tva_assuj = GETPOST('assujtva_value', 'int');
$object->status = GETPOST('status', 'int');
|