diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index cd44122b981..c8959c86029 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3723,7 +3723,7 @@ else if ($id > 0 || ! empty($ref)) else print $langs->trans('ExcessReceived'); print ' :'; - print '' . price($resteapayeraffiche) . ''; + print '' . price($resteapayeraffiche) . ''; print ' '; } else // Credit note diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index e917e1e1c71..77393b78f4e 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -556,34 +556,42 @@ if ($id > 0) print ''.$langs->trans("Date").''; print ''.$langs->trans("Type").''; print ''.$langs->trans("Amount").''; - print ' '; print ''; - $var=True; - while ($i < $num) + $var=true; + if ($num > 0) + { + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $var=!$var; + print ""; + print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; + print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; + $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type; + print "".$labeltype.' '.$objp->num_paiement."\n"; + print ''.price($objp->amount)."\n"; + print ""; + $totalpaye += $objp->amount; + $i++; + } + } + else { - $objp = $db->fetch_object($resql); $var=!$var; - print ""; - print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; - print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; - $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type; - print "".$labeltype.' '.$objp->num_paiement."\n"; - print ''.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."\n"; - print ""; - $totalpaye += $objp->amount; - $i++; + print ''.$langs->trans("None").''; } - + if ($object->paye == 0) { - print "".$langs->trans("AlreadyPaid")." :".price($totalpaye)." ".$langs->trans("Currency".$conf->currency)."\n"; - print "".$langs->trans("AmountExpected")." :".price($object->amount)." ".$langs->trans("Currency".$conf->currency)."\n"; + print "".$langs->trans("AlreadyPaid")." :".price($totalpaye)."\n"; + print "".$langs->trans("AmountExpected")." :".price($object->amount)."\n"; $resteapayer = $object->amount - $totalpaye; - + $cssforamountpaymentcomplete = 'amountpaymentcomplete'; + print "".$langs->trans("RemainderToPay")." :"; - print "".price($resteapayer)." ".$langs->trans("Currency".$conf->currency)."\n"; + print ''.price($resteapayer)."\n"; } print ""; $db->free($resql); diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 1fdd567745f..61546b39061 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -510,7 +510,7 @@ class ChargeSociales extends CommonObject function info($id) { $sql = "SELECT e.rowid, e.tms as datem, e.date_creation as datec, e.date_valid as datev, e.import_key,"; - $sql.= " fk_user_author, fk_user_modif, fk_user_valid"; + $sql.= " e.fk_user_author, e.fk_user_modif, e.fk_user_valid"; $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as e"; $sql.= " WHERE e.rowid = ".$id; @@ -543,7 +543,7 @@ class ChargeSociales extends CommonObject } $this->date_creation = $this->db->jdate($obj->datec); - if (! empty($obj->fk_user_modif)) $this->date_modification = $this->db->jdate($obj->datem); + $this->date_modification = $this->db->jdate($obj->datem); $this->date_validation = $this->db->jdate($obj->datev); $this->import_key = $obj->import_key; }