Qual: A lot of screen more clear

This commit is contained in:
Laurent Destailleur 2010-02-10 17:07:25 +00:00
parent 3d9e26df4f
commit 8e78f75be4
13 changed files with 337 additions and 297 deletions

View File

@ -346,15 +346,16 @@ class ChargeSociales extends CommonObject
/** \class PaiementCharge /** \class PaiementCharge
* \brief Classe permettant la gestion des paiements des charges * \brief Classe permettant la gestion des paiements des charges
*/ */
class PaiementCharge class PaiementCharge extends CommonObject
{ {
var $db; //!< To store db handler var $db; //!< To store db handler
var $error; //!< To return error code (or message) var $error; //!< To return error code (or message)
var $errors=array(); //!< To return several error codes (or messages) var $errors=array(); //!< To return several error codes (or messages)
//var $element='paiementcharge'; //!< Id that identify managed objects var $element='paiementcharge'; //!< Id that identify managed objects
//var $table_element='paiementcharge'; //!< Name of table without prefix where object is stored var $table_element='paiementcharge'; //!< Name of table without prefix where object is stored
var $id; var $id;
var $ref;
var $fk_charge; var $fk_charge;
var $datec=''; var $datec='';
@ -463,7 +464,6 @@ class PaiementCharge
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
$sql.= " t.fk_charge,"; $sql.= " t.fk_charge,";
$sql.= " t.datec,"; $sql.= " t.datec,";
$sql.= " t.tms,"; $sql.= " t.tms,";
@ -475,10 +475,10 @@ class PaiementCharge
$sql.= " t.fk_bank,"; $sql.= " t.fk_bank,";
$sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_creat,";
$sql.= " t.fk_user_modif,"; $sql.= " t.fk_user_modif,";
$sql.= " pt.code as type_code, pt.libelle as type_libelle,";
$sql.= " pt.code as type_code, pt.libelle as type_libelle"; $sql.= ' b.fk_account';
$sql.= " FROM (".MAIN_DB_PREFIX."paiementcharge as t, ".MAIN_DB_PREFIX."c_paiement as pt)";
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as t, ".MAIN_DB_PREFIX."c_paiement as pt"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
$sql.= " WHERE t.rowid = ".$id." AND t.fk_typepaiement = pt.id"; $sql.= " WHERE t.rowid = ".$id." AND t.fk_typepaiement = pt.id";
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
@ -490,6 +490,7 @@ class PaiementCharge
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->fk_charge = $obj->fk_charge; $this->fk_charge = $obj->fk_charge;
$this->datec = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec);
@ -505,6 +506,9 @@ class PaiementCharge
$this->type_code = $obj->type_code; $this->type_code = $obj->type_code;
$this->type_libelle = $obj->type_libelle; $this->type_libelle = $obj->type_libelle;
$this->bank_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank;
} }
$this->db->free($resql); $this->db->free($resql);

View File

@ -23,7 +23,7 @@
/** /**
* \file htdocs/compta/bank/account.php * \file htdocs/compta/bank/account.php
* \ingroup banque * \ingroup banque
* \brief Page de d<EFBFBD>tail des transactions bancaires * \brief List of detail of bank transaction for an account
* \version $Id$ * \version $Id$
*/ */
@ -500,28 +500,18 @@ if ($account || $_GET["ref"])
$links = $acct->get_url($objp->rowid); $links = $acct->get_url($objp->rowid);
$isbanktransfert=false; // Sgow generic description
foreach($links as $key=>$val) { if ($val['type']=='banktransfert') $isbanktransfert=true; } if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
$issocialcontrib=false;
foreach($links as $key=>$val) { if ($val['type']=='sc') $issocialcontrib=true; }
$showlabel=true;
//if (sizeof($links) == 0) $showlabel=true;
//if ($isbanktransfert || $issocialcontrib) $showlabel=true;
if ($showlabel)
{ {
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg)) // Generic description because between (). We show it after translating.
{ print $langs->trans($reg[1]);
// Genereic description because between (). We show it after translating. }
print $langs->trans($reg[1]); else
} {
else print dol_trunc($objp->label,60);
{
print dol_trunc($objp->label,60);
}
} }
// Add links in description field // Add links after description
foreach($links as $key=>$val) foreach($links as $key=>$val)
{ {
if ($links[$key]['type']=='payment') { if ($links[$key]['type']=='payment') {
@ -544,12 +534,11 @@ if ($account || $_GET["ref"])
else if ($links[$key]['type']=='payment_sc') else if ($links[$key]['type']=='payment_sc')
{ {
//print ' - '; //print ' - ';
/* print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">';
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/xxx.php?id='.$links[$key]['url_id'].'">'; print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
//print img_object($langs->trans('ShowPayment'),'payment').' '; //print $langs->trans("SocialContributionPayment");
print $langs->trans("SocialContributionPayment");
print '</a>'; print '</a>';
*/
} }
else if ($links[$key]['type']=='payment_vat') else if ($links[$key]['type']=='payment_vat')
{ {

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com> * Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr> * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -373,7 +373,7 @@ if ($result)
print '</a>'; print '</a>';
} }
else if ($links[$key]['type']=='payment_sc') { else if ($links[$key]['type']=='payment_sc') {
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/xxx.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowPayment'),'payment').' '; print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("SocialContributionPayment"); print $langs->trans("SocialContributionPayment");
print '</a>'; print '</a>';

View File

@ -187,7 +187,9 @@ if ($resql)
// Date // Date
print '<td align="left" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")." &nbsp; </td>\n"; print '<td align="left" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")." &nbsp; </td>\n";
// Description
print "<td><a href=\"ligne.php?rowid=$objp->rowid&amp;account=$objp->fk_account\">"; print "<td><a href=\"ligne.php?rowid=$objp->rowid&amp;account=$objp->fk_account\">";
//print $objp->label;
$reg=array(); $reg=array();
preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);

View File

@ -280,7 +280,7 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
print '<tr><td><span class="fieldrequired">'.$langs->trans('Date').'</span></td><td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans('Date').'</span></td><td>';
$datepayment = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $datepayment = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$datepayment= ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0) : $datepayment); $datepayment= ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0) : $datepayment);
$html->select_date($datepayment,'','','',0,"add_paiement"); $html->select_date($datepayment,'','','',0,"add_paiement",1,1);
print '</td>'; print '</td>';
print '<td>'.$langs->trans('Comments').'</td></tr>'; print '<td>'.$langs->trans('Comments').'</td></tr>';

View File

@ -226,9 +226,10 @@ if ($resql)
print '<br><table class="noborder" width="100%">'; print '<br><table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Bill').'</td>'; print '<td>'.$langs->trans('Bill').'</td>';
print '<td align="center">'.$langs->trans('Status').'</td>';
print '<td>'.$langs->trans('Company').'</td>'; print '<td>'.$langs->trans('Company').'</td>';
print '<td align="right">'.$langs->trans('AmountTTC').'</td>'; print '<td align="right">'.$langs->trans('ExpectedToPay').'</td>';
print '<td align="center">'.$langs->trans('Status').'</td>';
print '<td align="right">'.$langs->trans('PayedByThisPayment').'</td>';
print "</tr>\n"; print "</tr>\n";
if ($num > 0) if ($num > 0)
@ -242,15 +243,27 @@ if ($resql)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
// Invoice
print '<td>'; print '<td>';
$facturestatic->id=$objp->facid; $facturestatic->id=$objp->facid;
$facturestatic->ref=$objp->facnumber; $facturestatic->ref=$objp->facnumber;
$facturestatic->type=$objp->type; $facturestatic->type=$objp->type;
print $facturestatic->getNomUrl(1); print $facturestatic->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td align="center">'.$facturestatic->LibStatut($objp->paye,$objp->fk_statut,2,1).'</td>';
// Third party
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>';
// Expected to pay
print '<td align="right">'.price($objp->total_ttc).'</td>';
// Statut
print '<td align="center">'.$facturestatic->LibStatut($objp->paye,$objp->fk_statut,2,1).'</td>';
// Amount payed
print '<td align="right">'.price($objp->amount).'</td>'; print '<td align="right">'.price($objp->amount).'</td>';
print "</tr>\n"; print "</tr>\n";
if ($objp->paye == 1) // If at least one invoice is paid, disable delete if ($objp->paye == 1) // If at least one invoice is paid, disable delete
{ {

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,11 +17,11 @@
*/ */
/** /**
\file htdocs/compta/paiement_charge.php * \file htdocs/compta/paiement_charge.php
\ingroup compta * \ingroup tax
\brief Page de creation d'un paiement d'une charge * \brief Page to add payment of a tax
\version $Id$ * \version $Id$
*/ */
include_once("./pre.inc.php"); include_once("./pre.inc.php");
include_once(DOL_DOCUMENT_ROOT."/chargesociales.class.php"); include_once(DOL_DOCUMENT_ROOT."/chargesociales.class.php");
@ -34,8 +34,8 @@ $chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"];
// Securite acces client // Securite acces client
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
$action = ''; $action = '';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
@ -46,98 +46,99 @@ if ($_POST["action"] == 'add_paiement')
{ {
if ($_POST["cancel"]) if ($_POST["cancel"])
{ {
$loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid; $loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid;
Header("Location: $loc"); Header("Location: $loc");
exit; exit;
} }
$datepaye = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datepaye = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
if (! $_POST["paiementtype"] > 0) if (! $_POST["paiementtype"] > 0)
{ {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
$error++; $error++;
} }
if ($datepaye == '') if ($datepaye == '')
{ {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")); $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date"));
$error++; $error++;
} }
if (! $error) if (! $error)
{ {
$paiement_id = 0; $paiement_id = 0;
// Read possible payments // Read possible payments
$amounts = array(); $amounts = array();
foreach ($_POST as $key => $value) foreach ($_POST as $key => $value)
{ {
if (substr($key,0,7) == 'amount_') if (substr($key,0,7) == 'amount_')
{ {
$other_chid = substr($key,7); $other_chid = substr($key,7);
$amounts[$other_chid] = $_POST[$key]; $amounts[$other_chid] = $_POST[$key];
} }
} }
$db->begin(); $db->begin();
// Creation de la ligne paiement // Creation de la ligne paiement
$paiement = new PaiementCharge($db); $paiement = new PaiementCharge($db);
$paiement->chid = $chid; $paiement->chid = $chid;
$paiement->datepaye = $datepaye; $paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Tableau de montant $paiement->amounts = $amounts; // Tableau de montant
$paiement->paiementtype = $_POST["paiementtype"]; $paiement->paiementtype = $_POST["paiementtype"];
$paiement->num_paiement = $_POST["num_paiement"]; $paiement->num_paiement = $_POST["num_paiement"];
$paiement->note = $_POST["note"]; $paiement->note = $_POST["note"];
$paiement_id = $paiement->create($user); $paiement_id = $paiement->create($user);
if ($paiement_id > 0) if ($paiement_id > 0)
{ {
// On determine le montant total du paiement // On determine le montant total du paiement
$total=0; $total=0;
foreach ($paiement->amounts as $key => $value) foreach ($paiement->amounts as $key => $value)
{ {
$chid = $key; $chid = $key;
$value = trim($value); $value = trim($value);
$amount = price2num(trim($value), 'MT'); // Un round est ok si nb avec '.' $amount = price2num(trim($value), 'MT'); // Un round est ok si nb avec '.'
$total += $amount; $total += $amount;
} }
// Insertion dans llx_bank // Insertion dans llx_bank
$langs->load("banks"); $langs->load("banks");
$label = $langs->transnoentities("SocialContributionPayment"); $label = $langs->transnoentities("SocialContributionPayment");
$acc = new Account($db, $_POST["accountid"]); $acc = new Account($db, $_POST["accountid"]);
$bank_line_id = $acc->addline($paiement->datepaye, $paiement->paiementtype, $label, -abs($total), $paiement->num_paiement, '', $user); $bank_line_id = $acc->addline($paiement->datepaye, $paiement->paiementtype, $label, -abs($total), $paiement->num_paiement, '', $user);
// Mise a jour fk_bank dans llx_paiementcharge. On connait ainsi le paiement qui a g<>n<EFBFBD>r<EFBFBD> l'<27>criture bancaire // Mise a jour fk_bank dans llx_paiementcharge. On connait ainsi le paiement qui a genere l'ecriture bancaire
if ($bank_line_id > 0) if ($bank_line_id > 0)
{ {
$paiement->update_fk_bank($bank_line_id); $paiement->update_fk_bank($bank_line_id);
// Mise a jour liens (pour chaque charge concern<72>e par le paiement) // Mise a jour liens (pour chaque charge concernee par le paiement)
foreach ($paiement->amounts as $key => $value) foreach ($paiement->amounts as $key => $value)
{ {
$acc->add_url_line($bank_line_id, $chid, DOL_URL_ROOT.'/compta/sociales/charges.php?id=', '(socialcontribution)','sc'); //$acc->add_url_line($bank_line_id, $chid, DOL_URL_ROOT.'/compta/charges.php?id=', '(socialcontribution)','payment_sc');
} $acc->add_url_line($bank_line_id, $paymentid, DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id=', '(paiement)','payment_sc');
}
$db->commit(); $db->commit();
$loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid; $loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid;
Header("Location: $loc"); Header("Location: $loc");
exit; exit;
} }
else { else {
$db->rollback(); $db->rollback();
$mesg = "Echec de la cr<63>ation entr<74>e compte: ".$db->error(); $mesg = "Echec de la creation entree compte: ".$db->error();
} }
} }
else else
{ {
$db->rollback(); $db->rollback();
$mesg = "Echec de la cr<63>ation du paiement: paiement_id=$paiement_id ".$db->error(); $mesg = "Failed to create payment: paiement_id=$paiement_id ".$db->error();
} }
} }
$_GET["action"]='create'; $_GET["action"]='create';
} }
@ -158,171 +159,175 @@ $html=new Form($db);
if ($_GET["action"] == 'create') if ($_GET["action"] == 'create')
{ {
$charge = new ChargeSociales($db); $charge = new ChargeSociales($db);
$charge->fetch($chid); $charge->fetch($chid);
$total = $charge->amount; $total = $charge->amount;
print_fiche_titre($langs->trans("DoPayment")); print_fiche_titre($langs->trans("DoPayment"));
print "<br>\n"; print "<br>\n";
if ($mesg) if ($mesg)
{ {
print "<div class=\"error\">$mesg</div>"; print "<div class=\"error\">$mesg</div>";
} }
print '<form name="add_paiement" action="paiement_charge.php" method="post">'; print '<form name="add_paiement" action="paiement_charge.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"id\" value=\"$charge->id\">"; print "<input type=\"hidden\" name=\"id\" value=\"$charge->id\">";
print '<input type="hidden" name="action" value="add_paiement">'; print '<input type="hidden" name="action" value="add_paiement">';
print '<table cellspacing="0" class="border" width="100%" cellpadding="2">'; print '<table cellspacing="0" class="border" width="100%" cellpadding="2">';
print "<tr class=\"liste_titre\"><td colspan=\"3\">Charge</td>"; print "<tr class=\"liste_titre\"><td colspan=\"3\">Charge</td>";
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2">';
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid.'">'.$chid.'</a></td></tr>'; print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid.'">'.$chid.'</a></td></tr>';
print '<tr><td>'.$langs->trans("Type")."</td><td colspan=\"2\">".$charge->type_libelle."</td></tr>\n"; print '<tr><td>'.$langs->trans("Type")."</td><td colspan=\"2\">".$charge->type_libelle."</td></tr>\n";
print '<tr><td>'.$langs->trans("Period")."</td><td colspan=\"2\">".dol_print_date($charge->periode,'day')."</td></tr>\n"; print '<tr><td>'.$langs->trans("Period")."</td><td colspan=\"2\">".dol_print_date($charge->periode,'day')."</td></tr>\n";
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$charge->lib."</td></tr>\n"; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$charge->lib."</td></tr>\n";
print '<tr><td>'.$langs->trans("DateDue")."</td><td colspan=\"2\">".dol_print_date($charge->date_ech,'day')."</td></tr>\n"; print '<tr><td>'.$langs->trans("DateDue")."</td><td colspan=\"2\">".dol_print_date($charge->date_ech,'day')."</td></tr>\n";
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td colspan=\"2\"><b>".price($charge->amount).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; print '<tr><td>'.$langs->trans("AmountTTC")."</td><td colspan=\"2\"><b>".price($charge->amount).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
$sql = "SELECT sum(p.amount) as total"; $sql = "SELECT sum(p.amount) as total";
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
$sql.= " WHERE p.fk_charge = ".$chid; $sql.= " WHERE p.fk_charge = ".$chid;
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$obj=$db->fetch_object($resql); $obj=$db->fetch_object($resql);
$sumpaid = $obj->total; $sumpaid = $obj->total;
$db->free(); $db->free();
} }
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2"><b>'.price($sumpaid).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2"><b>'.price($sumpaid).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay")."</td><td colspan=\"3\"><b>".price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay")."</td><td colspan=\"3\"><b>".price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print "<tr class=\"liste_titre\"><td colspan=\"3\">".$langs->trans("Payment").'</td>'; print "<tr class=\"liste_titre\"><td colspan=\"3\">".$langs->trans("Payment").'</td>';
print "<input type=\"hidden\" name=\"chid\" value=\"$chid\">"; print "<input type=\"hidden\" name=\"chid\" value=\"$chid\">";
print '<tr><td>'.$langs->trans("Date").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
$datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; $datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
$html->select_date($datepayment,'','','','',"add_paiement"); $html->select_date($datepayment,'','','','',"add_paiement",1,1);
print "</td>"; print "</td>";
print '<td>'.$langs->trans("Comments").'</td></tr>'; print '<td>'.$langs->trans("Comments").'</td></tr>';
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$html->select_types_paiements($charge->paiementtype, "paiementtype"); $html->select_types_paiements($charge->paiementtype, "paiementtype");
print "</td>\n"; print "</td>\n";
print '<td rowspan="3" valign="top"><textarea name="comment" wrap="soft" cols="40" rows="'.ROWS_3.'"></textarea></td></tr>'; print '<td rowspan="3" valign="top"><textarea name="comment" wrap="soft" cols="40" rows="'.ROWS_3.'"></textarea></td></tr>';
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('AccountToCredit').'</td>'; print '<td class="fieldrequired">'.$langs->trans('AccountToCredit').'</td>';
print '<td>'; print '<td>';
$html->select_comptes($charge->accountid, "accountid", 0, "courant=1"); // Affiche liste des comptes courant $html->select_comptes($charge->accountid, "accountid", 0, "courant=1"); // Affiche liste des comptes courant
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Numero'); print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>'; print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print "<td><input name=\"num_paiement\" type=\"text\"></td></tr>\n"; print "<td><input name=\"num_paiement\" type=\"text\"></td></tr>\n";
/* /*
* Autres charges impay<EFBFBD>es * Autres charges impayees
*/ */
$num = 1; $num = 1;
$i = 0; $i = 0;
print '<tr><td colspan="3">'; print '<tr><td colspan="3">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
//print '<td>'.$langs->trans("SocialContribution").'</td>'; //print '<td>'.$langs->trans("SocialContribution").'</td>';
print '<td align="left">'.$langs->trans("DateDue").'</td>'; print '<td align="left">'.$langs->trans("DateDue").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("AlreadyPaid").'</td>'; print '<td align="right">'.$langs->trans("AlreadyPaid").'</td>';
print '<td align="right">'.$langs->trans("RemainderToPay").'</td>'; print '<td align="right">'.$langs->trans("RemainderToPay").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>'; print '<td align="right">'.$langs->trans("Amount").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
$total=0; $total=0;
$totalrecu=0; $totalrecu=0;
while ($i < $num) while ($i < $num)
{ {
//$objp = $db->fetch_object($result); //$objp = $db->fetch_object($result);
$objp = $charge; $objp = $charge;
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
//print '<td>'.$charge->getNomUrl(1)."</td>\n"; //print '<td>'.$charge->getNomUrl(1)."</td>\n";
if ($objp->date_ech > 0) if ($objp->date_ech > 0)
{ {
print "<td align=\"left\">".dol_print_date($objp->date_ech,'day')."</td>\n"; print "<td align=\"left\">".dol_print_date($objp->date_ech,'day')."</td>\n";
} }
else else
{ {
print "<td align=\"center\"><b>!!!</b></td>\n"; print "<td align=\"center\"><b>!!!</b></td>\n";
} }
print '<td align="right">'.price($objp->amount)."</td>"; print '<td align="right">'.price($objp->amount)."</td>";
print '<td align="right">'.price($sumpaid)."</td>"; print '<td align="right">'.price($sumpaid)."</td>";
print '<td align="right">'.price($objp->amount-$sumpaid)."</td>"; print '<td align="right">'.price($objp->amount-$sumpaid)."</td>";
print '<td align="right">'; print '<td align="right">';
if ($sumpaid < $objp->amount) if ($sumpaid < $objp->amount)
{ {
$namef = "amount_".$objp->id; $namef = "amount_".$objp->id;
print '<input type="text" size="8" name="'.$namef.'">'; print '<input type="text" size="8" name="'.$namef.'">';
} }
else else
{ {
print '-'; print '-';
} }
print "</td>"; print "</td>";
print "</tr>\n"; print "</tr>\n";
$total+=$objp->total; $total+=$objp->total;
$total_ttc+=$objp->total_ttc; $total_ttc+=$objp->total_ttc;
$totalrecu+=$objp->am; $totalrecu+=$objp->am;
$i++; $i++;
} }
if ($i > 1) if ($i > 1)
{ {
// Print total // Print total
print "<tr ".$bc[!$var].">"; print "<tr ".$bc[!$var].">";
print '<td colspan="2" align="left">'.$langs->trans("TotalTTC").':</td>'; print '<td colspan="2" align="left">'.$langs->trans("TotalTTC").':</td>';
print "<td align=\"right\"><b>".price($total_ttc)."</b></td>"; print "<td align=\"right\"><b>".price($total_ttc)."</b></td>";
print "<td align=\"right\"><b>".price($totalrecu)."</b></td>"; print "<td align=\"right\"><b>".price($totalrecu)."</b></td>";
print "<td align=\"right\"><b>".price($total_ttc - $totalrecu)."</b></td>"; print "<td align=\"right\"><b>".price($total_ttc - $totalrecu)."</b></td>";
print '<td align="center">&nbsp;</td>'; print '<td align="center">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }
print "</table></td></tr>\n"; print "</table></td></tr>\n";
// } // }
// $db->free(); // $db->free();
// } // }
// else // else
// { // {
// print $sql ."<br>".$db->error(); // print $sql ."<br>".$db->error();
// } // }
/* /*
* *
*/ */
print '<tr><td colspan="3" align="center">'; print "</table>";
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp; &nbsp;'; print '<br><center>';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; //print '<tr><td colspan="3" align="center">';
print '</td></tr>'; print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print "</table>"; print '&nbsp; &nbsp;';
print "</form>\n"; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
// }
print '</center>';
//print '</td></tr>';
print "</form>\n";
// }
} }

View File

@ -28,7 +28,6 @@
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php');
include_once(DOL_DOCUMENT_ROOT."/chargesociales.class.php"); include_once(DOL_DOCUMENT_ROOT."/chargesociales.class.php");
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
require_once(DOL_DOCUMENT_ROOT."/includes/modules/facture/modules_facture.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/facture/modules_facture.php");
@ -56,7 +55,7 @@ if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' &&
{ {
$db->begin(); $db->begin();
$paiement = new Paiement($db); $paiement = new PaiementCharge($db);
$paiement->fetch($_GET['id']); $paiement->fetch($_GET['id']);
$result = $paiement->delete(); $result = $paiement->delete();
if ($result > 0) if ($result > 0)
@ -76,7 +75,7 @@ if ($_REQUEST['action'] == 'confirm_valide' && $_REQUEST['confirm'] == 'yes' &&
{ {
$db->begin(); $db->begin();
$paiement = new Paiement($db); $paiement = new PaiementCharge($db);
$paiement->id = $_GET['id']; $paiement->id = $_GET['id'];
if ($paiement->valide() > 0) if ($paiement->valide() > 0)
{ {
@ -166,7 +165,10 @@ if ($mesg) print $mesg.'<br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>'; print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td>';
print '<td colspan="3">';
print $html->showrefnav($paiement,'id','',1,'rowid','id');
print '</td></tr>';
// Date // Date
print '<tr><td valign="top" width="120">'.$langs->trans('Date').'</td><td colspan="3">'.dol_print_date($paiement->datep,'day').'</td></tr>'; print '<tr><td valign="top" width="120">'.$langs->trans('Date').'</td><td colspan="3">'.dol_print_date($paiement->datep,'day').'</td></tr>';
@ -205,11 +207,11 @@ print '</table>';
/* /*
* List of invoices * List of social contributions payed
*/ */
$disable_delete = 0; $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.= ' 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.= ' WHERE pf.fk_charge = f.rowid AND pf.fk_typepaiement = pc.id';
$sql.= ' AND f.entity = '.$conf->entity; $sql.= ' AND f.entity = '.$conf->entity;
@ -225,8 +227,9 @@ if ($resql)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('SocialContribution').'</td>'; print '<td>'.$langs->trans('SocialContribution').'</td>';
print '<td>'.$langs->trans('Label').'</td>'; print '<td>'.$langs->trans('Label').'</td>';
print '<td align="right">'.$langs->trans('ExpectedToPay').'</td>';
print '<td align="center">'.$langs->trans('Status').'</td>'; print '<td align="center">'.$langs->trans('Status').'</td>';
print '<td align="right">'.$langs->trans('AmountTTC').'</td>'; print '<td align="right">'.$langs->trans('PayedByThisPayment').'</td>';
print "</tr>\n"; print "</tr>\n";
if ($num > 0) if ($num > 0)
@ -247,7 +250,11 @@ if ($resql)
print $socialcontribstatic->getNomUrl(1); print $socialcontribstatic->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td>'.$objp->libelle.'</td>'; print '<td>'.$objp->libelle.'</td>';
// Expected to pay
print '<td align="right">'.price($objp->sc_amount).'</td>';
// Status
print '<td align="center">'.$socialcontribstatic->LibStatut($objp->fk_statut,2).'</td>'; print '<td align="center">'.$socialcontribstatic->LibStatut($objp->fk_statut,2).'</td>';
// Amount payed
print '<td align="right">'.price($objp->amount).'</td>'; print '<td align="right">'.price($objp->amount).'</td>';
print "</tr>\n"; print "</tr>\n";
if ($objp->paye == 1) // If at least one invoice is paid, disable delete if ($objp->paye == 1) // If at least one invoice is paid, disable delete

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr> * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* *
@ -232,11 +232,11 @@ if ($action == 'create' || $action == 'add_paiement')
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans('Payment').'</td>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans('Payment').'</td>';
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$obj->nom.'</td></tr>'; print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$obj->nom.'</td></tr>';
print '<tr><td>'.$langs->trans('Date').'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
$html->select_date($dateinvoice,'','','','',"addpaiement"); $html->select_date($dateinvoice,'','','','',"addpaiement",1,1);
print '</td>'; print '</td>';
print '<td>'.$langs->trans('Comments').'</td></tr>'; print '<td>'.$langs->trans('Comments').'</td></tr>';
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans('PaymentMode').'</td><td>';
$html->select_types_paiements(empty($_POST['paiementid'])?'':$_POST['paiementid'],'paiementid'); $html->select_types_paiements(empty($_POST['paiementid'])?'':$_POST['paiementid'],'paiementid');
print '</td>'; print '</td>';
print '<td rowspan="3" valign="top">'; print '<td rowspan="3" valign="top">';
@ -244,7 +244,7 @@ if ($action == 'create' || $action == 'add_paiement')
print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>'; print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>';
if ($conf->banque->enabled) if ($conf->banque->enabled)
{ {
print '<tr><td>'.$langs->trans('Account').'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans('Account').'</td><td>';
$html->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',1); $html->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',1);
print '</td></tr>'; print '</td></tr>';
} }
@ -252,6 +252,8 @@ if ($action == 'create' || $action == 'add_paiement')
{ {
print '<tr><td colspan="2">&nbsp;</td></tr>'; print '<tr><td colspan="2">&nbsp;</td></tr>';
} }
print '</table>';
/* /*
* Autres factures impayees * Autres factures impayees
*/ */
@ -270,7 +272,8 @@ if ($action == 'create' || $action == 'add_paiement')
if ($num > 0) if ($num > 0)
{ {
$i = 0; $i = 0;
print '<tr><td colspan="3">'; print '<br>';
print $langs->trans('Invoices').'<br>'; print $langs->trans('Invoices').'<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -326,7 +329,7 @@ if ($action == 'create' || $action == 'add_paiement')
print '<td align="center">&nbsp;</td>'; print '<td align="center">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }
print "</table></td></tr>\n"; print "</table>\n";
} }
$db->free($resql); $db->free($resql);
} }
@ -338,8 +341,10 @@ if ($action == 'create' || $action == 'add_paiement')
/* /*
* *
*/ */
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"></td></tr>';
print '</table>'; print '<br>';
print '<center><input type="submit" class="button" value="'.$langs->trans('Save').'"></center>';
print '</form>'; print '</form>';
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -156,24 +156,6 @@ print '<table class="border" width="100%">';
print '<tr>'; print '<tr>';
print '<td valign="top" width="140" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>'; print '<td valign="top" width="140" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';
if ($conf->banque->enabled)
{
if ($paiement->bank_account)
{
// Si compte renseign<67>, on affiche libelle
$bank=new Account($db);
$bank->fetch($paiement->bank_account);
$bankline=new AccountLine($db);
$bankline->fetch($paiement->bank_line);
print '<tr>';
print '<td valign="top" width="140" colspan="2">'.$langs->trans('BankAccount').'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$bank->id.'">'.img_object($langs->trans('ShowAccount'),'account').' '.$bank->label.'</a></td>';
print '<td>'.$langs->trans('BankLineConciliated').'</td><td>'.yn($bankline->rappro).'</td>';
print '</tr>';
}
}
//switch through edition options for date (only available when statut is -not 1- (=validated)) //switch through edition options for date (only available when statut is -not 1- (=validated))
if (empty($_GET['action']) || $_GET['action']!='edit_date') if (empty($_GET['action']) || $_GET['action']!='edit_date')
@ -242,6 +224,25 @@ if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
print '<tr><td valign="top" colspan="2">'.$langs->trans('Status').'</td><td colspan="3">'.$paiement->getLibStatut(4).'</td></tr>'; print '<tr><td valign="top" colspan="2">'.$langs->trans('Status').'</td><td colspan="3">'.$paiement->getLibStatut(4).'</td></tr>';
} }
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 '<tr>';
print '<td valign="top" width="140" colspan="2">'.$langs->trans('BankAccount').'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$bank->id.'">'.img_object($langs->trans('ShowAccount'),'account').' '.$bank->label.'</a></td>';
print '<td>'.$langs->trans('BankLineConciliated').'</td><td>'.yn($bankline->rappro).'</td>';
print '</tr>';
}
}
print '<tr><td valign="top" colspan="2">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>'; print '<tr><td valign="top" colspan="2">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>';
print '</table>'; print '</table>';
@ -270,9 +271,10 @@ if ($resql)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Ref').'</td>'; print '<td>'.$langs->trans('Ref').'</td>';
print '<td>'.$langs->trans('RefSupplier').'</td>'; print '<td>'.$langs->trans('RefSupplier').'</td>';
print '<td align="center">'.$langs->trans('Status').'</td>';
print '<td>'.$langs->trans('Company').'</td>'; print '<td>'.$langs->trans('Company').'</td>';
print '<td align="right">'.$langs->trans('AmountTTC').'</td>'; print '<td align="right">'.$langs->trans('ExpectedToPay').'</td>';
print '<td align="center">'.$langs->trans('Status').'</td>';
print '<td align="right">'.$langs->trans('PayedByThisPayment').'</td>';
print "</tr>\n"; print "</tr>\n";
if ($num > 0) if ($num > 0)
@ -286,12 +288,19 @@ if ($resql)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
// Ref
print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' '; print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' ';
print $objp->ref; print $objp->ref;
print "</a></td>\n"; print "</a></td>\n";
// Ref supplier
print '<td>'.$objp->ref_supplier."</td>\n"; print '<td>'.$objp->ref_supplier."</td>\n";
print '<td align="center">'.$facturestatic->LibStatut($objp->paye,$objp->fk_statut,2,1).'</td>'; // Third party
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>';
// Expected to pay
print '<td align="right">'.price($objp->total_ttc).'</td>';
// Status
print '<td align="center">'.$facturestatic->LibStatut($objp->paye,$objp->fk_statut,2,1).'</td>';
// Payed
print '<td align="right">'.price($objp->amount).'</td>'; print '<td align="right">'.price($objp->amount).'</td>';
print "</tr>\n"; print "</tr>\n";
if ($objp->paye == 1) if ($objp->paye == 1)

View File

@ -354,6 +354,8 @@ Cash=Cash
Reported=Delayed Reported=Delayed
DisabledBecausePayments=Not possible since there is some payments DisabledBecausePayments=Not possible since there is some payments
CantRemovePaymentWithOneInvoicePaid=Can't remove payment since there is at least on invoice classified payed 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 ##### ##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice
TypeContact_facture_external_BILLING=Customer invoice contact TypeContact_facture_external_BILLING=Customer invoice contact

View File

@ -356,6 +356,8 @@ InvoiceDepositAsk=Facture d'acompte
InvoiceDepositDesc=La <b>facture d'acompte</b> 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. InvoiceDepositDesc=La <b>facture d'acompte</b> 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 DisabledBecausePayments=Non disponible car il existe des paiements
CantRemovePaymentWithOneInvoicePaid=Suppression impossible quand il existe au moins une facture classée payée. 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 ##### ##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=Reponsable suivi facture client TypeContact_facture_internal_SALESREPFOLL=Reponsable suivi facture client
TypeContact_facture_external_BILLING=Contact client facturation TypeContact_facture_external_BILLING=Contact client facturation

View File

@ -68,9 +68,10 @@ class Paiement
*/ */
function fetch($id) function fetch($id)
{ {
$sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank'; $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.= ' c.code as type_code, c.libelle as type_libelle,';
$sql.= ', p.num_paiement, p.note, b.fk_account'; $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.= ' 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.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
$sql.= ' WHERE p.fk_paiement = c.id'; $sql.= ' WHERE p.fk_paiement = c.id';
@ -89,14 +90,15 @@ class Paiement
$this->date = $this->db->jdate($obj->dp); $this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp); $this->datepaye = $this->db->jdate($obj->dp);
$this->numero = $obj->num_paiement; $this->numero = $obj->num_paiement;
$this->bank_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank;
$this->montant = $obj->amount; $this->montant = $obj->amount;
$this->note = $obj->note; $this->note = $obj->note;
$this->type_libelle = $obj->type_libelle; $this->type_libelle = $obj->type_libelle;
$this->type_code = $obj->type_code; $this->type_code = $obj->type_code;
$this->statut = $obj->statut; $this->statut = $obj->statut;
$this->bank_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank;
$this->db->free($result); $this->db->free($result);
return 1; return 1;
} }