Fix: Increase size of payment number

This commit is contained in:
Laurent Destailleur 2010-10-19 19:11:37 +00:00
parent 374d62e0ec
commit dcd86885fc
2 changed files with 54 additions and 97 deletions

View File

@ -448,7 +448,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+41, $tab3_top ); $pdf->SetXY ($tab3_posx+41, $tab3_top );
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+60, $tab3_top ); $pdf->SetXY ($tab3_posx+58, $tab3_top );
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
$y=0; $y=0;
@ -500,10 +500,12 @@ class pdf_crabe extends ModelePDFFactures
} }
// Loop on each payment // Loop on each payment
$sql = "SELECT p.datep as date, pf.amount as amount, p.fk_paiement as type, p.num_paiement as num "; $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,";
$sql.= "FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."paiement_facture as pf "; $sql.= " cp.code";
$sql.= "WHERE pf.fk_paiement = p.rowid and pf.fk_facture = ".$object->id." "; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
$sql.= "ORDER BY p.datep"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
$sql.= " WHERE pf.fk_paiement = p.rowid and pf.fk_facture = ".$object->id;
$sql.= " ORDER BY p.datep";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -511,41 +513,18 @@ class pdf_crabe extends ModelePDFFactures
$i=0; $i=0;
while ($i < $num) { while ($i < $num) {
$y+=3; $y+=3;
$row = $this->db->fetch_row($resql); $row = $this->db->fetch_object($resql);
$pdf->SetXY ($tab3_posx, $tab3_top+$y ); $pdf->SetXY ($tab3_posx, $tab3_top+$y );
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row[0]),'day',false,$outputlangs,true), 0, 'L', 0); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+21, $tab3_top+$y); $pdf->SetXY ($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($row[1]), 0, 'L', 0); $pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+41, $tab3_top+$y); $pdf->SetXY ($tab3_posx+41, $tab3_top+$y);
switch ($row[2]) $oper = $outputlangs->getTradFromKey("PaymentTypeShort" . $row->code);
{
case 1:
$oper = 'TIP';
break;
case 2:
$oper = 'VIR';
break;
case 3:
$oper = 'PRE';
break;
case 4:
$oper = 'LIQ';
break;
case 5:
$oper = 'VAD';
break;
case 6:
$oper = 'CB';
break;
case 7:
$oper = 'CHQ';
break;
}
$oper = $outputlangs->transnoentities("PaymentTypeShort" . $oper);
$pdf->MultiCell(20, 3, $oper, 0, 'L', 0); $pdf->MultiCell(20, 3, $oper, 0, 'L', 0);
$pdf->SetXY ($tab3_posx+60, $tab3_top+$y); $pdf->SetXY ($tab3_posx+58, $tab3_top+$y);
$pdf->MultiCell(20, 3, $row[3], 0, 'L', 0); $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 ); $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 );
@ -915,8 +894,8 @@ class pdf_crabe extends ModelePDFFactures
} }
/** /**
* \brief Affiche la grille des lignes de factures * Affiche la grille des lignes de factures
* \param pdf objet PDF * @param pdf objet PDF
*/ */
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs) function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
{ {

View File

@ -335,13 +335,14 @@ class pdf_oursin extends ModelePDFFactures
$pdf->Rect($tab3_posx, $tab3_top-1, $tab3_width, $tab3_height); $pdf->Rect($tab3_posx, $tab3_top-1, $tab3_width, $tab3_height);
$pdf->SetFont('','',6);
$pdf->SetXY ($tab3_posx, $tab3_top-1 ); $pdf->SetXY ($tab3_posx, $tab3_top-1 );
$pdf->MultiCell(20, 4, $outputlangs->transnoentities("Payment"), 0, 'L', 0); $pdf->MultiCell(20, 4, $outputlangs->transnoentities("Payment"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+21, $tab3_top-1 ); $pdf->SetXY ($tab3_posx+21, $tab3_top-1 );
$pdf->MultiCell(20, 4, $outputlangs->transnoentities("Amount"), 0, 'L', 0); $pdf->MultiCell(20, 4, $outputlangs->transnoentities("Amount"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+41, $tab3_top-1 ); $pdf->SetXY ($tab3_posx+41, $tab3_top-1 );
$pdf->MultiCell(20, 4, $outputlangs->transnoentities("Type"), 0, 'L', 0); $pdf->MultiCell(20, 4, $outputlangs->transnoentities("Type"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+60, $tab3_top-1 ); $pdf->SetXY ($tab3_posx+58, $tab3_top-1 );
$pdf->MultiCell(20, 4, $outputlangs->transnoentities("Num"), 0, 'L', 0); $pdf->MultiCell(20, 4, $outputlangs->transnoentities("Num"), 0, 'L', 0);
$y=0; $y=0;
@ -392,67 +393,44 @@ class pdf_oursin extends ModelePDFFactures
return -1; return -1;
} }
// Loop on each payment // Loop on each payment
$sql = "SELECT p.datep as date, pf.amount as amount, p.fk_paiement as type, p.num_paiement as num "; $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,";
$sql.= "FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."paiement_facture as pf "; $sql.= " cp.code";
$sql.= "WHERE pf.fk_paiement = p.rowid and pf.fk_facture = ".$object->id." "; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
$sql.= "ORDER BY p.datep"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
$resql=$this->db->query($sql); $sql.= " WHERE pf.fk_paiement = p.rowid and pf.fk_facture = ".$object->id;
if ($resql) $sql.= " ORDER BY p.datep";
{ $resql=$this->db->query($sql);
$num = $this->db->num_rows($resql); if ($resql)
$i=0; {
while ($i < $num) $num = $this->db->num_rows($resql);
{ $i=0;
$y+=3; while ($i < $num) {
$row = $this->db->fetch_row($resql); $y+=3;
$row = $this->db->fetch_object($resql);
$pdf->SetXY ($tab3_posx, $tab3_top+$y ); $pdf->SetXY ($tab3_posx, $tab3_top+$y );
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row[0]),'day',false,$outputlangs,true), 0, 'L', 0); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+21, $tab3_top+$y); $pdf->SetXY ($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($row[1]), 0, 'L', 0); $pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+41, $tab3_top+$y); $pdf->SetXY ($tab3_posx+41, $tab3_top+$y);
switch ($row[2]) $oper = $outputlangs->getTradFromKey("PaymentTypeShort" . $row->code);
{
case 1:
$oper = 'TIP';
break;
case 2:
$oper = 'VIR';
break;
case 3:
$oper = 'PRE';
break;
case 4:
$oper = 'LIQ';
break;
case 5:
$oper = 'VAD';
break;
case 6:
$oper = 'CB';
break;
case 7:
$oper = 'CHQ';
break;
}
$oper = $outputlangs->transnoentities("PaymentTypeShort" . $oper);
$pdf->MultiCell(20, 3, $oper, 0, 'L', 0);
$pdf->SetXY ($tab3_posx+60, $tab3_top+$y);
$pdf->MultiCell(20, 3, $row[3], 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 ); $pdf->MultiCell(20, 3, $oper, 0, 'L', 0);
$pdf->SetXY ($tab3_posx+58, $tab3_top+$y);
$pdf->MultiCell(30, 3, $row->num, 0, 'L', 0);
$i++; $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 );
}
}
else
{
$this->error=$outputlangs->trans("ErrorSQL")." sql=".$sql;
dol_syslog($this->db,$this->error, LOG_ERR);
return -1;
}
$i++;
}
}
else
{
$this->error=$this->db->lasterror();
dol_syslog($this->db,$this->error, LOG_ERR);
return -1;
}
} }
/** /**
@ -742,8 +720,8 @@ class pdf_oursin extends ModelePDFFactures
} }
/* /*
* \brief Affiche la grille des lignes de factures * Affiche la grille des lignes de factures
* \param pdf objet PDF * @param pdf objet PDF
*/ */
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs) function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs)
{ {