0 and O.SaldoProvvigioneAgente = 0 and O.DataSpedFattura >= '$dataDal' and O.DataSpedFattura <= '$dataAl' and O.idagente = $idAgente and $where order by $orderBy " ; } else { $flag_chk = 0 ; // Ordini con provvigioni PAGATE $titolo .= " Lista Ordini con Provvigioni Pagate " ; $query = " select *, AFP.percentuale as PercentualeAgente, A.Percentuale as PercentualeDefault, C.Nome as NomeCliente from $tordini O inner join $tclienti C on C.IdClienti = O.IdCliente inner join $tpagamenti P on P.IdPagamenti = O.IdPagamento inner join $tageforper AFP on AFP.IdAgente = O.IdAgente and AFP.IdFornitore = O.IdFornitore inner join $tagenti A on A.IdAgenti = O.IdAgente inner join $tAmmontareVariOrdini AVO on AVO.IdOrdine = O.IdOrdini where O.NumFattura <> 0 and O.SaldoProvvigioneAgente = 1 and O.DataSpedFattura >= '$dataDal' and O.DataSpedFattura <= '$dataAl' and O.idagente = $idAgente and $where order by $orderBy " ; } list($n, $arrVal) = $db->RecuperaDati($query) ; $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'] ; if (isset($idAgente) and ($idAgente != 0)) { list($p, $t) = $db->RecuperaDati("select * from $tagenti where IdAgenti = $idAgente") ; $nomeAgente = htmlspecialchars($t["Nome"][0]) ; } $titolo .= "per l'Agente '$nomeAgente' - Anno $anno" ; ?> New Document




al
N.Ord N.Fatt Fatt Sald? Cliente Data Fatt Importo %Provv Provv Provv AG Sald?
TOTALE: