if (!defined('ALLOWED')) die('Appel direct ne sont pas permis'); require 'class/balance_age.class.php'; require_once NOALYSS_INCLUDE.'/lib/http_input.class.php'; $http=new HttpInput(); /** * @file * @brief Export an ageing balance * @param p_date_start considered writing after this date * @param p_let lettered or not value (all): let or only unlettered value:unlet * @param p_type * - C customer * - F supplier * - U only a card * - X a category * @param cat only if p_type = X it that case contains the category id (fiche_def.fd_id) * @param fiche only if p_type = U in that case contains the card id (fiche.f_id) * @param all Ony with p_type = X all the customer / supplier cards */ /* * Retrieve card */ $bal=new Balance_Age($cn); $p_type = $http->get('p_type',"string", "-"); $p_date= $http->get('p_date_start',"string", "-"); $p_let= $http->get('p_let',"string", "let"); $cat= $http->get('cat',"string", ""); $fiche= $http->get('fiche',"string", "0"); $all= $http->get('all',"string", "0"); switch ($p_type) { case 'C': $bal->get_array_card('C'); $bal->export_csv($p_date, $p_let); break; case 'F': $bal->get_array_card('F'); $bal->export_csv($p_date, $p_let); break; case 'U': $bal->get_array_card('U', $fiche); $bal->export_csv($p_date, $p_let); break; case 'X': $all=$http->get('all', "string",0); if ($all==0) { $bal->get_array_card('X', $http->get('cat')); $bal->export_csv($p_date, $p_let); } else { $a_cat=$cn->get_array("select fd_id from vw_fiche_def where ad_id=".ATTR_DEF_ACCOUNT." order by fd_label asc"); $nb_cat=count($a_cat); for ($i=0; $i<$nb_cat; $i++) { $bal->get_array_card('X', $a_cat[$i]['fd_id']); $bal->export_csv($p_date, $p_let); } } break; default: break; } ?>