SetXY(52, $y-7.5); $pdf->MultiCell(166, 10, $poz[nazwa], 0, "L"); /* Okres */ if ($poz[typ] == "UO") { $pdf->SetFont("Tahoma","",7); $data=$poz[data_rozpoczecia]; $od=substr($data,8,2)."-".substr($data,5,2)."-".substr($data,0,4); $data=$poz[zafakturowane_do]; $do=substr($data,8,2)."-".substr($data,5,2)."-".substr($data,0,4); $pdf->SetXY(52, $pdf->GetY()-2); $pdf->MultiCell(116, 10, "od ".$od." do ".$do, 0, "L"); $pdf->SetFont("Tahoma","",9); } $h=$pdf->GetY()-($y-7.5)+4; $center = $y-7.5+$h/2; /* PKWiU, itd. */ if ($i) $pdf->TextR(50.5, $center, $i); $pdf->TextC(242.67-$dx/2, $center, $poz[pkwiu]); $jm = mysql_fetch_assoc(mysql_query("SELECT skrot FROM jednostki_miar WHERE id='".$poz[jm_id]."'")); $pdf->TextC(284.85-$dx*1.5, $center, $jm[skrot]); $pdf->TextC(331.25-$dx*3, $center, str_replace(".",",",$poz[il]+0)); $stawka = mysql_fetch_assoc(mysql_query("SELECT stawka FROM stawki_vat WHERE id='".$poz[stawka_vat_id]."'")); if ($poz[netto]) { $netto = $poz[cena]; $brutto = round($poz[cena] * (100+$stawka[stawka]) / 100, 2); } else { $brutto = $poz[cena]; $netto = round($poz[cena] * 100 / (100+$stawka[stawka]), 2); } setlocale(LC_NUMERIC, pl_PL); $c=sprintf("%.2f%s", $netto, $tahoe ? " ".$waluta : ""); setlocale(LC_NUMERIC, C); $pdf->TextR(405-2*$dx, $center, $c); if (isset($stawka[stawka])) $pdf->TextR(455.5-4*$dx, $center, $stawka[stawka]."%"); setlocale(LC_NUMERIC, pl_PL); $c=sprintf("%.2f%s", $poz[wartosc_vat]*$kurs, $tahoe ? " PLN" : ""); setlocale(LC_NUMERIC, C); $pdf->TextR(506.5-2*$dx, $center, $c); setlocale(LC_NUMERIC, pl_PL); $c=sprintf("%.2f%s", $poz[wartosc_netto], $tahoe ? " ".$waluta : ""); setlocale(LC_NUMERIC, C); $pdf->TextR(557, $center, $c); return $h; } function ramki($topy, $sumh, $dx) { global $pdf; /* Ramki */ $pdf->Rect(36, $topy-12, 16.87, $sumh); $pdf->Rect(52.87, $topy-12, 168.71, $sumh); $pdf->Rect(221.58, $topy-12, 42.18-$dx, $sumh); $pdf->Rect(263.76-$dx, $topy-12, 42.18-$dx, $sumh); $pdf->Rect(305.94-2*$dx, $topy-12, 50.61-2*$dx, $sumh); $pdf->Rect(356.55-4*$dx, $topy-12, 50.61+2*$dx, $sumh); $pdf->Rect(407.16-2*$dx, $topy-12, 50.61-2*$dx, $sumh); $pdf->Rect(457.77-4*$dx, $topy-12, 50.61+2*$dx, $sumh); $pdf->Rect(508.39-2*$dx, $topy-12, 50.61+2*$dx, $sumh); } function daty_wystawienia($pl, $en, $tresc, $eng, $y) { global $pdf; $pdf->TextR(503.5,$y,$pl); if ($eng) { $pdf->SetFont("Tahoma","",7); $pdf->TextR(503.5,$y+8,$en); $pdf->SetFont("Tahoma","",9); } $pdf->TextR(558.5,$y+$eng*5,$tresc); return $y + 10 + $eng*8; } function stopka($pl, $en, $tresc, $eng, $y, $tresc_eng = "") { global $pdf; $pdf->Text(38, $y, $pl, 2); if ($eng) { $pdf->SetFont("Tahoma","",7); $pdf->Text(38,$y+8,$en); $pdf->SetFont("Tahoma","",9); } if (($eng) && ($tresc_eng)) { $pdf->Text(132.14, $y, $tresc); $pdf->SetFont("Tahoma","",7); $pdf->Text(132.14, $y+8, $tresc_eng); $pdf->SetFont("Tahoma","",9); } else { $pdf->Text(132.14, $y+$eng*4, $tresc); } return $y + 13 + $eng*7; } ?>