function pageFooter() { $this->Cell(186, 6, '', 'T', 1); //stampo il castelletto $this->SetY(180); $this->SetFont('helvetica', 'B', 48); $this->SetTextColor(255, 150, 150); $this->Cell(186, 20, 'N O N F I S C A L E', 0, 1, 'C'); $this->SetTextColor(0, 0, 0); $this->SetY(212); $this->SetFont('helvetica', '', 8); $this->Cell(62, 6, 'Pagamento', 'LTR', 0, 'C', 1); $this->Cell(68, 6, 'Castelletto I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'T O T A L E F A T T U R A', 'LTR', 1, 'C', 1); $this->Cell(62, 6, $this->pagame['descri'], 'LBR', 0, 'L'); $this->Cell(18, 4, 'Imponibile', 'LR', 0, 'C', 1); $this->Cell(32, 4, 'Aliquota', 'LR', 0, 'C', 1); $this->Cell(18, 4, 'Imposta', 'LR', 1, 'C', 1); $this->docVars->setTotal(); foreach ($this->docVars->cast as $key => $value) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($value['impcast']) . ' ', 'LR', 0, 'R'); $this->Cell(32, 4, $value['descriz'], 0, 0, 'C'); $this->Cell(18, 4, gaz_format_number($value['ivacast']) . ' ', 'LR', 1, 'R'); } //azzero il castelletto foreach ($this->docVars->castel as $i => $value) { unset($this->docVars->castel[$i]); } $totimpmer = $this->docVars->totimpmer; $speseincasso = $this->docVars->speseincasso; $totimpfat = $this->docVars->totimpfat; $totivafat = $this->docVars->totivafat; $vettor = $this->docVars->vettor; $impbol = $this->docVars->impbol; $totriport = $this->docVars->totriport; $taxstamp = $this->docVars->taxstamp; //effettuo il calcolo degli importi delle scadenze $totpag = $totimpfat + $impbol + $totriport + $totivafat; $ratpag = CalcolaScadenze($totpag, $this->giorno, $this->mese, $this->anno, $this->pagame['tipdec'], $this->pagame['giodec'], $this->pagame['numrat'], $this->pagame['tiprat'], $this->pagame['mesesc'], $this->pagame['giosuc']); if ($ratpag) { //allungo l'array fino alla 4^ scadenza $ratpag['import'] = array_pad($ratpag['import'], 4, ''); $ratpag['giorno'] = array_pad($ratpag['giorno'], 4, ''); $ratpag['mese'] = array_pad($ratpag['mese'], 4, ''); $ratpag['anno'] = array_pad($ratpag['anno'], 4, ''); } else { for ($i = 0; $i <= 3; $i++) { $ratpag['import'][$i] = ""; $ratpag['giorno'][$i] = ""; $ratpag['mese'][$i] = ""; $ratpag['anno'][$i] = ""; } } //stampo i totali $this->SetY(200); $this->SetFillColor(hexdec(substr($this->colore, 0, 2)), hexdec(substr($this->colore, 2, 2)), hexdec(substr($this->colore, 4, 2))); $this->SetFont('helvetica', '', 9); $this->Cell(36, 6, 'Totale merce', 'LTR', 0, 'C', 1); $this->Cell(16, 6, '% Sconto', 'LTR', 0, 'C', 1); $this->Cell(24, 6, 'Spese Incasso', 'LTR', 0, 'C', 1); $this->Cell(26, 6, 'Trasporto', 'LTR', 0, 'C', 1); $this->Cell(36, 6, 'Tot.Imponibile', 'LTR', 0, 'C', 1); $this->Cell(26, 6, 'Tot. I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(22, 6, 'Bolli', 'LTR', 1, 'C', 1); if ($totimpmer > 0) { $this->Cell(36, 6, gaz_format_number($totimpmer), 'LBR', 0, 'C'); } else { $this->Cell(36, 6, '', 'LBR'); } if ($this->tesdoc['sconto'] > 0) { $this->Cell(16, 6, gaz_format_number($this->tesdoc['sconto']), 'LBR', 0, 'C'); } else { $this->Cell(16, 6, '', 'LBR'); } if ($speseincasso > 0) { $this->Cell(24, 6, gaz_format_number($speseincasso), 'LBR', 0, 'C'); } else { $this->Cell(24, 6, '', 'LBR'); } if ($this->trasporto > 0) { $this->Cell(26, 6, gaz_format_number($this->trasporto), 'LBR', 0, 'C'); } else { $this->Cell(26, 6, '', 'LBR'); } if ($totimpfat > 0) { $this->Cell(36, 6, gaz_format_number($totimpfat), 'LBR', 0, 'C'); } else { $this->Cell(36, 6, '', 'LBR'); } if ($totivafat > 0) { $this->Cell(26, 6, gaz_format_number($totivafat), 'LBR', 0, 'C'); } else { $this->Cell(26, 6, '', 'LBR'); } if ($impbol > 0) { $this->Cell(22, 6, gaz_format_number($impbol), 'LBR', 1, 'C'); } else { $this->Cell(22, 6, '', 'LBR'); } $this->SetY(218); $this->Cell(130); $totale = $totimpfat + $totivafat + $impbol; $this->SetFont('helvetica', 'B', 18); $this->Cell(56, 24, '€ ' . gaz_format_number($totale), 'LBR', 1, 'C'); $this->SetY(224); $this->SetFont('helvetica', '', 9); $this->Cell(62, 6, 'Banca d\'appoggio', 'LTR', 1, 'C', 1); $this->Cell(62, 6, $this->banapp['descri'], 'LR', 1, 'L'); if (!empty($this->banapp['descri'])) { $this->Cell(62, 6, ' ABI ' . sprintf("%05d", $this->banapp['codabi']) . ' CAB ' . $this->banapp['codcab'], 'LRB', 1, 'C'); } else { $this->Cell(62, 6, '', 'LRB', 1); } $this->Cell(130, 6, 'Date di Scadenza e Importo Rate', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'Totale dei riporti', 'LTR', 1, 'C', 1); $this->Cell(32, 6, $ratpag['giorno']['0'] . '-' . $ratpag['mese']['0'] . '-' . $ratpag['anno']['0'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['1'] . '-' . $ratpag['mese']['1'] . '-' . $ratpag['anno']['1'], 'LR', 0, 'C'); $this->Cell(32, 6, $ratpag['giorno']['2'] . '-' . $ratpag['mese']['2'] . '-' . $ratpag['anno']['2'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['3'] . '-' . $ratpag['mese']['3'] . '-' . $ratpag['anno']['3'], 'LR', 0, 'C'); $this->Cell(56, 6, '', 'R', 1, 'C'); if ($ratpag['import']['0'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['0']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['1'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['1']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($ratpag['import']['2'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['2']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['3'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['3']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($totriport != 0) { $this->Cell(56, 6, gaz_format_number($totriport), 'BR', 1, 'C'); } else { $this->Cell(56, 6, '', 'BR', 1); } }
function pageFooter() { $y = $this->GetY(); $this->Rect(10, $y, 186, 200 - $y); //questa marca le linee dx e sx del documento //stampo il castelletto $this->SetY(212); $this->Cell(62, 6, 'Pago', 'LTR', 0, 'C', 1); $this->Cell(68, 6, 'Resumen Tasas I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'TOTALES HONORARIOS', 'LTR', 1, 'C', 1); $this->SetFont('helvetica', '', 8); $this->Cell(62, 6, $this->pagame['descri'], 'LBR', 0, 'L'); $this->Cell(18, 4, 'Imponible', 'LR', 0, 'C', 1); $this->Cell(32, 4, 'Tasa', 'LR', 0, 'C', 1); $this->Cell(18, 4, 'Impuesto', 'LR', 1, 'C', 1); $totTrasporto = $this->tottraspo; $this->docVars->setTotal($totTrasporto); foreach ($this->docVars->cast as $key => $value) { if ($this->tesdoc['id_tes'] > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($value['impcast']) . ' ', 'LR', 0, 'R'); $this->Cell(32, 4, $value['descriz'], 0, 0, 'C'); $this->Cell(18, 4, gaz_format_number($value['ivacast']) . ' ', 'LR', 1, 'R'); } else { $this->Cell(62); $this->Cell(68, 4, '', 'LR', 1); } } //azzero il castelletto foreach ($this->docVars->castel as $i => $value) { unset($this->docVars->castel[$i]); } //azzero il trasporto $this->tottraspo = 0.0; $totimpmer = $this->docVars->totimpmer; $speseincasso = $this->docVars->speseincasso; $totimpfat = $this->docVars->totimpfat; $totivafat = $this->docVars->totivafat; $vettor = $this->docVars->vettor; $impbol = $this->docVars->impbol; $totriport = $this->docVars->totriport; $ritenuta = $this->docVars->tot_ritenute; if ($impbol > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($impbol) . ' ', 0, 0, 'R'); $this->Cell(32, 4, $this->docVars->iva_bollo['descri'], 'LR', 0, 'C'); $this->Cell(18, 4, gaz_format_number($this->docVars->iva_bollo['aliquo'] * $impbol) . ' ', 0, 1, 'R'); } //effettuo il calcolo degli importi delle scadenze $totpag = $totimpfat + $impbol + $totriport + $totivafat - $ritenuta; $ratpag = CalcolaScadenze($totpag, $this->giorno, $this->mese, $this->anno, $this->pagame['tipdec'], $this->pagame['giodec'], $this->pagame['numrat'], $this->pagame['tiprat'], $this->pagame['mesesc'], $this->pagame['giosuc']); if ($ratpag) { //allungo l'array fino alla 4^ scadenza $ratpag['import'] = array_pad($ratpag['import'], 4, ''); $ratpag['giorno'] = array_pad($ratpag['giorno'], 4, ''); $ratpag['mese'] = array_pad($ratpag['mese'], 4, ''); $ratpag['anno'] = array_pad($ratpag['anno'], 4, ''); } else { for ($i = 0; $i <= 3; $i++) { $ratpag['import'][$i] = ""; $ratpag['giorno'][$i] = ""; $ratpag['mese'][$i] = ""; $ratpag['anno'][$i] = ""; } } //stampo i totali $this->SetY(200); $this->SetFillColor(hexdec(substr($this->colore, 0, 2)), hexdec(substr($this->colore, 2, 2)), hexdec(substr($this->colore, 4, 2))); $this->SetFont('helvetica', '', 9); $this->Cell(36, 6, 'Tot. Cuerpo', 'LTR', 0, 'C', 1); $this->Cell(16, 6, '% Descuento', 'LTR', 0, 'C', 1); $this->Cell(24, 6, 'Gasto en efectivo', 'LTR', 0, 'C', 1); $this->Cell(26, 6, 'Trasporte', 'LTR', 0, 'C', 1); $this->Cell(36, 6, 'Tot.Imponible', 'LTR', 0, 'C', 1); $this->Cell(26, 6, 'Tot. I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(22, 6, 'Sellos', 'LTR', 1, 'C', 1); if ($totimpmer > 0) { $this->Cell(36, 6, gaz_format_number($totimpmer), 'LBR', 0, 'C'); } else { $this->Cell(36, 6, '', 'LBR'); } if ($this->tesdoc['sconto'] > 0) { $this->Cell(16, 6, gaz_format_number($this->tesdoc['sconto']), 'LBR', 0, 'C'); } else { $this->Cell(16, 6, '', 'LBR'); } if ($speseincasso > 0) { $this->Cell(24, 6, gaz_format_number($speseincasso), 'LBR', 0, 'C'); } else { $this->Cell(24, 6, '', 'LBR'); } if ($totTrasporto > 0) { $this->Cell(26, 6, gaz_format_number($totTrasporto), 'LBR', 0, 'C'); } else { $this->Cell(26, 6, '', 'LBR'); } if ($totimpfat > 0) { $this->Cell(36, 6, gaz_format_number($totimpfat), 'LBR', 0, 'C'); } else { $this->Cell(36, 6, '', 'LBR'); } if ($totivafat > 0) { $this->Cell(26, 6, gaz_format_number($totivafat), 'LBR', 0, 'C'); } else { $this->Cell(26, 6, '', 'LBR'); } if ($impbol > 0) { $this->Cell(22, 6, gaz_format_number($impbol), 'LBR', 1, 'C'); } else { $this->Cell(22, 6, '', 'LBR'); } $this->SetY(218); $this->Cell(130); $totale = $totimpfat + $totivafat + $impbol; if ($this->tesdoc['id_tes'] > 0) { if ($ritenuta > 0) { $this->SetFont('helvetica', 'B', 12); $this->Cell(56, 6, '€ ' . gaz_format_number($totale), 'LBR', 2, 'R'); $this->SetFont('helvetica', '', 12); $this->Cell(56, 6, 'Totale descuento: $ ' . gaz_format_number($ritenuta), 'LR', 2, 'R'); $this->SetFont('helvetica', '', 9); $this->Cell(56, 6, 'T O T A L A P A G A R ', 'LTR', 2, 'C', 1); $this->SetFont('helvetica', 'B', 12); $this->Cell(56, 6, '€ ' . gaz_format_number($totale - $ritenuta), 'LBR', 1, 'R'); } else { $this->SetFont('helvetica', 'B', 18); $this->Cell(56, 24, '€ ' . gaz_format_number($totale), 'LBR', 1, 'C'); } } else { $this->Cell(56, 24, '', 'LBR', 1); } $this->SetY(224); $this->SetFont('helvetica', '', 9); if (!empty($this->banapp['descri']) and $this->pagame['tippag'] != 'D') { $this->Cell(62, 6, 'Banco de apoyo', 'LTR', 1, 'C', 1); $this->Cell(62, 6, $this->banapp['descri'], 'LR', 1); $this->Cell(62, 6, ' ABI ' . sprintf("%05d", $this->banapp['codabi']) . ' CAB ' . $this->banapp['codcab'], 'LRB', 1, 'C'); } elseif (!empty($this->banacc['iban'])) { $this->Cell(62, 6, 'Banca de abono', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banacc['ragso1'], 'LR', 1); $this->Cell(62, 6, 'IBAN ' . $this->banacc['iban'], 'LRB', 1, 'C'); } else { $this->Cell(62, 6, '', 'LTR', 1, '', 1); $this->Cell(62, 6, '', 'LR', 1); $this->Cell(62, 6, '', 'LRB', 1); } $this->Cell(130, 6, 'Fecha de vencimiento y el importe a tanto alzado', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'Total de saldos', 'LTR', 1, 'C', 1); $this->Cell(32, 6, $ratpag['giorno']['0'] . '-' . $ratpag['mese']['0'] . '-' . $ratpag['anno']['0'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['1'] . '-' . $ratpag['mese']['1'] . '-' . $ratpag['anno']['1'], 'LR', 0, 'C'); $this->Cell(32, 6, $ratpag['giorno']['2'] . '-' . $ratpag['mese']['2'] . '-' . $ratpag['anno']['2'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['3'] . '-' . $ratpag['mese']['3'] . '-' . $ratpag['anno']['3'], 'LR', 0, 'C'); $this->Cell(56, 6, '', 'R', 1, 'C'); if ($ratpag['import']['0'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['0']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['1'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['1']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($ratpag['import']['2'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['2']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['3'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['3']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($totriport != 0) { $this->Cell(56, 6, gaz_format_number($totriport), 'BR', 1, 'C'); } else { $this->Cell(56, 6, '', 'BR', 1); } }
function pageFooter() { $y = $this->GetY(); $this->Rect(10, $y, 186, 200 - $y); //questa marca le linee dx e sx del documento //stampo il castelletto $this->SetY(212); $this->Cell(62, 6, 'Pagamento', 'LTR', 0, 'C', 1); $this->Cell(68, 6, 'Castelletto I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'T O T A L E P A R C E L L A', 'LTR', 1, 'C', 1); $this->SetFont('helvetica', '', 8); $this->Cell(62, 6, $this->pagame['descri'], 'LBR', 0, 'L'); $this->Cell(18, 4, 'Imponibile', 'LR', 0, 'C', 1); $this->Cell(32, 4, 'Aliquota', 'LR', 0, 'C', 1); $this->Cell(18, 4, 'Imposta', 'LR', 1, 'C', 1); $this->docVars->setTotal(); foreach ($this->docVars->cast as $key => $value) { if ($this->tesdoc['id_tes'] > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($value['impcast']) . ' ', 'LR', 0, 'R'); $this->Cell(32, 4, $value['descriz'], 0, 0, 'C'); $this->Cell(18, 4, gaz_format_number($value['ivacast']) . ' ', 'LR', 1, 'R'); } else { $this->Cell(62); $this->Cell(68, 4, '', 'LR', 1); } } //azzero il castelletto foreach ($this->docVars->castel as $i => $value) { unset($this->docVars->castel[$i]); } //azzero il trasporto $this->tottraspo = 0.0; $totimpmer = $this->docVars->totimpmer; $speseincasso = $this->docVars->speseincasso; $totimpfat = $this->docVars->totimpfat; $totivafat = $this->docVars->totivafat; $totivasplitpay = $this->docVars->totivasplitpay; $vettor = $this->docVars->vettor; $impbol = $this->docVars->impbol; $totriport = $this->docVars->totriport; $ritenuta = $this->docVars->tot_ritenute; $taxstamp = $this->docVars->taxstamp; if ($this->virtual_taxstamp == 0 || $this->virtual_taxstamp == 3) { // azzero i bolli in caso di non addebito al cliente $taxstamp = 0; } //effettuo il calcolo degli importi delle scadenze $totpag = $totimpfat + $impbol + $totriport + $totivafat - $ritenuta + $taxstamp - $totivasplitpay; $ratpag = CalcolaScadenze($totpag, $this->giorno, $this->mese, $this->anno, $this->pagame['tipdec'], $this->pagame['giodec'], $this->pagame['numrat'], $this->pagame['tiprat'], $this->pagame['mesesc'], $this->pagame['giosuc']); if ($ratpag) { //allungo l'array fino alla 4^ scadenza $ratpag['import'] = array_pad($ratpag['import'], 4, ''); $ratpag['giorno'] = array_pad($ratpag['giorno'], 4, ''); $ratpag['mese'] = array_pad($ratpag['mese'], 4, ''); $ratpag['anno'] = array_pad($ratpag['anno'], 4, ''); } else { for ($i = 0; $i <= 3; $i++) { $ratpag['import'][$i] = ""; $ratpag['giorno'][$i] = ""; $ratpag['mese'][$i] = ""; $ratpag['anno'][$i] = ""; } } //stampo i totali $this->SetY(200); $this->SetFillColor(hexdec(substr($this->colore, 0, 2)), hexdec(substr($this->colore, 2, 2)), hexdec(substr($this->colore, 4, 2))); $this->SetFont('helvetica', '', 9); $this->Cell(36, 6, 'Tot. Corpo', 'LTR', 0, 'C', 1); $this->Cell(16, 6, '% Sconto', 'LTR', 0, 'C', 1); $this->Cell(24, 6, 'Spese Incasso', 'LTR', 0, 'C', 1); $this->Cell(26, 6, 'Trasporto', 'LTR', 0, 'C', 1); $this->Cell(36, 6, 'Tot.Imponibile', 'LTR', 0, 'C', 1); $this->Cell(26, 6, 'Tot. I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(22, 6, 'Bolli (tratte)', 'LTR', 1, 'C', 1); if ($totimpmer > 0) { $this->Cell(36, 6, gaz_format_number($totimpmer), 'LBR', 0, 'C'); } else { $this->Cell(36, 6, '', 'LBR'); } if ($this->tesdoc['sconto'] > 0) { $this->Cell(16, 6, gaz_format_number($this->tesdoc['sconto']), 'LBR', 0, 'C'); } else { $this->Cell(16, 6, '', 'LBR'); } if ($speseincasso > 0) { $this->Cell(24, 6, gaz_format_number($speseincasso), 'LBR', 0, 'C'); } else { $this->Cell(24, 6, '', 'LBR'); } $this->Cell(26, 6, '', 'LBR'); if ($totimpfat > 0) { $this->Cell(36, 6, gaz_format_number($totimpfat), 'LBR', 0, 'C'); } else { $this->Cell(36, 6, '', 'LBR'); } if ($totivafat > 0) { $this->Cell(26, 6, gaz_format_number($totivafat), 'LBR', 0, 'C'); } else { $this->Cell(26, 6, '', 'LBR'); } if ($impbol > 0) { $this->Cell(22, 6, gaz_format_number($impbol), 'LBR', 1, 'C'); } else { $this->Cell(22, 6, '', 'LBR'); } $this->SetY(218); $this->Cell(130); $totale = $totimpfat + $totivafat + $impbol; if ($this->tesdoc['id_tes'] > 0) { if ($ritenuta > 0) { $this->SetFont('helvetica', 'B', 12); $this->Cell(56, 6, '€ ' . gaz_format_number($totale), 'LBR', 2, 'R'); $this->SetFont('helvetica', '', 12); $this->Cell(56, 6, 'Totale ritenute: € ' . gaz_format_number($ritenuta), 'LR', 2, 'R'); $this->SetFont('helvetica', '', 9); $this->Cell(56, 6, 'T O T A L E A P A G A R E', 'LTR', 2, 'C', 1); $this->SetFont('helvetica', 'B', 12); $this->Cell(56, 6, '€ ' . gaz_format_number($totale - $ritenuta), 'LBR', 1, 'R'); } else { $this->SetFont('helvetica', 'B', 18); $this->Cell(56, 24, '€ ' . gaz_format_number($totale), 'LBR', 1, 'C'); } } else { $this->Cell(56, 24, '', 'LBR', 1); } $this->SetY(224); $this->SetFont('helvetica', '', 9); if (!empty($this->banapp['descri']) and $this->pagame['tippag'] != 'D') { $this->Cell(62, 6, 'Banca d\'appoggio', 'LTR', 1, 'C', 1); $this->Cell(62, 6, $this->banapp['descri'], 'LR', 1); $this->Cell(62, 6, ' ABI ' . sprintf("%05d", $this->banapp['codabi']) . ' CAB ' . $this->banapp['codcab'], 'LRB', 1, 'C'); } elseif (!empty($this->banacc['iban'])) { $this->Cell(62, 6, 'Banca d\'accredito', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banacc['ragso1'], 'LR', 1); $this->Cell(62, 6, 'IBAN ' . $this->banacc['iban'], 'LRB', 1, 'C'); } else { $this->Cell(62, 6, '', 'LTR', 1, '', 1); $this->Cell(62, 6, '', 'LR', 1); $this->Cell(62, 6, '', 'LRB', 1); } $this->Cell(130, 6, 'Date di Scadenza e Importo Rate', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'Totale dei riporti', 'LTR', 1, 'C', 1); $this->Cell(32, 6, $ratpag['giorno']['0'] . '-' . $ratpag['mese']['0'] . '-' . $ratpag['anno']['0'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['1'] . '-' . $ratpag['mese']['1'] . '-' . $ratpag['anno']['1'], 'LR', 0, 'C'); $this->Cell(32, 6, $ratpag['giorno']['2'] . '-' . $ratpag['mese']['2'] . '-' . $ratpag['anno']['2'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['3'] . '-' . $ratpag['mese']['3'] . '-' . $ratpag['anno']['3'], 'LR', 0, 'C'); $this->Cell(56, 6, '', 'R', 1, 'C'); if ($ratpag['import']['0'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['0']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['1'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['1']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($ratpag['import']['2'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['2']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['3'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['3']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($totriport != 0) { $this->Cell(56, 6, gaz_format_number($totriport), 'BR', 1, 'C'); } else { $this->Cell(56, 6, '', 'BR', 1); } }
foreach ($rs as $k=>$v) { switch($v['tes']['tipdoc']) { case "FAD":case "FAI":case "FAP":case "FND": $reg=2;$op=1;$da_c='A';$da_p='D';$kac=$admin_aziend['ivaven'];break; case "FNC":$reg=2;$op=2;$da_c='D';$da_p='A';$kac=$admin_aziend['ivaven'];break; case "VCO":$reg=4;$op=1;$da_c='A';$da_p='D';$kac=$admin_aziend['ivacor'];break; case "VRI":$reg=4;$op=1;$da_c='A';$da_p='D';$kac=$admin_aziend['ivacor'];break; case "AFA":$reg=6;$op=1;$da_c='D';$da_p='A';$kac=$admin_aziend['ivaacq'];break; case 'AFC':$reg=6;$op=2;$da_c='A';$da_p='D';$kac=$admin_aziend['ivaacq'];break; case 'AFD':$reg=6;$op=1;$da_c='D';$da_p='A';$kac=$admin_aziend['ivaacq'];break; default:$reg=0;$op=0;break; } $tot=computeTot($v['vat']); // fine calcolo totali // calcolo le rate al fine di inserire le partite aperte $rate = CalcolaScadenze($tot['tot'],substr($v['tes']['datfat'],8,2),substr($v['tes']['datfat'],5,2),substr($v['tes']['datfat'],0,4),$v['tes']['tipdec'],$v['tes']['giodec'],$v['tes']['numrat'],$v['tes']['tiprat'],$v['tes']['mesesc'],$v['tes']['giosuc']); // inserisco la testata $newValue=array('caucon'=>$v['tes']['tipdoc'], 'descri'=>$script_transl['doc_type_value'][$v['tes']['tipdoc']], 'id_doc'=>$v['tes']['id_tes'], 'datreg'=>$v['tes']['datfat'], 'seziva'=>$v['tes']['seziva'], 'protoc'=>$v['tes']['protoc'], 'numdoc'=>$v['tes']['numfat'], 'datdoc'=>$v['tes']['datfat'], 'clfoco'=>$v['tes']['clfoco'], 'regiva'=>$reg, 'operat'=>$op ); tesmovInsert($newValue); $tes_id = gaz_dbi_last_id();
function pageFooter() { $y = $this->GetY(); $this->Rect(10, $y, 186, 188 - $y); //questa marca le linee dx e sx del documento //stampo il castelletto $this->SetY(208); $this->Cell(62, 6, 'Pagamento', 'LTR', 0, 'C', 1); $this->Cell(68, 6, 'Castelletto I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'T O T A L E F A T T U R A', 'LTR', 1, 'C', 1); $this->SetFont('helvetica', '', 8); $this->Cell(62, 6, $this->pagame['descri'], 'LR', 0, 'C'); $this->Cell(18, 4, 'Imponibile', 'LR', 0, 'C', 1); $this->Cell(32, 4, 'Aliquota', 'LR', 0, 'C', 1); $this->Cell(18, 4, 'Imposta', 'LR', 1, 'C', 1); $this->docVars->setTotal(); foreach ($this->docVars->cast as $key => $value) { if ($this->tesdoc['id_tes'] > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($value['impcast']) . ' ', 'R', 0, 'R'); $this->Cell(32, 4, $value['descriz'], 0, 0, 'C', 0, '', 1); $this->Cell(18, 4, gaz_format_number($value['ivacast']) . ' ', 'L', 1, 'R'); } else { $this->Cell(62); $this->Cell(68, 4, '', 'LR', 1); } } $totimpmer = $this->docVars->totimpmer; $speseincasso = $this->docVars->speseincasso; $totimpfat = $this->docVars->totimpfat; $totivafat = $this->docVars->totivafat; $totivasplitpay = $this->docVars->totivasplitpay; $vettor = $this->docVars->vettor; $impbol = $this->docVars->impbol; $totriport = $this->docVars->totriport; $ritenuta = $this->docVars->tot_ritenute; $taxstamp = $this->docVars->taxstamp; if ($this->virtual_taxstamp == 0 || $this->virtual_taxstamp == 3) { // azzero i bolli in caso di non addebito al cliente $taxstamp = 0; } //effettuo il calcolo degli importi delle scadenze $totpag = $totimpfat + $impbol + $totriport + $totivafat - $ritenuta + $taxstamp - $totivasplitpay; $ratpag = CalcolaScadenze($totpag, $this->giorno, $this->mese, $this->anno, $this->pagame['tipdec'], $this->pagame['giodec'], $this->pagame['numrat'], $this->pagame['tiprat'], $this->pagame['mesesc'], $this->pagame['giosuc']); if ($ratpag) { //allungo l'array fino alla 4^ scadenza $ratpag['import'] = array_pad($ratpag['import'], 4, ''); $ratpag['giorno'] = array_pad($ratpag['giorno'], 4, ''); $ratpag['mese'] = array_pad($ratpag['mese'], 4, ''); $ratpag['anno'] = array_pad($ratpag['anno'], 4, ''); } else { for ($i = 0; $i <= 3; $i++) { $ratpag['import'][$i] = ""; $ratpag['giorno'][$i] = ""; $ratpag['mese'][$i] = ""; $ratpag['anno'][$i] = ""; } } //stampo i totali $this->SetY(188); $this->SetFont('helvetica', '', 9); $this->Cell(82, 5, 'Agente', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Peso netto', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Peso lordo', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'N.colli', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Volume', 'LTR', 1, 'C', 1); $this->Cell(82, 5, $this->agente, 'LR'); if ($this->tesdoc['net_weight'] > 0) { $this->Cell(26, 5, gaz_format_number($this->tesdoc['net_weight']), 'LR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LR'); } if ($this->tesdoc['gross_weight'] > 0) { $this->Cell(26, 5, gaz_format_number($this->tesdoc['gross_weight']), 'LR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LR'); } if ($this->tesdoc['units'] > 0) { $this->Cell(26, 5, $this->tesdoc['units'], 'LR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LR'); } if ($this->tesdoc['volume'] > 0) { $this->Cell(26, 5, gaz_format_number($this->tesdoc['volume']), 'LR', 1, 'C'); } else { $this->Cell(26, 5, '', 'LR', 1); } $this->Cell(36, 5, 'Tot. Corpo', 'LTR', 0, 'C', 1); $this->Cell(16, 5, '% Sconto', 'LTR', 0, 'C', 1); $this->Cell(24, 5, 'Spese Incasso', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Trasporto', 'LTR', 0, 'C', 1); $this->Cell(36, 5, 'Tot.Imponibile', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Tot. I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(22, 5, 'Bolli(tratte)', 'LTR', 1, 'C', 1); if ($totimpmer > 0) { $this->Cell(36, 5, gaz_format_number($totimpmer), 'LBR', 0, 'C'); } else { $this->Cell(36, 5, '', 'LBR'); } if ($this->tesdoc['sconto'] > 0) { $this->Cell(16, 5, gaz_format_number($this->tesdoc['sconto']), 'LBR', 0, 'C'); } else { $this->Cell(16, 5, '', 'LBR'); } if ($speseincasso > 0) { $this->Cell(24, 5, gaz_format_number($speseincasso), 'LBR', 0, 'C'); } else { $this->Cell(24, 5, '', 'LBR'); } if ($this->trasporto > 0) { $this->Cell(26, 5, gaz_format_number($this->trasporto), 'LBR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LBR'); } if ($totimpfat > 0) { $this->Cell(36, 5, gaz_format_number($totimpfat), 'LBR', 0, 'C'); } else { $this->Cell(36, 5, '', 'LBR'); } if ($totivafat > 0) { $this->Cell(26, 5, gaz_format_number($totivafat), 'LBR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LBR'); } if ($impbol > 0) { $this->Cell(22, 5, gaz_format_number($impbol), 'LBR', 0, 'C'); } else { $this->Cell(22, 5, '', 'LBR'); } $this->SetY(214); $this->Cell(130); $totale = $totimpfat + $totivafat + $impbol + $taxstamp; if ($this->tesdoc['id_tes'] > 0) { if ($ritenuta > 0) { $this->SetFont('helvetica', 'B', 11); $this->Cell(56, 6, '€ ' . gaz_format_number($totale), 'LBR', 2, 'R'); $this->SetFont('helvetica', '', 11); $this->Cell(56, 4, 'Totale ritenute: € ' . gaz_format_number($ritenuta), 'LR', 2, 'R'); $this->Cell(56, 6, 'Totale a pagare: € ' . gaz_format_number($totale - $ritenuta - $totivasplitpay), 'LBR', 1, 'R'); } else { $this->SetFont('helvetica', 'B', 18); $this->Cell(56, 16, '€ ' . gaz_format_number($totale - $totivasplitpay), 'LBR', 1, 'C'); } } else { $this->Cell(56, 24, '', 'LBR', 1); } $this->SetY(220); $this->SetFont('helvetica', '', 9); if (!empty($this->banapp['descri']) and $this->pagame['tippag'] != 'D') { $this->Cell(62, 5, 'Banca d\'appoggio', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banapp['descri'], 'LR', 1); $this->Cell(62, 5, ' ABI ' . sprintf("%05d", $this->banapp['codabi']) . ' CAB ' . $this->banapp['codcab'], 'LRB', 0, 'C'); } elseif (!empty($this->banacc['iban'])) { $this->Cell(62, 5, 'Banca d\'accredito', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banacc['ragso1'], 'LR', 1); $this->Cell(62, 5, 'IBAN ' . $this->banacc['iban'], 'LRB'); } else { $this->Cell(62, 5, '', 'LTR', 1, '', 1); $this->Cell(62, 5, '', 'LR', 1); $this->Cell(62, 5, '', 'LRB', 0); } $this->Cell(124, 5, 'Date di Scadenza e Importo Rate', 'LTR', 1, 'C', 1); $this->Cell(62, 5, 'Spedizione', 'LTR', 0, 'C', 1); if ($this->pagame['tippag'] != 'D') { $this->Cell(31, 5, $ratpag['giorno']['0'] . '-' . $ratpag['mese']['0'] . '-' . $ratpag['anno']['0'], 'LR', 0, 'C'); $this->Cell(31, 5, $ratpag['giorno']['1'] . '-' . $ratpag['mese']['1'] . '-' . $ratpag['anno']['1'], 'LR', 0, 'C'); $this->Cell(31, 5, $ratpag['giorno']['2'] . '-' . $ratpag['mese']['2'] . '-' . $ratpag['anno']['2'], 'LR', 0, 'C'); $this->Cell(31, 5, $ratpag['giorno']['3'] . '-' . $ratpag['mese']['3'] . '-' . $ratpag['anno']['3'], 'LR', 1, 'C'); $this->Cell(62, 5, $this->tesdoc['spediz'], 'LRB', 0, 'C'); if ($ratpag['import']['0'] != 0) { $this->Cell(31, 5, gaz_format_number($ratpag['import']['0']), 'LBR', 0, 'C'); } else { $this->Cell(31, 5, '', 'LBR'); } if ($ratpag['import']['1'] != 0) { $this->Cell(31, 5, gaz_format_number($ratpag['import']['1']), 'LBR', 0, 'C'); } else { $this->Cell(31, 5, '', 'LBR'); } if ($ratpag['import']['2'] != 0) { $this->Cell(31, 5, gaz_format_number($ratpag['import']['2']), 'LBR', 0, 'C'); } else { $this->Cell(31, 5, '', 'LBR'); } if ($ratpag['import']['3'] != 0) { $this->Cell(31, 5, gaz_format_number($ratpag['import']['3']), 'LBR', 1, 'C'); } else { $this->Cell(31, 5, '', 'LBR', 1); } } else { $this->Cell(124, 5, '', 'LR', 1); $this->Cell(62, 5, $this->tesdoc['spediz'], 'LRB', 0, 'C'); $this->Cell(124, 5, '', 'LBR', 1); } if ($this->pagame['incaut'] == 'S' || $this->pagame['tippag'] == 'C') { $this->docVars->open_drawer(); } if (empty($this->docVars->vettor['ragione_sociale'])) { $signature = ' Firma del conducente :'; } else { $signature = ' Firma/vettore:'; } $this->Cell(35, 5, $signature, 'LT', 0, 'L', 1); $this->Cell(55, 5); $this->Cell(40, 5, 'Inizio trasporto', 'LTR', 0, 'C', 1); $this->Cell(56, 5, 'Firma destinatario', 'LTR', 1, 'C', 1); $this->Cell(90, 5, '', 'L'); if ($this->tesdoc['id_tes'] > 0) { $this->Cell(40, 5, $this->day . '.' . $this->month . '.' . $this->year . ' ore ' . $this->ora . ':' . $this->min, 'LBR', 0, 'C'); } else { $this->Cell(40, 5, 'data: ore: ', 'LBR', 0, 'L'); } $this->Cell(56, 5, '', 'LR', 1); $this->Cell(130, 5, $this->docVars->vettor['ragione_sociale'] . ' ' . $this->docVars->vettor['indirizzo'] . ' ' . $this->docVars->vettor['citta'] . ' ' . $this->docVars->vettor['provincia'], 'LBR', 0, 'L', 0, '', 1); $this->Cell(56, 5, '', 'LBR', 1); if (!empty($this->docVars->vettor['ragione_sociale'])) { $this->StartPageGroup(); $this->appendix = true; $this->addPage(); $this->SchedaTrasporto(); $this->appendix = false; } }
function pageFooter() { $y = $this->GetY(); $this->Rect(10, $y, 186, 212 - $y); //questa marca le linee dx e sx del documento //stampo il castelletto $this->SetY(212); $this->Cell(62, 6, 'Pagamento', 'LTR', 0, 'C', 1); $this->Cell(68, 6, 'Castelletto I.V.A.', 'LTR', 1, 'C', 1); $this->SetFont('helvetica', '', 8); $this->Cell(62, 6, $this->pagame['descri'], 'LBR', 0, 'L'); $this->Cell(18, 4, 'Imponibile', 'LR', 0, 'C', 1); $this->Cell(32, 4, 'Aliquota', 'LR', 0, 'C', 1); $this->Cell(18, 4, 'Imposta', 'LR', 1, 'C', 1); $totTrasporto = $this->tottraspo; $this->docVars->setTotal($totTrasporto); foreach ($this->docVars->cast as $key => $value) { if ($this->tesdoc['id_tes'] > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($value['impcast']) . ' ', 'LR', 0, 'R'); $this->Cell(32, 4, $value['descriz'], 0, 0, 'C'); $this->Cell(18, 4, gaz_format_number($value['ivacast']) . ' ', 'LR', 1, 'R'); } else { $this->Cell(62); $this->Cell(68, 4, '', 'LR', 1); } } //azzero il castelletto foreach ($this->docVars->castel as $i => $value) { unset($this->docVars->castel[$i]); } //azzero il trasporto $this->tottraspo = 0.0; $totimpmer = $this->docVars->totimpmer; $speseincasso = $this->docVars->speseincasso; $totimpfat = $this->docVars->totimpfat; $totivafat = $this->docVars->totivafat; $vettor = $this->docVars->vettor; $impbol = $this->docVars->impbol; $totriport = $this->docVars->totriport; if ($impbol > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($impbol) . ' ', 0, 0, 'R'); $this->Cell(32, 4, $this->docVars->iva_bollo['descri'], 'LR', 0, 'C'); $this->Cell(18, 4, gaz_format_number($this->docVars->iva_bollo['aliquo'] * $impbol) . ' ', 0, 1, 'R'); } //effettuo il calcolo degli importi delle scadenze $totpag = $totimpfat + $impbol + $totriport + $totivafat; $ratpag = CalcolaScadenze($totpag, $this->giorno, $this->mese, $this->anno, $this->pagame['tipdec'], $this->pagame['giodec'], $this->pagame['numrat'], $this->pagame['tiprat'], $this->pagame['mesesc'], $this->pagame['giosuc']); if ($ratpag) { //allungo l'array fino alla 4^ scadenza $ratpag['import'] = array_pad($ratpag['import'], 4, ''); $ratpag['giorno'] = array_pad($ratpag['giorno'], 4, ''); $ratpag['mese'] = array_pad($ratpag['mese'], 4, ''); $ratpag['anno'] = array_pad($ratpag['anno'], 4, ''); } else { for ($i = 0; $i <= 3; $i++) { $ratpag['import'][$i] = ""; $ratpag['giorno'][$i] = ""; $ratpag['mese'][$i] = ""; $ratpag['anno'][$i] = ""; } } //stampo i totali $this->SetXY(140, 212); $this->SetFont('helvetica', '', 8); $this->Cell(56, 4, 'Spese Incasso', 'LTR', 2, 'C', 1); if ($speseincasso > 0) { $this->Cell(56, 3, gaz_format_number($speseincasso), 'LBR', 2, 'C'); } else { $this->Cell(56, 3, '', 'LBR', 2); } $this->Cell(56, 4, 'Tot.Imponibile', 'LTR', 2, 'C', 1); if ($totimpfat > 0) { $this->Cell(56, 3, gaz_format_number($totimpfat), 'LBR', 2, 'C'); } else { $this->Cell(56, 3, '', 'LBR', 2); } $this->Cell(56, 4, 'Tot. I.V.A.', 'LTR', 2, 'C', 1); if ($totivafat > 0) { $this->Cell(56, 3, gaz_format_number($totivafat), 'LBR', 2, 'C'); } else { $this->Cell(56, 3, '', 'LBR', 2); } $this->Cell(56, 4, 'Bolli', 'LTR', 2, 'C', 1); if ($impbol > 0) { $this->Cell(56, 3, gaz_format_number($impbol), 'LBR', 1, 'C'); } else { $this->Cell(56, 3, '', 'LBR', 1); } $this->SetY(218); $this->Cell(130); $totale = $totimpfat + $totivafat + $impbol; $this->SetY(224); $this->SetFont('helvetica', '', 9); if (!empty($this->banapp['descri']) and $this->pagame['tippag'] != 'D') { $this->Cell(62, 6, 'Banca d\'appoggio', 'LTR', 1, 'C', 1); $this->Cell(62, 6, $this->banapp['descri'], 'LR', 1); $this->Cell(62, 6, ' ABI ' . sprintf("%05d", $this->banapp['codabi']) . ' CAB ' . $this->banapp['codcab'], 'LRB', 1, 'C'); } elseif (!empty($this->banacc['iban'])) { $this->Cell(62, 6, 'Banca d\'accredito', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banacc['ragso1'], 'LR', 1); $this->Cell(62, 6, 'IBAN ' . $this->banacc['iban'], 'LRB', 1, 'C'); } else { $this->Cell(62, 6, '', 'LTR', 1, '', 1); $this->Cell(62, 6, '', 'LR', 1); $this->Cell(62, 6, '', 'LRB', 1); } $this->Cell(130, 6, 'Date di Scadenza e Importo Rate', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'T O T A L E', 'LTR', 1, 'C', 1); $this->Cell(32, 6, $ratpag['giorno']['0'] . '-' . $ratpag['mese']['0'] . '-' . $ratpag['anno']['0'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['1'] . '-' . $ratpag['mese']['1'] . '-' . $ratpag['anno']['1'], 'LR', 0, 'C'); $this->Cell(32, 6, $ratpag['giorno']['2'] . '-' . $ratpag['mese']['2'] . '-' . $ratpag['anno']['2'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['3'] . '-' . $ratpag['mese']['3'] . '-' . $ratpag['anno']['3'], 'LR', 0, 'C'); $this->SetFont('helvetica', 'B', 18); if ($this->tesdoc['id_tes'] > 0) { $this->Cell(56, 12, '€ ' . gaz_format_number($totale), 'LBR', 1, 'C'); } else { $this->Cell(56, 12, '', 'LBR', 1); } $this->Ln(-6); $this->SetFont('helvetica', '', 9); if ($ratpag['import']['0'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['0']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['1'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['1']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($ratpag['import']['2'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['2']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['3'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['3']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } }
function pageFooter() { //effettuo il calcolo degli importi delle scadenze $ratpag = CalcolaScadenze($this->docVars->totale, $this->giorno, $this->mese, $this->anno, $this->pagame['tipdec'], $this->pagame['giodec'], $this->pagame['numrat'], $this->pagame['tiprat'], $this->pagame['mesesc'], $this->pagame['giosuc']); if ($ratpag) { //allungo l'array fino alla 4^ scadenza $ratpag['import'] = array_pad($ratpag['import'], 4, ''); $ratpag['giorno'] = array_pad($ratpag['giorno'], 4, ''); $ratpag['mese'] = array_pad($ratpag['mese'], 4, ''); $ratpag['anno'] = array_pad($ratpag['anno'], 4, ''); } else { for ($i = 0; $i <= 3; $i++) { $ratpag['import'][$i] = ""; $ratpag['giorno'][$i] = ""; $ratpag['mese'][$i] = ""; $ratpag['anno'][$i] = ""; } } //FINE calcolo scadenze //stampo i totali $y = $this->GetY(); $this->Rect(10, $y, 186, 212 - $y); //questa marca le linee dx e sx del documento //stampo il castelletto $this->SetY(212); $this->Cell(62, 6, 'Pago', 'LTR', 0, 'C', 1); $this->Cell(68, 6, 'Resumen Tasas I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'T O T A L F A C T U R A', 'LTR', 1, 'C', 1); $this->SetFont('helvetica', '', 8); $this->Cell(62, 6, $this->pagame['descri'], 'LBR', 0, 'L'); $this->Cell(18, 4, 'Imponible', 'LR', 0, 'C', 1); $this->Cell(32, 4, 'Tasa', 'LR', 0, 'C', 1); $this->Cell(18, 4, 'Impuesto', 'LR', 1, 'C', 1); foreach ($this->docVars->castel as $v) { if ($this->tesdoc['id_tes'] > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($v['importo']) . ' ', 'LR', 0, 'R'); $this->Cell(32, 4, $v['descri'], 0, 0, 'C'); $this->Cell(18, 4, gaz_format_number($v['iva']) . ' ', 'LR', 1, 'R'); } else { $this->Cell(62); $this->Cell(68, 4, '', 'LR', 1); } } $this->SetY(218); $this->SetFont('helvetica', 'B', 16); $this->Cell(130); $this->Cell(56, 12, '$ ' . gaz_format_number($this->docVars->totale), 'LR', 1, 'C'); $this->SetY(224); $this->SetFont('helvetica', '', 9); if (!empty($this->banacc['iban'])) { $this->Cell(62, 6, 'Banco de abono', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banacc['ragso1'], 'LR', 1); $this->Cell(62, 6, 'IBAN ' . $this->banacc['iban'], 'LRB', 1, 'C'); } else { $this->Cell(62, 6, '', 'LTR', 1, '', 1); $this->Cell(62, 6, '', 'LR', 1); $this->Cell(62, 6, '', 'LRB', 1); } $this->Cell(130, 6, 'Fecha de vencimiento y el importe a tanto alzado', 'LTR', 1, 'C', 1); $this->Cell(32, 6, $ratpag['giorno']['0'] . '-' . $ratpag['mese']['0'] . '-' . $ratpag['anno']['0'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['1'] . '-' . $ratpag['mese']['1'] . '-' . $ratpag['anno']['1'], 'LR', 0, 'C'); $this->Cell(32, 6, $ratpag['giorno']['2'] . '-' . $ratpag['mese']['2'] . '-' . $ratpag['anno']['2'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['3'] . '-' . $ratpag['mese']['3'] . '-' . $ratpag['anno']['3'], 'LR', 1, 'C'); if ($ratpag['import']['0'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['0']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['1'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['1']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($ratpag['import']['2'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['2']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['3'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['3']), 'LBR', 1, 'C'); } else { $this->Cell(33, 6, '', 'LBR', 1); } $this->SetXY(140, 230); $this->SetFont('helvetica', '', 10); $this->MultiCell(56, 30, "\n adjunta el recibo n." . $this->tesdoc['numdoc'] . " expedido el mismo dia con las cajas registradoras:\n\n" . $this->docVars->ecr['descri'], 'LBR', 1, 'J'); }
function pageFooter() { $y = $this->GetY(); $this->Rect(10, $y, 186, 188 - $y); //questa marca le linee dx e sx del documento //stampo il castelletto $this->SetY(208); $this->Cell(62, 6, 'Pago', 'LTR', 0, 'C', 1); $this->Cell(68, 6, 'Resumen tasas I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'T O T A L E F A C T U R A', 'LTR', 1, 'C', 1); $this->SetFont('helvetica', '', 8); $this->Cell(62, 6, $this->pagame['descri'], 'LR', 0, 'C'); $this->Cell(18, 4, 'Imponible', 'LR', 0, 'C', 1); $this->Cell(32, 4, 'Tasa', 'LR', 0, 'C', 1); $this->Cell(18, 4, 'Impuesto', 'LR', 1, 'C', 1); $this->docVars->setTotal($this->tesdoc['traspo']); foreach ($this->docVars->cast as $key => $value) { if ($this->tesdoc['id_tes'] > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($value['impcast']) . ' ', 'R', 0, 'R'); $this->Cell(32, 4, $value['descriz'], 0, 0, 'C'); $this->Cell(18, 4, gaz_format_number($value['ivacast']) . ' ', 'L', 1, 'R'); } else { $this->Cell(62); $this->Cell(68, 4, '', 'LR', 1); } } $totimpmer = $this->docVars->totimpmer; $speseincasso = $this->docVars->speseincasso; $totimpfat = $this->docVars->totimpfat; $totivafat = $this->docVars->totivafat; $vettor = $this->docVars->vettor; $impbol = $this->docVars->impbol; $totriport = $this->docVars->totriport; $ritenuta = $this->docVars->tot_ritenute; if ($impbol > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($impbol) . ' ', 0, 0, 'R'); $this->Cell(32, 4, $this->docVars->iva_bollo['descri'], 'LR', 0, 'C'); $this->Cell(18, 4, gaz_format_number($this->docVars->iva_bollo['aliquo'] * $impbol) . ' ', 0, 1, 'R'); } //effettuo il calcolo degli importi delle scadenze $totpag = $totimpfat + $impbol + $totriport + $totivafat - $ritenuta; $ratpag = CalcolaScadenze($totpag, $this->giorno, $this->mese, $this->anno, $this->pagame['tipdec'], $this->pagame['giodec'], $this->pagame['numrat'], $this->pagame['tiprat'], $this->pagame['mesesc'], $this->pagame['giosuc']); if ($ratpag) { //allungo l'array fino alla 4^ scadenza $ratpag['import'] = array_pad($ratpag['import'], 4, ''); $ratpag['giorno'] = array_pad($ratpag['giorno'], 4, ''); $ratpag['mese'] = array_pad($ratpag['mese'], 4, ''); $ratpag['anno'] = array_pad($ratpag['anno'], 4, ''); } else { for ($i = 0; $i <= 3; $i++) { $ratpag['import'][$i] = ""; $ratpag['giorno'][$i] = ""; $ratpag['mese'][$i] = ""; $ratpag['anno'][$i] = ""; } } //stampo i totali $this->SetY(188); $this->SetFont('helvetica', '', 9); $this->Cell(82, 5, 'Agente', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Peso neto', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Peso bruto', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'N. paquetes', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Volumen', 'LTR', 1, 'C', 1); $this->Cell(82, 5, $this->agente, 'LR'); if ($this->tesdoc['net_weight'] > 0) { $this->Cell(26, 5, gaz_format_number($this->tesdoc['net_weight']), 'LR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LR'); } if ($this->tesdoc['gross_weight'] > 0) { $this->Cell(26, 5, gaz_format_number($this->tesdoc['gross_weight']), 'LR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LR'); } if ($this->tesdoc['units'] > 0) { $this->Cell(26, 5, $this->tesdoc['units'], 'LR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LR'); } if ($this->tesdoc['volume'] > 0) { $this->Cell(26, 5, gaz_format_number($this->tesdoc['volume']), 'LR', 1, 'C'); } else { $this->Cell(26, 5, '', 'LR', 1); } $this->Cell(36, 5, 'Tot. Cuerpo', 'LTR', 0, 'C', 1); $this->Cell(16, 5, '% Descuento', 'LTR', 0, 'C', 1); $this->Cell(24, 5, 'Gastos en efectivo', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Trasporte', 'LTR', 0, 'C', 1); $this->Cell(36, 5, 'Tot.Imponible', 'LTR', 0, 'C', 1); $this->Cell(26, 5, 'Tot. I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(22, 5, 'Sellos', 'LTR', 1, 'C', 1); if ($totimpmer > 0) { $this->Cell(36, 5, gaz_format_number($totimpmer), 'LBR', 0, 'C'); } else { $this->Cell(36, 5, '', 'LBR'); } if ($this->tesdoc['sconto'] > 0) { $this->Cell(16, 5, gaz_format_number($this->tesdoc['sconto']), 'LBR', 0, 'C'); } else { $this->Cell(16, 5, '', 'LBR'); } if ($speseincasso > 0) { $this->Cell(24, 5, gaz_format_number($speseincasso), 'LBR', 0, 'C'); } else { $this->Cell(24, 5, '', 'LBR'); } if ($this->tesdoc['traspo'] > 0) { $this->Cell(26, 5, gaz_format_number($this->tesdoc['traspo']), 'LBR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LBR'); } if ($totimpfat > 0) { $this->Cell(36, 5, gaz_format_number($totimpfat), 'LBR', 0, 'C'); } else { $this->Cell(36, 5, '', 'LBR'); } if ($totivafat > 0) { $this->Cell(26, 5, gaz_format_number($totivafat), 'LBR', 0, 'C'); } else { $this->Cell(26, 5, '', 'LBR'); } if ($impbol > 0) { $this->Cell(22, 5, gaz_format_number($impbol), 'LBR', 0, 'C'); } else { $this->Cell(22, 5, '', 'LBR'); } $this->SetY(214); $this->Cell(130); $totale = $totimpfat + $totivafat + $impbol; if ($this->tesdoc['id_tes'] > 0) { if ($ritenuta > 0) { $this->SetFont('helvetica', 'B', 11); $this->Cell(56, 6, '€ ' . gaz_format_number($totale), 'LBR', 2, 'R'); $this->SetFont('helvetica', '', 11); $this->Cell(56, 4, 'Totales de las deducciones: $ ' . gaz_format_number($ritenuta), 'LR', 2, 'R'); $this->Cell(56, 6, 'Totales a pagar: $ ' . gaz_format_number($totale - $ritenuta), 'LBR', 1, 'R'); } else { $this->SetFont('helvetica', 'B', 18); $this->Cell(56, 16, '$ ' . gaz_format_number($totale), 'LBR', 1, 'C'); } } else { $this->Cell(56, 24, '', 'LBR', 1); } $this->SetY(220); $this->SetFont('helvetica', '', 9); if (!empty($this->banapp['descri']) and $this->pagame['tippag'] != 'D') { $this->Cell(62, 5, 'Banco de apoyo', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banapp['descri'], 'LR', 1); $this->Cell(62, 5, ' ABI ' . sprintf("%05d", $this->banapp['codabi']) . ' CAB ' . $this->banapp['codcab'], 'LRB', 0, 'C'); } elseif (!empty($this->banacc['iban'])) { $this->Cell(62, 5, 'Banca de abono', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banacc['ragso1'], 'LR', 1); $this->Cell(62, 5, 'IBAN ' . $this->banacc['iban'], 'LRB'); } else { $this->Cell(62, 5, '', 'LTR', 1, '', 1); $this->Cell(62, 5, '', 'LR', 1); $this->Cell(62, 5, '', 'LRB', 0); } $this->Cell(124, 5, 'Fecha de vencimiento y el importe a cantidad alzada', 'LTR', 1, 'C', 1); $this->Cell(62, 5, 'Envio', 'LTR', 0, 'C', 1); if ($this->pagame['tippag'] != 'D') { $this->Cell(31, 5, $ratpag['giorno']['0'] . '-' . $ratpag['mese']['0'] . '-' . $ratpag['anno']['0'], 'LR', 0, 'C'); $this->Cell(31, 5, $ratpag['giorno']['1'] . '-' . $ratpag['mese']['1'] . '-' . $ratpag['anno']['1'], 'LR', 0, 'C'); $this->Cell(31, 5, $ratpag['giorno']['2'] . '-' . $ratpag['mese']['2'] . '-' . $ratpag['anno']['2'], 'LR', 0, 'C'); $this->Cell(31, 5, $ratpag['giorno']['3'] . '-' . $ratpag['mese']['3'] . '-' . $ratpag['anno']['3'], 'LR', 1, 'C'); $this->Cell(62, 5, $this->tesdoc['spediz'], 'LRB', 0, 'C'); if ($ratpag['import']['0'] != 0) { $this->Cell(31, 5, gaz_format_number($ratpag['import']['0']), 'LBR', 0, 'C'); } else { $this->Cell(31, 5, '', 'LBR'); } if ($ratpag['import']['1'] != 0) { $this->Cell(31, 5, gaz_format_number($ratpag['import']['1']), 'LBR', 0, 'C'); } else { $this->Cell(31, 5, '', 'LBR'); } if ($ratpag['import']['2'] != 0) { $this->Cell(31, 5, gaz_format_number($ratpag['import']['2']), 'LBR', 0, 'C'); } else { $this->Cell(31, 5, '', 'LBR'); } if ($ratpag['import']['3'] != 0) { $this->Cell(31, 5, gaz_format_number($ratpag['import']['3']), 'LBR', 1, 'C'); } else { $this->Cell(31, 5, '', 'LBR', 1); } } else { $this->Cell(124, 5, '', 'LR', 1); $this->Cell(62, 5, $this->tesdoc['spediz'], 'LRB', 0, 'C'); $this->Cell(124, 5, '', 'LBR', 1); } if ($this->pagame['incaut'] == 'S' || $this->pagame['tippag'] == 'C') { $this->docVars->open_drawer(); } $this->Cell(25, 5, ' Firma / transportista:', 'LT', 0, 'L', 1); $this->Cell(65, 5); $this->Cell(40, 5, 'Inizio trasporte', 'LTR', 0, 'C', 1); $this->Cell(56, 5, 'Firma destinatario', 'LTR', 1, 'C', 1); $this->Cell(90, 5, '', 'L'); if ($this->tesdoc['id_tes'] > 0) { $this->Cell(40, 5, $this->day . '.' . $this->month . '.' . $this->year . ' ore ' . $this->ora . ':' . $this->min, 'LBR', 0, 'C'); } else { $this->Cell(40, 5, 'data: ore: ', 'LBR', 0, 'L'); } $this->Cell(56, 5, '', 'LR', 1); $this->Cell(130, 5, $this->docVars->vettor['ragione_sociale'] . ' ' . $this->docVars->vettor['indirizzo'] . ' ' . $this->docVars->vettor['citta'] . ' ' . $this->docVars->vettor['provincia'], 'LBR', 0, 'L'); $this->Cell(56, 5, '', 'LBR', 1); if (!empty($this->docVars->vettor['ragione_sociale'])) { $this->StartPageGroup(); $this->appendix = true; $this->addPage(); $this->SchedaTrasporto(); $this->appendix = false; } }
function createArrayDebiti($result, $pagame, $utsval) { // scopo di questa funzione e' quella di creare l'array dei DEBITI verso il fornitore in base // alla condizione di pagamento passata tramite la seconda variabile. global $gTables; $parzi = 0.0; $progr = 0.0; $righiDebiti = array(); $rigo = 0; while ($movimenti = gaz_dbi_fetch_array($result)) { if ($movimenti["darave"] == 'D') { if ($progr >= 0) { $progr += $movimenti["import"]; } if ($progr < 0 and $progr >= -$movimenti["import"]) { $progr += $movimenti["import"]; //questo per eliminare tutti gli array $righiDebiti = array(); $rigo = 0; } if ($progr < 0 and $progr < -$movimenti["import"]) { $parzi = $movimenti["import"]; $progr += $movimenti["import"]; foreach ($righiDebiti as $key => $value) { if ($parzi >= $value['prelis']) { array_shift($righiDebiti); $rigo--; $parzi -= $value['prelis']; } elseif ($parzi > 0) { $righiDebiti[0]['prelis'] = $value['prelis'] - $parzi; //questo elimina il resto dell'elemento $parzi = 0.0; } } } } else { $tesdoc = gaz_dbi_get_row($gTables['tesdoc'], "id_tes", $movimenti['id_doc']); if ($tesdoc['pagame'] != $pagame['codice']) { $pagame_tesdoc = gaz_dbi_get_row($gTables['pagame'], "codice", $tesdoc['pagame']); if ($pagame_tesdoc) { $pagame = $pagame_tesdoc; } } if ($progr <= 0) { $giodoc = substr($movimenti['datdoc'], 8, 2); $mesdoc = substr($movimenti['datdoc'], 5, 2); $anndoc = substr($movimenti['datdoc'], 0, 4); $utsdoc = mktime(0, 0, 0, $mesdoc, $giodoc, $anndoc); $ratpag = CalcolaScadenze($movimenti['import'], $giodoc, $mesdoc, $anndoc, $pagame['tipdec'], $pagame['giodec'], $pagame['numrat'], $pagame['tiprat'], $pagame['mesesc'], $pagame['giosuc']); foreach ($ratpag['import'] as $key => $value) { $utssca = mktime(0, 0, 0, $ratpag['mese'][$key], $ratpag['giorno'][$key], $ratpag['anno'][$key]); if ($utssca <= $utsval) { $righiDebiti[$rigo]['prelis'] = $value - $parzi; $righiDebiti[$rigo]['id_rig'] = 0; switch ($movimenti['caucon']) { case "AFA": $righiDebiti[$rigo]['descri'] = "FATTURA N." . $movimenti['numdoc'] . " DEL " . $giodoc . "-" . $mesdoc . "-" . $anndoc; $righiDebiti[$rigo]['des_con'] = "FT N." . $movimenti['numdoc']; break; case 'AFD': $righiDebiti[$rigo]['descri'] = "NOTA DEBITO N." . $movimenti['numdoc'] . " DEL " . $giodoc . "-" . $mesdoc . "-" . $anndoc; $righiDebiti[$rigo]['des_con'] = "ND N." . $movimenti['numdoc']; break; case 'AFC': $righiDebiti[$rigo]['descri'] = "NOTA CREDITO N." . $movimenti['numdoc'] . " DEL " . $giodoc . "-" . $mesdoc . "-" . $anndoc; $righiDebiti[$rigo]['des_con'] = "NC N." . $movimenti['numdoc']; break; default: $righiDebiti[$rigo]['descri'] = "DOCUMENTO N." . $movimenti['numdoc'] . " DEL " . $giodoc . "-" . $mesdoc . "-" . $anndoc; $righiDebiti[$rigo]['des_con'] = "DOC N." . $movimenti['numdoc']; break; } $rigo++; $progr -= $value; } else { $progr -= $value; } } } if ($progr > 0 and $progr < $movimenti['import']) { $giodoc = substr($movimenti['datdoc'], 8, 2); $mesdoc = substr($movimenti['datdoc'], 5, 2); $anndoc = substr($movimenti['datdoc'], 0, 4); $utsdoc = mktime(0, 0, 0, $mesdoc, $giodoc, $anndoc); $ratpag = CalcolaScadenze($movimenti['import'], $giodoc, $mesdoc, $anndoc, $pagame['tipdec'], $pagame['giodec'], $pagame['numrat'], $pagame['tiprat'], $pagame['mesesc'], $pagame['giosuc']); $parzi = $progr; foreach ($ratpag['import'] as $key => $value) { $utssca = mktime(0, 0, 0, $ratpag['mese'][$key], $ratpag['giorno'][$key], $ratpag['anno'][$key]); if ($utssca <= $utsval) { if ($progr < $value) { $righiDebiti[$rigo]['prelis'] = $value - $parzi; $righiDebiti[$rigo]['id_rig'] = 0; switch ($movimenti['caucon']) { case "AFA": $righiDebiti[$rigo]['descri'] = "FATTURA N." . $movimenti['numdoc'] . " DEL " . $giodoc . "-" . $mesdoc . "-" . $anndoc; $righiDebiti[$rigo]['des_con'] = "FT N." . $movimenti['numdoc']; break; case 'AFD': $righiDebiti[$rigo]['descri'] = "NOTA DEBITO N." . $movimenti['numdoc'] . " DEL " . $giodoc . "-" . $mesdoc . "-" . $anndoc; $righiDebiti[$rigo]['des_con'] = "ND N." . $movimenti['numdoc']; break; case 'AFC': $righiDebiti[$rigo]['descri'] = "NOTA CREDITO N." . $movimenti['numdoc'] . " DEL " . $giodoc . "-" . $mesdoc . "-" . $anndoc; $righiDebiti[$rigo]['des_con'] = "NC N." . $movimenti['numdoc']; break; default: $righiDebiti[$rigo]['descri'] = "DOCUMENTO N." . $movimenti['numdoc'] . " DEL " . $giodoc . "-" . $mesdoc . "-" . $anndoc; $righiDebiti[$rigo]['des_con'] = "DOC N." . $movimenti['numdoc']; break; } $rigo++; $parzi = 0.0; $progr -= $value; } else { $progr -= $value; $parzi -= $value; } } else { $parzi = 0.0; $progr -= $value; } } } if ($progr > 0 and $progr >= $movimenti['import']) { $progr -= $movimenti["import"]; } } } //fine while $righiDebiti['numrighi'] = $rigo; return $righiDebiti; }
function pageFooter() { //effettuo il calcolo degli importi delle scadenze $ratpag = CalcolaScadenze($this->docVars->totale, $this->giorno, $this->mese, $this->anno, $this->pagame['tipdec'], $this->pagame['giodec'], $this->pagame['numrat'], $this->pagame['tiprat'], $this->pagame['mesesc'], $this->pagame['giosuc']); if ($ratpag) { //allungo l'array fino alla 4^ scadenza $ratpag['import'] = array_pad($ratpag['import'], 4, ''); $ratpag['giorno'] = array_pad($ratpag['giorno'], 4, ''); $ratpag['mese'] = array_pad($ratpag['mese'], 4, ''); $ratpag['anno'] = array_pad($ratpag['anno'], 4, ''); } else { for ($i = 0; $i <= 3; $i++) { $ratpag['import'][$i] = ""; $ratpag['giorno'][$i] = ""; $ratpag['mese'][$i] = ""; $ratpag['anno'][$i] = ""; } } //FINE calcolo scadenze //stampo i totali $y = $this->GetY(); $this->Rect(10, $y, 186, 212 - $y); //questa marca le linee dx e sx del documento //stampo il castelletto $this->SetY(212); $this->Cell(62, 6, 'Pagamento', 'LTR', 0, 'C', 1); $this->Cell(68, 6, 'Castelletto I.V.A.', 'LTR', 0, 'C', 1); $this->Cell(56, 6, 'T O T A L E F A T T U R A', 'LTR', 1, 'C', 1); $this->SetFont('helvetica', '', 8); $this->Cell(62, 6, $this->pagame['descri'], 'LBR', 0, 'L'); $this->Cell(18, 4, 'Imponibile', 'LR', 0, 'C', 1); $this->Cell(32, 4, 'Aliquota', 'LR', 0, 'C', 1); $this->Cell(18, 4, 'Imposta', 'LR', 1, 'C', 1); foreach ($this->docVars->castel as $v) { if ($this->tesdoc['id_tes'] > 0) { $this->Cell(62); $this->Cell(18, 4, gaz_format_number($v['importo']) . ' ', 'LR', 0, 'R'); $this->Cell(32, 4, $v['descri'], 0, 0, 'C'); $this->Cell(18, 4, gaz_format_number($v['iva']) . ' ', 'LR', 1, 'R'); } else { $this->Cell(62); $this->Cell(68, 4, '', 'LR', 1); } } $this->SetY(218); $this->SetFont('helvetica', 'B', 16); $this->Cell(130); $this->Cell(56, 12, '€ ' . gaz_format_number($this->docVars->totale), 'LR', 1, 'C'); $this->SetY(224); $this->SetFont('helvetica', '', 9); if (!empty($this->banacc['iban'])) { $this->Cell(62, 6, 'Banca d\'accredito', 'LTR', 1, 'C', 1); $this->Cell(62, 5, $this->banacc['ragso1'], 'LR', 1); $this->Cell(62, 6, 'IBAN ' . $this->banacc['iban'], 'LRB', 1, 'C'); } else { $this->Cell(62, 6, '', 'LTR', 1, '', 1); $this->Cell(62, 6, '', 'LR', 1); $this->Cell(62, 6, '', 'LRB', 1); } $this->Cell(130, 6, 'Date di Scadenza e Importo Rate', 'LTR', 1, 'C', 1); $this->Cell(32, 6, $ratpag['giorno']['0'] . '-' . $ratpag['mese']['0'] . '-' . $ratpag['anno']['0'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['1'] . '-' . $ratpag['mese']['1'] . '-' . $ratpag['anno']['1'], 'LR', 0, 'C'); $this->Cell(32, 6, $ratpag['giorno']['2'] . '-' . $ratpag['mese']['2'] . '-' . $ratpag['anno']['2'], 'LR', 0, 'C'); $this->Cell(33, 6, $ratpag['giorno']['3'] . '-' . $ratpag['mese']['3'] . '-' . $ratpag['anno']['3'], 'LR', 1, 'C'); if ($ratpag['import']['0'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['0']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['1'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['1']), 'LBR', 0, 'C'); } else { $this->Cell(33, 6, '', 'LBR'); } if ($ratpag['import']['2'] != 0) { $this->Cell(32, 6, gaz_format_number($ratpag['import']['2']), 'LBR', 0, 'C'); } else { $this->Cell(32, 6, '', 'LBR'); } if ($ratpag['import']['3'] != 0) { $this->Cell(33, 6, gaz_format_number($ratpag['import']['3']), 'LBR', 1, 'C'); } else { $this->Cell(33, 6, '', 'LBR', 1); } $this->SetXY(140, 230); $this->SetFont('helvetica', '', 10); $this->MultiCell(56, 30, "\nallegata allo scontrino n." . $this->tesdoc['numdoc'] . " emesso in pari data con misuratore fiscale:\n\n" . $this->docVars->ecr['descri'], 'LBR', 1, 'J'); }