query("select * from $tpagamenti where idpagamenti = $pagamento") ; while ($db->next_record()) { $giorni = $db->f("Giorni") ; $modalita = $db->f("Modalita") ; } } else { $wpagamento = "O.idpagamento IN (1,3,4,5,6,8)" ; $modalita = "Anticipato, Bonifico, R.B. 60 gg, R.B. 90 gg, R.D. 60 gg, R.D. 90 gg" ; } $titolo = "Fatture scadute da incassare in data " . Date("d/m/Y") ; if ($agente != 'tutti' and $agente != '') { $wagente = "O.idagente = $agente" ; $db->query("select * from agenti where idagenti = $agente") ; while ($db->next_record()) $nome = $db->f("Nome") ; $Agente = "$nome" ; } else { $wagente = "1 = 1" ; $Agente .= "Tutti" ; } if ($cliente != 'tutti' and $cliente != '') { $wcliente = "O.idcliente = $cliente" ; $db->query("select * from $tclienti where idclienti = $cliente") ; while ($db->next_record()) $nomecli = $db->f("Nome") ; $Cliente .= "$nomecli" ; } else { $wcliente = "1 = 1" ; $Cliente .= "Tutti" ; } if ($fornitore != 'tutti' and $fornitore != '') { $wfornitore = "O.idfornitore = $fornitore" ; $db->query("select * from $tfornitori where idfornitori = $fornitore") ; while ($db->next_record()) $nomefor = $db->f("Nome") ; $Fornitore .= "$nomefor" ; } else { $wfornitore = "1 = 1" ; $Fornitore .= "Tutti" ; } $data = date("Y-m-d", mktime(0,0,0, date("m"), date("d") - $giorni, date("Y"))) ; $arrParGen = array() ; $arrParGen = RecuperaParametriGenerali($arrParGen, $tparametri) ; $nome = $arrParGen['NomeAgenzia'] ; $sede = "Sede operativa: " . $arrParGen['IndirizzoAgenzia'] ; $datisede = "Telefono: " . $arrParGen['TelefonoAgenzia'] . " Fax: " . $arrParGen['FaxAgenzia'] . " -- P.I. " . $arrParGen['PartitaIvaAgenzia'] ; $emailsede = "Email: " . $arrParGen['MailAgenzia'] ; ?> <? echo TITLE ?>




Agente:
Ciente:
Fornitore:
Pagamento:
0 and O.dataspedfattura <= '$data' order by C.nome, O.dataspedfattura" ; debug (0, $query) ; $db->query($query) ; while ($db->next_record()) { $nomec = $db->f("NomeCliente") ; /********************************************************************* * Controllo quanti giorni sono passati dal giorno di emissione della * fattura ad oggi ed in base a questo valore inserisco i dati nell'array * opportuno ***********************************************************************/ if ($db->f("DataSpedFattura") == "0000-00-00") $DataSpedFattura = "2002-01-01" ; else $DataSpedFattura = $db->f("DataSpedFattura") ; preg_match ("/([0-9]{4})[-\/]([0-9]{2})[-\/]([0-9]{2})/", $DataSpedFattura, $reg_str) ; $ggpass = dateDiff(date("d"), date("m"), date("Y"), $reg_str[3], $reg_str[2], $reg_str[1]) ; if ($ggpass <= 90) { $bgcol = "#32D632" ; $colclass = "clientisubtitlegrey" ; } elseif ($ggpass > 90 and $ggpass <= 120) { $bgcol = "yellow" ; $colclass = "clientisubtitleblack" ; } else { $bgcol = "red" ; $colclass = "clientisubtitle" ; } if ($db->f("NomeCliente") != $oldCliente) { $oldCliente = $db->f("NomeCliente") ; if ($i>0) { ?>
Cliente Fornitore Num Fatt Data Fattura Pagamento Importo

f("NomeCliente") ?> f("NomeFornitore") ?> f("NumFattura") ?> f("NumNA") > 0) { ?>
NA: f("NumNA") ?> f("NumNC") > 0) { ?>
NC: f("NumNC") ?>
class="" align="center">f("DataSpedFattura")) . " ($ggpass)" ?> f("DataNA") > 0) { ?>
f("DataNA")) ?> f("DataNC") > 0) { ?>
f("DataNC")) ?>
f("TipoPagamento")?> f("ImportoFattura")) ?> f("ImportoNA") > 0) { ?>
f("ImportoNA")) ?> f("ImportoNC") > 0) { ?>
- f("ImportoNC")) ?>