Amélioration et traduction du rapport des paiements
This commit is contained in:
parent
5109cff29b
commit
d2667a5204
@ -27,6 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/includes/modules/rapport/pdf_paiement.class.php");
|
||||||
|
|
||||||
$user->getrights("facture");
|
$user->getrights("facture");
|
||||||
|
|
||||||
@ -50,7 +51,6 @@ if ($user->societe_id > 0)
|
|||||||
$year = $_GET["year"];
|
$year = $_GET["year"];
|
||||||
if (! $year) { $year=date("Y"); }
|
if (! $year) { $year=date("Y"); }
|
||||||
|
|
||||||
require("../../includes/modules/rapport/pdf_paiement.class.php");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -44,129 +44,116 @@ class pdf_paiement
|
|||||||
function pdf_paiement($db=0)
|
function pdf_paiement($db=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
$langs->load("bills");
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->description = "Liste des paiements";
|
$this->description = $langs->trans("ListOfCustomerPayments");
|
||||||
|
|
||||||
$this->url = DOL_URL_ROOT."/document/rapport/" . "paiements" . ".pdf";
|
|
||||||
|
|
||||||
$this->tab_top = 30;
|
$this->tab_top = 30;
|
||||||
|
|
||||||
$this->line_height = 5;
|
$this->line_height = 5;
|
||||||
$this->line_per_page = 25;
|
$this->line_per_page = 25;
|
||||||
$this->tab_height = 230; //$this->line_height * $this->line_per_page;
|
$this->tab_height = 230; //$this->line_height * $this->line_per_page;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function print_link()
|
function Header(&$pdf, $page, $pages)
|
||||||
{
|
|
||||||
if (file_exists($this->file))
|
|
||||||
{
|
{
|
||||||
print '<a href="'.$this->url.'">paiements.pdf</a>';
|
global $langs;
|
||||||
print '<table><tr>';
|
|
||||||
print '<td align="right">'.filesize($this->file). ' bytes</td>';
|
$title=$this->description.' - '.dolibarr_print_date(mktime(0,0,0,$this->month),"%B");
|
||||||
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($this->file)).'</td>';
|
$pdf->SetFont('Arial','B',12);
|
||||||
print '</tr></table>';
|
$pdf->Text(76, 10, $title);
|
||||||
|
|
||||||
|
$pdf->SetFont('Arial','B',12);
|
||||||
|
$pdf->Text(11, 16, $langs->trans("Date")." : ".dolibarr_print_date(time(),"%d %b %Y"));
|
||||||
|
|
||||||
|
$pdf->SetFont('Arial','',12);
|
||||||
|
$pdf->Text(11, 22, $langs->trans("Page")." : ".$page);
|
||||||
|
// $pdf->Text(11, 22, "Page " . $page . " sur " . $pages);
|
||||||
|
|
||||||
|
$pdf->SetFont('Arial','',12);
|
||||||
|
|
||||||
|
$pdf->Text(11,$this->tab_top + 6,'Date');
|
||||||
|
|
||||||
|
$pdf->line(40, $this->tab_top, 40, $this->tab_top + $this->tab_height + 10);
|
||||||
|
$pdf->Text(42, $this->tab_top + 6, $langs->trans("PaymentType"));
|
||||||
|
|
||||||
|
$pdf->line(80, $this->tab_top, 80, $this->tab_top + $this->tab_height + 10);
|
||||||
|
$pdf->Text(82, $this->tab_top + 6, $langs->trans("Invoice"));
|
||||||
|
|
||||||
|
$pdf->line(120, $this->tab_top, 120, $this->tab_top + $this->tab_height + 10);
|
||||||
|
$pdf->Text(122, $this->tab_top + 6, $langs->trans("AmountInvoice"));
|
||||||
|
|
||||||
|
$pdf->line(160, $this->tab_top, 160, $this->tab_top + $this->tab_height + 10);
|
||||||
|
|
||||||
|
$pdf->SetXY (160, $this->tab_top);
|
||||||
|
$pdf->MultiCell(40, 10, $langs->trans("AmountPayment"), 0, 'R');
|
||||||
|
|
||||||
|
$pdf->line(10, $this->tab_top + 10, 200, $this->tab_top + 10 );
|
||||||
|
|
||||||
|
$pdf->Rect(9, $this->tab_top, 192, $this->tab_height + 10);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function Header(&$pdf, $page, $pages)
|
function Body(&$pdf, $page, $lines)
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$pdf->SetFont('Arial','B',12);
|
|
||||||
$pdf->Text(90, 10, $langs->trans("PaimentsList"));
|
|
||||||
|
|
||||||
$pdf->SetFont('Arial','B',12);
|
|
||||||
$pdf->Text(11, 16, "Date : " . strftime("%d %b %Y", time()));
|
|
||||||
|
|
||||||
$pdf->SetFont('Arial','B',12);
|
|
||||||
$pdf->Text(11, 22, "Page " . $page);
|
|
||||||
// $pdf->Text(11, 22, "Page " . $page . " sur " . $pages);
|
|
||||||
|
|
||||||
$pdf->SetFont('Arial','',12);
|
|
||||||
|
|
||||||
$pdf->Text(11,$this->tab_top + 6,'Date');
|
|
||||||
|
|
||||||
$pdf->line(40, $this->tab_top, 40, $this->tab_top + $this->tab_height + 10);
|
|
||||||
$pdf->Text(42, $this->tab_top + 6,'Type paiement');
|
|
||||||
|
|
||||||
$pdf->line(80, $this->tab_top, 80, $this->tab_top + $this->tab_height + 10);
|
|
||||||
$pdf->Text(82, $this->tab_top + 6,'Facture');
|
|
||||||
|
|
||||||
$pdf->line(120, $this->tab_top, 120, $this->tab_top + $this->tab_height + 10);
|
|
||||||
$pdf->Text(122, $this->tab_top + 6,'Montant Fac');
|
|
||||||
|
|
||||||
$pdf->line(160, $this->tab_top, 160, $this->tab_top + $this->tab_height + 10);
|
|
||||||
|
|
||||||
$pdf->SetXY (160, $this->tab_top);
|
|
||||||
$pdf->MultiCell(40, 10, "Montant", 0, 'R');
|
|
||||||
|
|
||||||
$pdf->Rect(10, $this->tab_top, 190, $this->tab_height + 10);
|
|
||||||
$pdf->line(10, $this->tab_top + 10, 200, $this->tab_top + 10 );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function Body(&$pdf, $page, $lines)
|
|
||||||
{
|
|
||||||
$pdf->SetFont('Arial','', 9);
|
|
||||||
$oldprowid = 0;
|
|
||||||
$pdf->SetFillColor(220,220,220);
|
|
||||||
$yp = 0;
|
|
||||||
for ($j = 0 ; $j < sizeof($lines) ; $j++)
|
|
||||||
{
|
{
|
||||||
$i = $j;
|
$pdf->SetFont('Arial','', 9);
|
||||||
if ($oldprowid <> $lines[$j][7])
|
$oldprowid = 0;
|
||||||
{
|
$pdf->SetFillColor(220,220,220);
|
||||||
if ($yp > 200)
|
$yp = 0;
|
||||||
|
for ($j = 0 ; $j < sizeof($lines) ; $j++)
|
||||||
{
|
{
|
||||||
$page++;
|
$i = $j;
|
||||||
$pdf->AddPage();
|
if ($oldprowid <> $lines[$j][7])
|
||||||
$this->Header($pdf, $page, $pages);
|
{
|
||||||
$pdf->SetFont('Arial','', 9);
|
if ($yp > 200)
|
||||||
$yp = 0;
|
{
|
||||||
|
$page++;
|
||||||
|
$pdf->AddPage();
|
||||||
|
$this->Header($pdf, $page, $pages);
|
||||||
|
$pdf->SetFont('Arial','', 9);
|
||||||
|
$yp = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$pdf->SetXY (10, $this->tab_top + 10 + $yp);
|
||||||
|
$pdf->MultiCell(30, $this->line_height, $lines[$j][1], 0, 'J', 1);
|
||||||
|
|
||||||
|
$pdf->SetXY (40, $this->tab_top + 10 + $yp);
|
||||||
|
$pdf->MultiCell(80, $this->line_height, $lines[$j][2].' '.$lines[$j][3], 0, 'J', 1);
|
||||||
|
|
||||||
|
$pdf->SetXY (120, $this->tab_top + 10 + $yp);
|
||||||
|
$pdf->MultiCell(40, $this->line_height, '', 0, 'J', 1);
|
||||||
|
|
||||||
|
$pdf->SetXY (160, $this->tab_top + 10 + $yp);
|
||||||
|
$pdf->MultiCell(40, $this->line_height, $lines[$j][4], 0, 'R', 1);
|
||||||
|
$yp = $yp + 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->SetXY (80, $this->tab_top + 10 + $yp);
|
||||||
|
$pdf->MultiCell(40, $this->line_height, $lines[$j][0], 0, 'J', 0);
|
||||||
|
|
||||||
|
$pdf->SetXY (120, $this->tab_top + 10 + $yp);
|
||||||
|
$pdf->MultiCell(40, $this->line_height, $lines[$j][5], 0, 'J', 0);
|
||||||
|
|
||||||
|
$pdf->SetXY (160, $this->tab_top + 10 + $yp);
|
||||||
|
$pdf->MultiCell(40, $this->line_height, $lines[$j][6], 0, 'R', 0);
|
||||||
|
$yp = $yp + 5;
|
||||||
|
|
||||||
|
if ($oldprowid <> $lines[$j][7])
|
||||||
|
{
|
||||||
|
$oldprowid = $lines[$j][7];
|
||||||
|
}
|
||||||
|
|
||||||
|
// if ($i < $this->line_per_page - 1)
|
||||||
|
// {
|
||||||
|
// $pdf->line(10, $this->tab_top + 10 + (($i+1) * $this->line_height), 200, $this->tab_top + 10 + (($i+1) * $this->line_height));
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$pdf->SetXY (10, $this->tab_top + 10 + $yp);
|
|
||||||
$pdf->MultiCell(30, $this->line_height, $lines[$j][1], 0, 'J', 1);
|
|
||||||
|
|
||||||
$pdf->SetXY (40, $this->tab_top + 10 + $yp);
|
|
||||||
$pdf->MultiCell(40, $this->line_height, $lines[$j][2], 0, 'J', 1);
|
|
||||||
|
|
||||||
$pdf->SetXY (80, $this->tab_top + 10 + $yp);
|
|
||||||
$pdf->MultiCell(40, $this->line_height, '', 0, 'J', 1);
|
|
||||||
|
|
||||||
$pdf->SetXY (120, $this->tab_top + 10 + $yp);
|
|
||||||
$pdf->MultiCell(40, $this->line_height, $lines[$j][3], 0, 'J', 1);
|
|
||||||
|
|
||||||
$pdf->SetXY (160, $this->tab_top + 10 + $yp);
|
|
||||||
$pdf->MultiCell(40, $this->line_height, $lines[$j][4], 0, 'R', 1);
|
|
||||||
$yp = $yp + 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
$pdf->SetXY (80, $this->tab_top + 10 + $yp);
|
|
||||||
$pdf->MultiCell(40, $this->line_height, $lines[$j][0], 0, 'J', 0);
|
|
||||||
|
|
||||||
$pdf->SetXY (120, $this->tab_top + 10 + $yp);
|
|
||||||
$pdf->MultiCell(40, $this->line_height, $lines[$j][5], 0, 'J', 0);
|
|
||||||
|
|
||||||
$pdf->SetXY (160, $this->tab_top + 10 + $yp);
|
|
||||||
$pdf->MultiCell(40, $this->line_height, $lines[$j][6], 0, 'R', 0);
|
|
||||||
$yp = $yp + 5;
|
|
||||||
|
|
||||||
if ($oldprowid <> $lines[$j][7])
|
|
||||||
{
|
|
||||||
$oldprowid = $lines[$j][7];
|
|
||||||
}
|
|
||||||
|
|
||||||
// if ($i < $this->line_per_page - 1)
|
|
||||||
// {
|
|
||||||
// $pdf->line(10, $this->tab_top + 10 + (($i+1) * $this->line_height), 200, $this->tab_top + 10 + (($i+1) * $this->line_height));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -179,6 +166,9 @@ class pdf_paiement
|
|||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
$this->month=$month;
|
||||||
|
$this->year=$year;
|
||||||
|
|
||||||
$dir=$_dir.'/'.$year;
|
$dir=$_dir.'/'.$year;
|
||||||
|
|
||||||
if (! is_dir($dir))
|
if (! is_dir($dir))
|
||||||
@ -208,9 +198,8 @@ class pdf_paiement
|
|||||||
|
|
||||||
$sql .= " WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid";
|
$sql .= " WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid";
|
||||||
|
|
||||||
$sql .= " AND date_format(p.datep, '%Y') = " . $year;
|
|
||||||
$sql .= " AND p.fk_paiement = c.id ";
|
$sql .= " AND p.fk_paiement = c.id ";
|
||||||
// $sql .= " AND date_format(p.datep, '%m%Y') = " . $month.$year;
|
$sql .= " AND date_format(p.datep, '%Y%m') = " . sprintf("%04d%02d",$year,$month);
|
||||||
$sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
|
$sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
// print $sql ;
|
// print $sql ;
|
||||||
@ -227,7 +216,7 @@ class pdf_paiement
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
$lines[$i][0] = $objp->facnumber;
|
$lines[$i][0] = $objp->facnumber;
|
||||||
$lines[$i][1] = strftime("%d %B %Y",$objp->dp);
|
$lines[$i][1] = dolibarr_print_date($objp->dp,"%d %B %Y");
|
||||||
$lines[$i][2] = $objp->paiement_type ;
|
$lines[$i][2] = $objp->paiement_type ;
|
||||||
$lines[$i][3] = $objp->num_paiement;
|
$lines[$i][3] = $objp->num_paiement;
|
||||||
$lines[$i][4] = price($objp->paiement_amount);
|
$lines[$i][4] = price($objp->paiement_amount);
|
||||||
@ -260,13 +249,11 @@ class pdf_paiement
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
|
|
||||||
$this->Header($pdf, 1, $pages);
|
$this->Header($pdf, 1, $pages);
|
||||||
|
|
||||||
$this->Body($pdf, 1, $lines);
|
$this->Body($pdf, 1, $lines);
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
$pdf->Output($_file);
|
$pdf->Output($_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,8 @@ SupplierBills=suppliers invoices
|
|||||||
BillContacts=Invoice contacts
|
BillContacts=Invoice contacts
|
||||||
Payment=Payment
|
Payment=Payment
|
||||||
Payments=Payments
|
Payments=Payments
|
||||||
|
PaymentType=Payment type
|
||||||
|
PaymentTypes=Payment types
|
||||||
ReceivedPayments=Received payments
|
ReceivedPayments=Received payments
|
||||||
ReceivedCustomersPayments=Received customers payments
|
ReceivedCustomersPayments=Received customers payments
|
||||||
ReceivedCustomersPaymentsToValid=Received customers payments to validate
|
ReceivedCustomersPaymentsToValid=Received customers payments to validate
|
||||||
|
|||||||
@ -37,6 +37,8 @@ NewPayment=New payment
|
|||||||
Payments=Payments
|
Payments=Payments
|
||||||
ListPayment=List of payments
|
ListPayment=List of payments
|
||||||
ListOfPayments=List of payments
|
ListOfPayments=List of payments
|
||||||
|
ListOfCustomerPayments=List of customer payments
|
||||||
|
ListOfSupplierPayments=Liste of supplier payments
|
||||||
RulesResultDue=- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation pour les factures et tva, les dates d'échéances pour les charges.<br>
|
RulesResultDue=- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation pour les factures et tva, les dates d'échéances pour les charges.<br>
|
||||||
RulesResultInOut=- Il inclut les paiements effectivement réalisés des factures, charges et tva.<br>- Il se base sur la date des paiements de ces factures, charges et tva.<br>
|
RulesResultInOut=- Il inclut les paiements effectivement réalisés des factures, charges et tva.<br>- Il se base sur la date des paiements de ces factures, charges et tva.<br>
|
||||||
RulesCADue=- Il inclut les factures clients dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation de ces factures.<br>
|
RulesCADue=- Il inclut les factures clients dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation de ces factures.<br>
|
||||||
|
|||||||
@ -174,6 +174,8 @@ PriceU=U.P.
|
|||||||
PriceUHT=U.P. HT
|
PriceUHT=U.P. HT
|
||||||
PriceUTTC=U.P. TTC
|
PriceUTTC=U.P. TTC
|
||||||
Amount=Amount
|
Amount=Amount
|
||||||
|
AmountInvoice=Amount invoice
|
||||||
|
AmountPayment=Amount payment
|
||||||
AmountHT=Amount HT
|
AmountHT=Amount HT
|
||||||
AmountTTC=Amount TTC
|
AmountTTC=Amount TTC
|
||||||
AmountVAT=Amount VAT
|
AmountVAT=Amount VAT
|
||||||
|
|||||||
@ -37,6 +37,8 @@ SupplierBills=Factures fournisseurs
|
|||||||
BillContacts=Contacts facture
|
BillContacts=Contacts facture
|
||||||
Payment=Paiement
|
Payment=Paiement
|
||||||
Payments=Paiements
|
Payments=Paiements
|
||||||
|
PaymentType=Type de paiement
|
||||||
|
PaymentTypes=Types de paiements
|
||||||
ReceivedPayments=Paiements reçus
|
ReceivedPayments=Paiements reçus
|
||||||
ReceivedCustomersPayments=Paiements clients reçus
|
ReceivedCustomersPayments=Paiements clients reçus
|
||||||
ReceivedCustomersPaymentsToValid=Paiements clients reçus à valider
|
ReceivedCustomersPaymentsToValid=Paiements clients reçus à valider
|
||||||
|
|||||||
@ -37,6 +37,8 @@ NewPayment=Nouveau paiement
|
|||||||
Payments=Paiements
|
Payments=Paiements
|
||||||
ListPayment=Liste des paiements
|
ListPayment=Liste des paiements
|
||||||
ListOfPayments=Liste des paiements
|
ListOfPayments=Liste des paiements
|
||||||
|
ListOfCustomerPayments=Liste des paiements clients
|
||||||
|
ListOfSupplierPayments=Liste des paiements fournisseurs
|
||||||
RulesResultDue=- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges.<br>
|
RulesResultDue=- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges.<br>
|
||||||
RulesResultInOut=- Il inclut les paiements effectivement réalisés pour les factures, les charges et la TVA.<br>- Il se base sur la date de paiement de ces factures, charges et TVA.<br>
|
RulesResultInOut=- Il inclut les paiements effectivement réalisés pour les factures, les charges et la TVA.<br>- Il se base sur la date de paiement de ces factures, charges et TVA.<br>
|
||||||
RulesCADue=- Il inclut les factures clients dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation de ces factures.<br>
|
RulesCADue=- Il inclut les factures clients dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation de ces factures.<br>
|
||||||
|
|||||||
@ -174,6 +174,8 @@ PriceU=P.U.
|
|||||||
PriceUHT=P.U. HT
|
PriceUHT=P.U. HT
|
||||||
PriceUTTC=P.U. TTC
|
PriceUTTC=P.U. TTC
|
||||||
Amount=Montant
|
Amount=Montant
|
||||||
|
AmountInvoice=Montant facture
|
||||||
|
AmountPayment=Montant paiement
|
||||||
AmountHT=Montant HT
|
AmountHT=Montant HT
|
||||||
AmountTTC=Montant TTC
|
AmountTTC=Montant TTC
|
||||||
AmountVAT=Montant TVA
|
AmountVAT=Montant TVA
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user