94 |
$this->posxdiscount=162; |
$this->posxdiscount=162; |
95 |
$this->postotalht=177; |
$this->postotalht=177; |
96 |
|
|
97 |
|
$this->atleastoneratenotnull=0; |
98 |
$this->atleastonediscount=0; |
$this->atleastonediscount=0; |
99 |
} |
} |
100 |
|
|
171 |
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right |
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right |
172 |
$pdf->SetAutoPageBreak(1,0); |
$pdf->SetAutoPageBreak(1,0); |
173 |
|
|
174 |
|
// Positionne $this->atleastonediscount si on a au moins une remise |
175 |
|
for ($i = 0 ; $i < $nblignes ; $i++) |
176 |
|
{ |
177 |
|
if ($prop->lignes[$i]->remise_percent) |
178 |
|
{ |
179 |
|
$this->atleastonediscount++; |
180 |
|
} |
181 |
|
} |
182 |
|
|
183 |
$this->_pagehead($pdf, $prop); |
$this->_pagehead($pdf, $prop); |
184 |
|
|
185 |
$tab_top = 96; |
$pagenb = 1; |
186 |
|
$tab_top = 90; |
187 |
|
$tab_top_newpage = 50; |
188 |
$tab_height = 110; |
$tab_height = 110; |
189 |
|
|
|
$pdf->SetFont('Arial','', 9); |
|
|
|
|
190 |
$iniY = $tab_top + 8; |
$iniY = $tab_top + 8; |
191 |
$curY = $tab_top + 8; |
$curY = $tab_top + 8; |
192 |
$nexY = $tab_top + 8; |
$nexY = $tab_top + 8; |
221 |
$libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($prop->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($prop->lignes[$i]->date_end).")"; |
$libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($prop->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($prop->lignes[$i]->date_end).")"; |
222 |
} |
} |
223 |
|
|
224 |
|
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page |
225 |
|
|
226 |
$pdf->SetXY ($this->posxdesc-1, $curY); |
$pdf->SetXY ($this->posxdesc-1, $curY); |
227 |
$pdf->MultiCell(108, 4, $libelleproduitservice, 0, 'J'); |
$pdf->MultiCell(108, 4, $libelleproduitservice, 0, 'J'); |
228 |
|
|
260 |
|
|
261 |
$nexY+=2; // Passe espace entre les lignes |
$nexY+=2; // Passe espace entre les lignes |
262 |
|
|
263 |
if ($nexY > 200 && $i < $nblignes - 1) |
if ($nexY > 200 && $i < ($nblignes - 1)) |
264 |
{ |
{ |
265 |
$this->_tableau($pdf, $tab_top, $tab_height, $nexY); |
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY); |
266 |
|
$this->_pagefoot($pdf); |
267 |
|
|
268 |
|
// Nouvelle page |
269 |
$pdf->AddPage(); |
$pdf->AddPage(); |
270 |
$nexY = $iniY; |
$pagenb++; |
271 |
$this->_pagehead($pdf, $prop); |
$this->_pagehead($pdf, $prop, 0); |
272 |
|
|
273 |
|
$nexY = $tab_top_newpage + 8; |
274 |
$pdf->SetTextColor(0,0,0); |
$pdf->SetTextColor(0,0,0); |
275 |
$pdf->SetFont('Arial','', 10); |
$pdf->SetFont('Arial','', 10); |
276 |
} |
} |
277 |
|
|
278 |
} |
} |
279 |
$this->_tableau($pdf, $tab_top, $tab_height, $nexY); |
// Affiche cadre tableau |
280 |
|
if ($pagenb == 1) |
281 |
|
{ |
282 |
|
$this->_tableau($pdf, $tab_top, $tab_height, $nexY); |
283 |
|
$bottomlasttab=$tab_top + $tab_height + 1; |
284 |
|
} |
285 |
|
else |
286 |
|
{ |
287 |
|
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY); |
288 |
|
$bottomlasttab=$tab_top_newpage + $tab_height + 1; |
289 |
|
} |
290 |
|
|
291 |
$posy=$this->_tableau_tot($pdf, $prop, ""); |
$deja_regle = ""; |
292 |
|
|
293 |
|
$posy=$this->_tableau_tot($pdf, $prop, $deja_regle, $bottomlasttab); |
294 |
|
|
295 |
|
if ($deja_regle) { |
296 |
|
$this->_tableau_versements($pdf, $fac, $posy); |
297 |
|
} |
298 |
|
|
299 |
/* |
/* |
300 |
* Mode de règlement |
* Mode de règlement |
432 |
* \param deja_regle Montant deja regle |
* \param deja_regle Montant deja regle |
433 |
* \return y Position pour suite |
* \return y Position pour suite |
434 |
*/ |
*/ |
435 |
function _tableau_tot(&$pdf, $prop, $deja_regle) |
function _tableau_tot(&$pdf, $prop, $deja_regle, $posy) |
436 |
{ |
{ |
437 |
global $langs; |
global $langs; |
438 |
$langs->load("main"); |
$langs->load("main"); |
439 |
$langs->load("bills"); |
$langs->load("bills"); |
440 |
|
|
441 |
$tab2_top = 207; |
$tab2_top = $posy; |
442 |
$tab2_hl = 5; |
$tab2_hl = 5; |
443 |
$tab2_height = $tab2_hl * 4; |
$tab2_height = $tab2_hl * 4; |
444 |
$pdf->SetFont('Arial','', 9); |
$pdf->SetFont('Arial','', 9); |
555 |
*/ |
*/ |
556 |
function _tableau(&$pdf, $tab_top, $tab_height, $nexY) |
function _tableau(&$pdf, $tab_top, $tab_height, $nexY) |
557 |
{ |
{ |
558 |
global $langs; |
global $langs,$conf; |
559 |
$langs->load("main"); |
$langs->load("main"); |
560 |
$langs->load("bills"); |
$langs->load("bills"); |
561 |
|
|
562 |
|
// Montants exprimés en (en tab_top - 1) |
563 |
|
$pdf->SetTextColor(0,0,0); |
564 |
|
$pdf->SetFont('Arial','',8); |
565 |
|
$titre = $langs->trans("AmountInCurrency",$langs->trans("Currency".$conf->monnaie)); |
566 |
|
$pdf->Text($this->page_largeur - $this->marge_droite - $pdf->GetStringWidth($titre), $tab_top-1, $titre); |
567 |
|
|
568 |
|
$pdf->SetDrawColor(128,128,128); |
569 |
|
|
570 |
// Rect prend une longueur en 3eme param |
// Rect prend une longueur en 3eme param |
571 |
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); |
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); |
572 |
// line prend une position y en 3eme param |
// line prend une position y en 3eme param |
598 |
|
|
599 |
if ($this->atleastonediscount) |
if ($this->atleastonediscount) |
600 |
{ |
{ |
601 |
$pdf->line($this->postotalht-1, $tab_top, $this->postotalht-1, $tab_top + $tab_height); |
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); |
602 |
} |
} |
603 |
$pdf->SetXY ($this->postotalht-1, $tab_top+2); |
$pdf->SetXY ($this->postotalht-1, $tab_top+2); |
604 |
$pdf->MultiCell(23,2, $langs->trans("TotalHT"),'','C'); |
$pdf->MultiCell(23,2, $langs->trans("TotalHT"),'','C'); |
606 |
} |
} |
607 |
|
|
608 |
/* |
/* |
609 |
* \brief Affiche en-tête propale |
* \brief Affiche en-tête propale |
610 |
* \param pdf objet PDF |
* \param pdf objet PDF |
611 |
* \param fac objet propale |
* \param fac objet propale |
612 |
*/ |
* \param showadress 0=non, 1=oui |
613 |
function _pagehead(&$pdf, $prop) |
*/ |
614 |
|
function _pagehead(&$pdf, $prop, $showadress=1) |
615 |
{ |
{ |
616 |
global $langs,$conf,$mysoc; |
global $langs,$conf,$mysoc; |
617 |
|
|
654 |
$pdf->SetTextColor(0,0,60); |
$pdf->SetTextColor(0,0,60); |
655 |
$pdf->MultiCell(100, 4, $langs->trans("Proposal")." ".$prop->ref, '' , 'R'); |
$pdf->MultiCell(100, 4, $langs->trans("Proposal")." ".$prop->ref, '' , 'R'); |
656 |
$pdf->SetFont('Arial','',12); |
$pdf->SetFont('Arial','',12); |
657 |
$pdf->SetXY(100,$posy+6); |
|
658 |
|
$posy+=6; |
659 |
|
$pdf->SetXY(100,$posy); |
660 |
$pdf->SetTextColor(0,0,60); |
$pdf->SetTextColor(0,0,60); |
661 |
$pdf->MultiCell(100, 4, $langs->trans("Date")." : " . dolibarr_print_date($prop->date,"%d %b %Y"), '', 'R'); |
$pdf->MultiCell(100, 4, $langs->trans("Date")." : " . dolibarr_print_date($prop->date,"%d %b %Y"), '', 'R'); |
662 |
|
|
663 |
|
if ($showadress) |
664 |
|
{ |
665 |
// Emetteur |
// Emetteur |
666 |
$posy=42; |
$posy=42; |
667 |
$hautcadre=40; |
$hautcadre=40; |
732 |
$pdf->SetFont('Arial','',9); |
$pdf->SetFont('Arial','',9); |
733 |
$pdf->SetXY(102,$posy+8); |
$pdf->SetXY(102,$posy+8); |
734 |
$pdf->MultiCell(86,4, $carac_client); |
$pdf->MultiCell(86,4, $carac_client); |
735 |
|
} |
|
// Montants exprimés en |
|
|
$pdf->SetTextColor(0,0,0); |
|
|
$pdf->SetFont('Arial','',10); |
|
|
$titre = $langs->trans("AmountInCurrency",$langs->trans("Currency".$conf->monnaie)); |
|
|
$pdf->Text(200 - $pdf->GetStringWidth($titre), 94, $titre); |
|
736 |
|
|
737 |
} |
} |
738 |
|
|