require('../../config/templates/report_template.php'); $pdf = new Report_template(); $pdf->setVars($admin_aziend,$title,1); $pdf->setFooterMargin(22); $pdf->setTopMargin(43); $pdf->setRiporti(''); $pdf->AddPage(); $ctrltipo=""; $totaleff=0.00; $totnumeff=0; $pdf->SetFont('helvetica','',8); while ($a_row = gaz_dbi_fetch_array($result)) { if ($a_row["tipeff"] <> $ctrltipo){ if (isset($totaletipo)) $pdf->Cell(190,4,$totnumtipo.' '.$descreff.' per un totale di '.gaz_format_number($totaletipo),1,1,'R',1); $totaletipo = 0.00; $totnumtipo = 0; switch($a_row['tipeff']) { case "B": $descreff = 'RICEVUTE BANCARIE '; break; case "T": $descreff = 'CAMBIALI TRATTE '; break; case "V": $descreff = 'MAV '; break; } }
$pdf->setVars($admin_aziend,$title); $pdf->setFooterMargin(22); $pdf->setTopMargin(43); $pdf->setRiporti(''); $pdf->AddPage(); $paymov = new Schedule; $paymov->setScheduledPartner($admin_aziend['mascli']); if (sizeof($paymov->Partners) > 0) { $anagrafica = new Anagrafica(); foreach ($paymov->Partners as $p){ $anagrafica = new Anagrafica(); $prt = $anagrafica->getPartner($p); $pdf->SetFont('helvetica','B',10); $pdf->SetFillColor(200,255,200); $pdf->Ln(2); $pdf->Cell(186,5,$prt['ragso1']." ".$prt['ragso2']." tel:".$prt['telefo']." fax:".$prt['fax']." mob:".$prt['cell']." ",1,1,'',1,'',1); $pdf->SetFont('helvetica','',9); $paymov->getPartnerStatus($p,substr($_GET['date'],0,10)); foreach ($paymov->PartnerStatus as $k=>$v){ $pdf->SetTextColor(255,0,0); $pdf->SetFillColor(230,255,230); $pdf->Cell(56,5,"REF: ".$k,1,0,'',1,'',1); $pdf->SetTextColor(0); $pdf->Cell(130,5, $paymov->docData[$k]['descri'].' n.'. $paymov->docData[$k]['numdoc'].'/'. $paymov->docData[$k]['seziva'].' '. $paymov->docData[$k]['datdoc'] ,1,1); foreach ($v as $ki=>$vi){ $pdf->SetFillColor(170,255,170);
'bot'=>array(array('lun' => 166,'nam'=>'a riportare : '), array('lun' => 20,'nam'=>'') ) ); $pdf = new Report_template(); $pdf->setVars($admin_aziend,$title); $pdf->setFooterMargin(22); $pdf->setTopMargin(43); $pdf->SetFillColor(160, 255,220 ); $pdf->setRiporti(''); $pdf->AddPage(); $config = new Config; $paymov = new Schedule; $ctrl_pm=0; $pdf->SetFont('helvetica','',10); $pdf->Cell(100,6,$d['d'][1]['descri'],1,1,'L',1,'',1); while (list($k, $mv) = each($d['d'])) { if ($ctrl_pm <> $mv["id_tesdoc_ref"]){ } $pdf->Cell(30,6,$mv['id_tesdoc_ref'],'LTB',0,'L',0,'',1); $pdf->Cell(70,6,$mv['t']['descri'],1,0,'L',0,'',1); $pdf->Cell(25,6,$mv['t']["numdoc"].'/'.$mv['t']['seziva'],1,0,'C',0); $pdf->Cell(25,6,gaz_format_date($mv['t']["datdoc"]),1,0,'C',0); $pdf->Cell(36,6,gaz_format_number($mv['amount']),1,1,'R',0); $ctrl_pm=$mv["id_tesdoc_ref"]; } $pdf->Ln(10); $pdf->SetFont('helvetica','B',10); $pdf->Cell(150,6,$script_transl['tot'].': ','LTB',0,'R'); $pdf->Cell(36,6,'€ '.gaz_format_number($d['d'][1]['import']),'RTB',1,'R',1,'',1);
$title = array('title'=>"BILANCIO IV direttiva CEE dal ".date("d-m-Y",$utsini)." al ".date("d-m-Y",$utsfin), 'hile'=>array() ); $aRiportare = array('top'=>array(array('lun' => 168,'nam'=>'da riporto : '), array('lun' => 19,'nam'=>'') ), 'bot'=>array(array('lun' => 168,'nam'=>'a riportare : '), array('lun' => 19,'nam'=>'') ) ); $pdf = new Report_template(); $pdf->setVars($admin_aziend,$title); $pdf->AddPage(); $pdf->Cell(186,6,'STATO PATRIMONIALE AL '.date("d-m-Y",$utsfin),'LTR',1,'C'); $pdf->SetFont('helvetica','B',12); $pdf->SetTextColor(0,0,255); $pdf->Cell(186,6,'ATTIVO','LTR',1,'C'); $pdf->SetTextColor(0,0,0); $pdf->SetFont('helvetica','',8); foreach ($attivo as $keylet => $vallet) { if (! key_exists($keylet,$attdesc)) $keylet = "non class."; $pdf->SetFont('helvetica','B',8); $pdf->Cell(186,4,$keylet.$attdesc[$keylet]['Titolo'],'LR',1); $pdf->SetFont('helvetica','',8); foreach ($vallet as $keyrom => $valrom) { $pdf->Cell(15,4,'','LR'); $pdf->Cell(50,4,$nromani[intval($keyrom)].@$attdesc[$keylet][intval($keyrom)],'R',0,'R'); $pdf->Cell(121,4,'','LR',1); foreach ($valrom as $key => $value) {
$pdf = new Report_template(); $pdf->setVars($admin_aziend,$title); $pdf->SetTopMargin(51); $pdf->SetFooterMargin(22); $config = new Config; $ctrlConto = ''; $movSaldo = 0.00; while ($row = gaz_dbi_fetch_array($result)) { $datadoc = substr($row['datdoc'],8,2).'-'.substr($row['datdoc'],5,2).'-'.substr($row['datdoc'],0,4); $datareg = substr($row['datreg'],8,2).'-'.substr($row['datreg'],5,2).'-'.substr($row['datreg'],0,4); $pdf->setRiporti($aRiportare); if ($ctrlConto != $row['codcon']) { $movSaldo = 0.00; if (!empty($ctrlConto)) { $pdf->SetFont('helvetica','B',7); $pdf->Cell($aRiportare['top'][0]['lun'],4,'SALDO al '.$descrDatafin.' : ',1,0,'R'); $pdf->Cell($aRiportare['top'][1]['lun'],4,$aRiportare['top'][1]['nam'],1,0,'R'); } $pdf->SetFont('helvetica','',7); $aRiportare['top'][1]['nam'] = 0; $aRiportare['bot'][1]['nam'] = 0; $item_head['bot']= array(array('lun' => 80,'nam'=>$row['descri']), array('lun' => 25,'nam'=>$row['codcon']) ); $pdf->setItemGroup($item_head); $pdf->setRiporti(''); $pdf->AddPage('P',$config->getValue('page_format')); } if ($row['darave'] == 'D'){ $movSaldo += $row['import']; $dare = gaz_format_number($row['import']);
$pdf = new Report_template(); $pdf->setVars($admin_aziend,$title); $pdf->SetTopMargin(47); $pdf->SetFooterMargin(18); $config = new Config; $pdf->SetFont('helvetica','',7); $ctrlAgente = 0; $ctrlDoc = 0; $tot_prov = 0.00; while ($row = gaz_dbi_fetch_array($result)) { $pdf -> setRiporti($aRiportare); if ($ctrlAgente != $row['id_agente']) { if ($ctrlAgente > 0) { $pdf->SetFont('helvetica','B',8); $pdf->Cell($aRiportare['top'][0]['lun'],4,'Totale provvigioni: ',1,0,'R'); $pdf->Cell($aRiportare['top'][1]['lun'],4,$aRiportare['top'][1]['nam'],1,0,'R'); $pdf->SetFont('helvetica','',8); } $agente = getNewAgente($row['id_agente']); $item_head['bot']= array(array('lun' => 50,'nam'=>$agente['indspe']), array('lun' => 60,'nam'=>$agente['citspe'].' ('.$agente['prospe'].') '.$agente['telefo']), array('lun' => 37,'nam'=>substr($_GET['datini'],6,2).'.'.substr($_GET['datini'],4,2).'.'.substr($_GET['datini'],0,4).'-'.substr($_GET['datfin'],6,2).'.'.substr($_GET['datfin'],4,2).'.'.substr($_GET['datfin'],0,4)) ); $aRiportare['top'][1]['nam'] = 0; $aRiportare['bot'][1]['nam'] = 0; $pdf->setRiporti(''); $pdf->setPageTitle('Agente: '.$agente['ragso1'].' '.$agente['ragso2']); $pdf->setItemGroup($item_head); $pdf->AddPage('P',$config->getValue('page_format')); }
$gForm = new magazzForm(); $pdf->SetFont('helvetica','',7); $ctrlArtico = ""; $ctrl_id=0; $mval['q_g']=0; $mval['q_g']=0; $mval['v_g']=0; $mval['v_g']=0; while ($mv = gaz_dbi_fetch_array($result)) { $pdf->setRiporti($aRiportare); if ($ctrlArtico != $mv['artico']) { gaz_set_time_limit (30); if (!empty($ctrlArtico)) { $pdf->StartPageGroup(); $pdf->SetFont('helvetica','B',8); $pdf->Cell($aRiportare['top'][0]['lun'],4,$script_transl['tot'].strftime("%d-%m-%Y",$utsrf).' : ',1,0,'R'); $pdf->Cell($aRiportare['top'][1]['lun'],4,$aRiportare['top'][1]['nam'],1,0,'R'); $pdf->Cell($aRiportare['top'][2]['lun'],4,$aRiportare['top'][2]['nam'],1,0,'R'); $pdf->SetFont('helvetica','',7); } $aRiportare['top'][1]['nam'] = 0; $aRiportare['bot'][1]['nam'] = 0; $aRiportare['top'][2]['nam'] = 0; $aRiportare['bot'][2]['nam'] = 0; $item_head['bot']= array(array('lun' => 21,'nam'=>$mv['artico']), array('lun' => 18,'nam'=>$mv['catmer']), array('lun' => 60,'nam'=>$mv['desart']), array('lun' => 10,'nam'=>$mv['unimis']), array('lun' => 18,'nam'=>number_format($mv['scorta'],1,',','')) ); if (empty($mv['image'])){
$datamov = date("d-m-Y",$utsmov); if ($anndoc > 0){ $datadoc = date("d-m-Y",$utsdoc); } else { $datadoc = ''; } if ($movimenti["darave"] == 'D') { $dare = number_format($movimenti["import"],2, '.', ''); $avere = 0; $saldo += $movimenti["import"]; } else { $avere = number_format($movimenti["import"],2, '.', ''); $dare = 0; $saldo -= $movimenti["import"]; } $pdf->Cell(20,4,$datamov,1,0,'L'); $pdf->Cell(75,4,$movimenti['descri'],1,0,'L'); if ($movimenti['numdoc'] > 0) { $pdf->Cell(18,4,$movimenti['numdoc']."/".$movimenti['seziva'],1,0,'C'); } else { $pdf->Cell(18,4,'',1); } $pdf->Cell(18,4,$datadoc,1,0,'R'); if ($dare != 0) $pdf->Cell(18,4,$dare,1,0,'R'); else $pdf->Cell(18,4,'',1); if ($avere != 0) $pdf->Cell(18,4,$avere,1,0,'R'); else $pdf->Cell(18,4,'',1); $pdf->Cell(20,4,gaz_format_number($saldo),1,1,'R'); } if (isset($_GET["dest"]) && $_GET["dest"]=='E'){ // è stata richiesta una e-mail $dest = 'S'; // Genero l'output pdf come stringa binaria // Costruisco oggetto con tutti i dati del file pdf da allegare
array('lun' => 17,'nam'=>'Prezzo'), array('lun' => 18,'nam'=>'Importo'), array('lun' => 10,'nam'=>'U.M.'), array('lun' => 20,'nam'=>'Mov.Quant.') ) ); $pdf = new Report_template(); $pdf->setVars($admin_aziend,$title); $pdf->SetTopMargin(39); $pdf->SetFooterMargin(20); $config = new Config; $pdf->AddPage('L',$config->getValue('page_format')); $pdf->SetFont('helvetica','',7); if (sizeof($result) > 0) { while (list($key, $row) = each($result)) { $datadoc = substr($row['datdoc'],8,2).'-'.substr($row['datdoc'],5,2).'-'.substr($row['datdoc'],0,4); $datareg = substr($row['datreg'],8,2).'-'.substr($row['datreg'],5,2).'-'.substr($row['datreg'],0,4); $movQuanti = $row['quanti']*$row['operat']; $pdf->Cell(20,3,$datareg,1,0,'C'); $pdf->Cell(40,3,$row['caumag'].'-'.substr($row['descri'],0,22),1); $pdf->Cell(70,3,$row['artico'].' - '.$row['desart'],1); $pdf->Cell(70,3,$row['desdoc'].' del '.$datadoc,1); $pdf->Cell(17,3,number_format($row['prezzo'],$admin_aziend['decimal_price'],',','.'),1,0,'R'); $pdf->Cell(18,3,gaz_format_number(CalcolaImportoRigo($row['quanti'],$row['prezzo'],array($row['scochi'],$row['scorig']))),1,0,'R'); $pdf->Cell(10,3,$row['unimis'],1,0,'C'); $pdf->Cell(20,3,gaz_format_quantity($movQuanti,1,$admin_aziend['decimal_quantity']),1,1,'R'); } } $pdf->Output(); ?>
$partner=''; } if ($mv["id_tesdoc_ref"]<>$ctrl_paymov){ $paymov=$mv["id_tesdoc_ref"]; $scdl->getStatus($paymov); if($scdl->Status['diff_paydoc']<>0){ $status_cl=false; } else { $status_cl=true; } } if (empty($mv["numdoc"])){ $mv["datdoc"]=''; $mv['seziva']=''; } $pdf->Cell(45,4,$partner,'LTB',0,'',$status_cl,'',1); $pdf->Cell(20,4,$paymov,1,0,'R',$status_cl,'',2); $pdf->Cell(41,4,$mv['descri'],1,0,'C',$status_cl,'',1); $pdf->Cell(11,4,$mv["numdoc"].'/'.$mv['seziva'],1,0,'R',$status_cl); $pdf->Cell(15,4,$mv["datdoc"],1,0,'C',$status_cl); $pdf->Cell(15,4,gaz_format_date($mv["datreg"]),1,0,'C',$status_cl); if ($mv['id_rigmoc_pay']==0){ $pdf->Cell(12,4,gaz_format_number($mv['amount']),1,0,'R',$status_cl); $pdf->Cell(12,4,'',1,0,'R',$status_cl); } else { $pdf->Cell(12,4,'',1,0,'R',$status_cl); $pdf->Cell(12,4,gaz_format_number($mv['amount']),1,0,'R',$status_cl); } $pdf->Cell(15,4,gaz_format_date($mv["expiry"]),1,1,'C',$status_cl); $ctrl_partner=$mv["clfoco"]; $ctrl_id_tes=$mv["id_tes"];
$pdf->SetFillColor(hexdec(substr($admin_aziend['colore'],0,2)),hexdec(substr($admin_aziend['colore'],2,2)),hexdec(substr($admin_aziend['colore'],4,2))); $ctrl_mas = 0; $max_y = 0; while ($row = gaz_dbi_fetch_array($result)) { $mas=intval(substr($row['codice'],0,3)); $y=$pdf->GetY(); if ($y<250){ $max_str=intval(13*(254-$y)); if ($ctrl_mas<$mas ){ // mastri if (intval(substr($row['codice'],3,6))==0) { $cm_d=trim($row['ceedar']); $cm_a=trim($row['ceeave']); } if (isset($note[1])){ // ma se ho una nota del mastro precedente la devo stampare $pdf->AddPage('P',$config->getValue('page_format')); $pdf->Cell(135); $pdf->SetFont('helvetica','',7); $pdf->MultiCell(51,4,$note[1],1,'L',true); $y=$pdf->GetY(); $max_str=intval(13*(254-$y)); } $start_y=$y; if ($max_y>$y) { //se con i conti son andato oltre... $pdf->Cell(135,1,'','T'); $pdf->SetY($max_y); // inizio dalla loro fine $start_y=$max_y; } $note = str_split($row['annota'],$max_str); $pdf->SetFont('helvetica','B',7); $pdf->Cell(15,4,$mas,1,0,'C',1); $pdf->Cell(120,4,$row['descri'],'LTB',0,'L',1);
$price = $row['preacq']; break; case '1': $price = $row['preve1']; break; case '2': $price = $row['preve2']; break; case '3': $price = $row['preve3']; break; case 'web': $price = $row['web_price']*$row['web_multiplier']; $row['unimis'] = $row['web_mu']; break; } if ($row["catmer"] <> $ctrlcatmer) { gaz_set_time_limit (30); $pdf->Cell(120,5,'Categoria Merceologica n.'.$row['codcat'].' = '.$row['descat'],1,1,'L',1); } $pdf->Cell(35,5,$row['codart'],1); $pdf->Cell(85,5,$row['desart'],1); $pdf->Cell(15,5,$row['unimis'],1,0,'C'); $pdf->Cell(25,5,number_format($price,$admin_aziend['decimal_price'],',','.'),1,0,'R'); $pdf->Cell(25,5,number_format($magval['q_g'],$admin_aziend['decimal_quantity'],',','.'),1,0,'R'); $pdf->Cell(15,5,$row['aliquo'],1,0,'C'); $pdf->Cell(70,5,$row['annota'],1,1,'C'); $ctrlcatmer=$row["catmer"]; } $pdf->Output(); ?>
$pdf->setVars($admin_aziend,$title); $pdf->setAuthor($admin_aziend['ragso1'].' '.$_SESSION['Login']); $pdf->setTitle($title['title']); $pdf->SetTopMargin(43); $pdf->SetFooterMargin(20); $pdf->AddPage(); if ($_GET['partner'] == 1 or $_GET['partner'] == 3){ $queryData = createRowsAndErrors(1); $castel_partners = $queryData[0]; foreach ($castel_partners as $key=>$value ) { $totale = $value['operazioni_imponibili']+ $value['operazioni_nonimp']+ $value['operazioni_esente']+ $value['imposte_addebitate']; $pdf->SetFont('helvetica','',7); $pdf->Cell(8,3,$value['Progressivo'],'LTR',0,'R'); $pdf->Cell(80,3,$value['Rag_Sociale'],'T'); $pdf->Cell(54,3,$value['Indirizzo'],'T'); $pdf->Cell(39,3,$value['Comune'],'T'); $pdf->Cell(6,3,$value['Provincia'],'TR',1,'C'); $aRiportare['top'][1]['nam'] += $value['operazioni_imponibili']; $aRiportare['bot'][1]['nam'] += $value['operazioni_imponibili']; $aRiportare['top'][2]['nam'] += $value['imposte_addebitate']; $aRiportare['bot'][2]['nam'] += $value['imposte_addebitate']; $aRiportare['top'][3]['nam'] += $value['operazioni_esente']; $aRiportare['bot'][3]['nam'] += $value['operazioni_esente']; $aRiportare['top'][4]['nam'] += $value['operazioni_nonimp']; $aRiportare['bot'][4]['nam'] += $value['operazioni_nonimp']; $aRiportare['top'][5]['nam'] += $totale; $aRiportare['bot'][5]['nam'] += $totale; $pdf->setRiporti($aRiportare);
$result = gaz_dbi_dyn_query($gTables['assist'].".*, ".$gTables['anagra'].".ragso1, ".$gTables['anagra'].".ragso2, ".$gTables['anagra'].".telefo, ".$gTables['anagra'].".fax, ".$gTables['anagra'].".cell, ".$gTables['anagra'].".e_mail ", $gTables['assist']. " LEFT JOIN ".$gTables['clfoco']." ON ".$gTables['assist'].".clfoco = ".$gTables['clfoco'].".codice". " LEFT JOIN ".$gTables['anagra'].' ON '.$gTables['clfoco'].'.id_anagra = '.$gTables['anagra'].'.id', $where, "clfoco, DATA ASC", $limit, $passo); $totale_ore = -1; while ($row = gaz_dbi_fetch_array($result)) { if ( $row["ragso1"] != $vrag ) { $pdf->SetFont('helvetica','B',10); $pdf->SetFillColor(255,255,255); if ( $totale_ore != -1 ) { $pdf->Cell(158,5,'Totale Ore :','LTB',0,'R',1,'',1); $pdf->Cell(12,5,gaz_format_number($totale_ore),1,1,'R',1); } $totale_ore ++; //$pdf->SetFont('helvetica','B',10); //$pdf->SetFillColor(255,255,255); $pdf->Ln(2); if ( $row['fax'] != "" ) $fax = "fax: ".$row['fax']; else $fax = ""; if ( $row['cell'] != "" ) $mob = "mob:".$row['cell']; else $mob = ""; if ( $row['telefo'] != "" ) $tel = "tel:".$row['telefo']; else $tel = ""; if ( $row['e_mail'] != "" ) $email = $row['e_mail'];
$result=gaz_dbi_dyn_query( $gTables['tesmov'].".*,".$gTables['rigmoc'].".*,ragso1,telefo,cell", $gTables['rigmoc'].' LEFT JOIN '.$gTables['tesmov'].' ON '.$gTables['rigmoc'].'.id_tes='.$gTables['tesmov'].'.id_tes LEFT JOIN '.$gTables['clfoco'].' ON '.$gTables['rigmoc'].'.codcon='.$gTables['clfoco'].'.codice LEFT JOIN '.$gTables['anagra'].' ON '.$gTables['anagra'].'.id='.$gTables['clfoco'].'.id_anagra', "datreg BETWEEN '".intval($_GET["annini"])."0101' AND '". intval($_GET["annfin"])."1231' AND codcon=".$value. " AND caucon <> 'CHI' AND caucon <> 'APE' OR (caucon = 'APE' AND codcon=".$value." AND YEAR(datreg)=".intval($_GET["annini"]).")", "datreg"); while ($movimenti = gaz_dbi_fetch_array($result)) { if($ctrlfor != $movimenti["codcon"]){ $pdf->SetFont('times','B',11); $pdf->Cell(187,6,$movimenti['ragso1'].' Tel. '.$movimenti['telefo'].' cell. '.$movimenti['cell'],1,1,'L',1); $pdf->SetFont('helvetica','',8); $saldo = 0.00; } $giomov = substr($movimenti['datreg'],8,2); $mesmov = substr($movimenti['datreg'],5,2); $annmov = substr($movimenti['datreg'],0,4); $giodoc = substr($movimenti['datdoc'],8,2); $mesdoc = substr($movimenti['datdoc'],5,2); $anndoc = substr($movimenti['datdoc'],0,4); $utsmov= mktime(0,0,0,$mesmov,$giomov,$annmov); $utsdoc= mktime(0,0,0,$mesdoc,$giodoc,$anndoc); $datamov = date("d-m-Y",$utsmov); if ($anndoc > 0){ $datadoc = date("d-m-Y",$utsdoc); } else {