get_name(); $User=new User($cn); $User->Check(); $User->check_dossier($gDossier); $User->can_request(IMPJRN,0); // Security if ( $_GET['jrn_id']!=0 && $User->check_jrn($_GET['jrn_id']) == 'X' ) { /* Cannot Access */ NoAccess(); } $ret=""; // filter : 0 for Grand Livre otherwise 1 $filter=( $Jrn->id == 0)?0:1; $jrn_type=$Jrn->get_type(); //---------------------------------------------------------------------- // Detailled Printing //--------------------------------------------------------------------- if ( $_REQUEST['p_simple']== 0 ) { $pdf=new Print_Ledger_Detail($cn); $pdf->setDossierInfo($Jrn->name); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->export($Jrn); $fDate=date('dmy-Hi'); $pdf->Output('journal-'.$fDate.'.pdf','I'); exit(0); } // impression detaillé //---------------------------------------------------------------------- // Simple Printing Purchase Ledger //--------------------------------------------------------------------- if ( $_REQUEST['p_simple']== 1 ) { if ( $jrn_type=='ACH' || $jrn_type=='VEN') { if ( $jrn_type=='ACH' && $cn->get_value('select count(qp_id) from quant_purchase') == 0 ) { $pdf= new Print_Ledger_Simple_without_vat($cn,$Jrn); $pdf->setDossierInfo($Jrn->name); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->Cell(0,6,'Ce journal ne peut être imprimé en mode simple'); $pdf->output('erreur.pdf','I'); exit(); } if ( $jrn_type=='VEN' && $cn->get_value('select count(qs_id) from quant_sold') == 0 ) { $pdf= new Print_Ledger_Simple_without_vat($cn,$Jrn); $pdf->setDossierInfo($Jrn->name); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->Cell(0,6,'Ce journal ne peut être imprimé en mode simple'); $pdf->output('erreur.pdf','I'); exit(); } if ( $own->MY_TVA_USE=='Y') { $pdf= new Print_Ledger_Simple($cn,$Jrn); $pdf->setDossierInfo($Jrn->name); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->export(); $fDate=date('dmy-Hi'); $pdf->Output('journal-'.$fDate.'.pdf','I'); exit(0); } if ( $own->MY_TVA_USE=='N') { $pdf= new Print_Ledger_Simple_without_vat($cn,$Jrn); $pdf->setDossierInfo($Jrn->name); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->export($Jrn); $fDate=date('dmy-Hi'); $pdf->Output('journal-'.$fDate.'.pdf','I'); exit(0); } } if ($jrn_type=='FIN') { $pdf= new Print_Ledger_Financial($cn,$Jrn); $pdf->setDossierInfo($Jrn->name); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->export(); $fDate=date('dmy-Hi'); $pdf->Output('journal-'.$fDate.'.pdf','I'); exit(0); } if ( $jrn_type=='ODS' || $Jrn->id==0) { $pdf= new Print_Ledger_Misc($cn,$Jrn); $pdf->setDossierInfo($Jrn->name); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->export(); $fDate=date('dmy-Hi'); $pdf->Output('journal-'.$fDate.'.pdf','I'); exit(0); } } ?>