';
/*
- * List of invoices
+ * List of social contributions payed
*/
$disable_delete = 0;
-$sql = 'SELECT f.rowid as scid, f.libelle, f.paye, pf.amount, pc.libelle as sc_type';
+$sql = 'SELECT f.rowid as scid, f.libelle, f.paye, f.amount as sc_amount, pf.amount, pc.libelle as sc_type';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementcharge as pf,'.MAIN_DB_PREFIX.'chargesociales as f, '.MAIN_DB_PREFIX.'c_chargesociales as pc';
$sql.= ' WHERE pf.fk_charge = f.rowid AND pf.fk_typepaiement = pc.id';
$sql.= ' AND f.entity = '.$conf->entity;
@@ -225,8 +227,9 @@ if ($resql)
print '
';
print '
'.$langs->trans('SocialContribution').'
';
print '
'.$langs->trans('Label').'
';
+ print '
'.$langs->trans('ExpectedToPay').'
';
print '
'.$langs->trans('Status').'
';
- print '
'.$langs->trans('AmountTTC').'
';
+ print '
'.$langs->trans('PayedByThisPayment').'
';
print "
\n";
if ($num > 0)
@@ -247,7 +250,11 @@ if ($resql)
print $socialcontribstatic->getNomUrl(1);
print "\n";
print '
';
+
print '';
}
}
diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php
index 33576f22590..7459dc7a345 100644
--- a/htdocs/fourn/paiement/fiche.php
+++ b/htdocs/fourn/paiement/fiche.php
@@ -1,7 +1,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo
- * Copyright (C) 2006 Laurent Destailleur
+ * Copyright (C) 2006-2010 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -156,24 +156,6 @@ print '
';
print '
';
print '
'.$langs->trans('Ref').'
'.$paiement->id.'
';
-if ($conf->banque->enabled)
-{
- if ($paiement->bank_account)
- {
- // Si compte renseign�, on affiche libelle
- $bank=new Account($db);
- $bank->fetch($paiement->bank_account);
-
- $bankline=new AccountLine($db);
- $bankline->fetch($paiement->bank_line);
-
- print '
';
- }
-}
//switch through edition options for date (only available when statut is -not 1- (=validated))
if (empty($_GET['action']) || $_GET['action']!='edit_date')
@@ -242,6 +224,25 @@ if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
print '
'.$langs->trans('Status').'
'.$paiement->getLibStatut(4).'
';
}
+if ($conf->banque->enabled)
+{
+ if ($paiement->bank_account)
+ {
+ // Si compte renseigne, on affiche libelle
+ $bank=new Account($db);
+ $bank->fetch($paiement->bank_account);
+
+ $bankline=new AccountLine($db);
+ $bankline->fetch($paiement->bank_line);
+
+ print '
\n";
if ($objp->paye == 1)
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index c8b386f4627..d382aee9bfc 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -354,6 +354,8 @@ Cash=Cash
Reported=Delayed
DisabledBecausePayments=Not possible since there is some payments
CantRemovePaymentWithOneInvoicePaid=Can't remove payment since there is at least on invoice classified payed
+ExpectedToPay=Expected payment
+PayedByThisPayment=Payed by this payment
##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice
TypeContact_facture_external_BILLING=Customer invoice contact
diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang
index 014e83e90e2..5e777c37c46 100644
--- a/htdocs/langs/fr_FR/bills.lang
+++ b/htdocs/langs/fr_FR/bills.lang
@@ -356,6 +356,8 @@ InvoiceDepositAsk=Facture d'acompte
InvoiceDepositDesc=La facture d'acompte est le type de facture qui fait suite à réception d'un acompte, s'il n'est pas encore possible de saisir le paiement sur une facture définitive.
DisabledBecausePayments=Non disponible car il existe des paiements
CantRemovePaymentWithOneInvoicePaid=Suppression impossible quand il existe au moins une facture classée payée.
+ExpectedToPay=Paiement attendu
+PayedByThisPayment=Payé par ce paiement
##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=Reponsable suivi facture client
TypeContact_facture_external_BILLING=Contact client facturation
diff --git a/htdocs/paiement.class.php b/htdocs/paiement.class.php
index 10a605d85b6..20ced109760 100644
--- a/htdocs/paiement.class.php
+++ b/htdocs/paiement.class.php
@@ -68,9 +68,10 @@ class Paiement
*/
function fetch($id)
{
- $sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank';
- $sql.= ', c.code as type_code, c.libelle as type_libelle';
- $sql.= ', p.num_paiement, p.note, b.fk_account';
+ $sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank,';
+ $sql.= ' c.code as type_code, c.libelle as type_libelle,';
+ $sql.= ' p.num_paiement, p.note,';
+ $sql.= ' b.fk_account';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement as p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
$sql.= ' WHERE p.fk_paiement = c.id';
@@ -89,14 +90,15 @@ class Paiement
$this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp);
$this->numero = $obj->num_paiement;
- $this->bank_account = $obj->fk_account;
- $this->bank_line = $obj->fk_bank;
$this->montant = $obj->amount;
$this->note = $obj->note;
$this->type_libelle = $obj->type_libelle;
$this->type_code = $obj->type_code;
$this->statut = $obj->statut;
+ $this->bank_account = $obj->fk_account;
+ $this->bank_line = $obj->fk_bank;
+
$this->db->free($result);
return 1;
}