2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Grand Philippe
2012-12-10 10:02:13 +01:00
parent 158f581f03
commit a91a96e72e
43 changed files with 1252 additions and 572 deletions

View File

@@ -376,7 +376,7 @@ class pdf_crabe extends ModelePDFFactures
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
// TODO : store local taxes types into object lines and remove this
$localtax1_array=getTypeOfLocalTaxFromRate($vatrate,1,$mysoc);
$localtax2_array=getTypeOfLocalTaxFromRate($vatrate,2,$mysoc);
@@ -524,7 +524,12 @@ class pdf_crabe extends ModelePDFFactures
*/
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
$tab3_posx = 120;
global $conf;
$sign=1;
if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
$tab3_posx = 120;
$tab3_top = $posy + 8;
$tab3_width = 80;
$tab3_height = 4;
@@ -535,9 +540,12 @@ class pdf_crabe extends ModelePDFFactures
$default_font_size = pdf_getPDFFontSize($outputlangs);
$title=$outputlangs->transnoentities("PaymentsAlreadyDone");
if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone");
$pdf->SetFont('','', $default_font_size - 3);
$pdf->SetXY($tab3_posx, $tab3_top - 4);
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
$pdf->MultiCell(60, 3, $title, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top);
@@ -620,7 +628,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($tab3_posx, $tab3_top+$y);
$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->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
$pdf->MultiCell(20, 3, price($sign * $row->amount), 0, 'L', 0);
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
@@ -1042,7 +1050,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc), $useborder, 'R', 1);
}
}