} else { $afiche[0] = array('fd_id' => $_REQUEST['cat']); } if ($allcard == 0) { echo $str_add_card; } echo $export_csv; echo $export_pdf; echo $export_print; $fiche = new Fiche($cn); for ($e = 0; $e < count($afiche); $e++) { $array = Fiche::get_fiche_def($cn, $afiche[$e]['fd_id'], 'name_asc'); foreach ($array as $card) { $row = new Fiche($cn, $card['f_id']); $letter = new Lettering_Card($cn); $letter->set_parameter('quick_code', $row->strAttribut(ATTR_DEF_QUICKCODE)); $letter->set_parameter('start', $_GET['start']); $letter->set_parameter('end', $_GET['end']); // all if ($_GET['histo'] == 0) { $letter->get_all(); } // lettered if ($_GET['histo'] == 1) { $letter->get_letter(); } // unlettered if ($_GET['histo'] == 2) { $letter->get_unletter(); } if ($_GET['histo'] == 6) {
$letter->save($_POST); } //-------------------------------------------------------------------------------- // Show the result //-------------------------------------------------------------------------------- if (isset($_GET['start']) && isset($_GET['end'])) { if (isDate($_GET['start']) == null || isDate($_GET['end']) == null) { echo alert(_('Date malformée, désolé')); return; } } echo '<div id="list">'; $fiche = new Fiche($cn, $_REQUEST['f_id']); $quick_code = $fiche->get_quick_code(); $letter = new Lettering_Card($cn); $letter->set_parameter('quick_code', $quick_code); $letter->set_parameter('start', $start->value); $letter->set_parameter('end', $end->value); if ($sel->selected == 0) { echo $letter->show_list('all'); } if ($sel->selected == 1) { echo $letter->show_list('letter'); } if ($sel->selected == 2) { echo $letter->show_list('unletter'); } echo '</div>'; echo '<div id="detail" style="display:none">'; echo 'Un instant...'; echo '<IMG SRC=image/loading.gif>';
function export_csv($p_date_start, $p_let) { $nb_fiche = count($this->afiche); $title = sprintf('"%s";', _('QuickCode')); $title .= sprintf('"%s";', _('Nom')); $title .= sprintf('"%s";', _('Prénom')); $title .= sprintf('"%s";', _('Date')); $title .= sprintf('"%s";', _('N° pièce')); $title .= sprintf('"%s";', _('Interne')); $title .= sprintf('"%s";', _('Fin')); $title .= sprintf('"%s";', _('<30 jours')); $title .= sprintf('"%s";', _('entre 30 et 60 jours')); $title .= sprintf('"%s";', _('entre 60 et 90 jours')); $title .= sprintf('"%s";', _('> 90 jours')); $title .= sprintf("\n\r"); $flag_title = false; for ($i = 0; $i < $nb_fiche; $i++) { $card = new Lettering_Card($this->cn, $this->afiche[$i]['quick_code']); $card->set_parameter('start', $p_date_start); $card->get_balance_ageing($p_let); if (empty($card->content)) { continue; } if (!$flag_title) { echo $title; $flag_title = true; } $nb_row = count($card->content); $sum_lt_30 = 0; $sum_gt_30_lt_60 = 0; $sum_gt_60_lt_90 = 0; $sum_gt_90 = 0; $sum_fin = 0; for ($j = 0; $j < $nb_row; $j++) { $show = true; printf('"%s";', str_replace('"', '', $this->afiche[$i]['quick_code'])); printf('"%s";', str_replace('"', '', $this->afiche[$i]['name'])); printf('"%s";', str_replace('"', '', $this->afiche[$i]['first_name'])); printf('"%s";', $card->content[$j]['j_date_fmt']); printf('"%s";', $card->content[$j]['jr_pj_number']); printf('"%s";', $card->content[$j]['jr_internal']); if ($card->content[$j]['jrn_def_type'] == 'FIN' || $card->content[$j]['jrn_def_type'] == 'ODS') { printf("%s;", nb($card->content[$j]['j_montant'])); $sum_fin = bcadd($sum_fin, $card->content[$j]['j_montant']); $show = false; } else { printf('0;'); } if ($show && $card->content[$j]['day_paid'] <= 30) { printf("%s;", nb($card->content[$j]['j_montant'])); $sum_lt_30 = bcadd($sum_lt_30, $card->content[$j]['j_montant']); $show = false; } else { printf('0;'); } if ($show && $card->content[$j]['day_paid'] > 30 && $card->content[$j]['day_paid'] <= 60) { printf("%s;", nb($card->content[$j]['j_montant'])); $sum_gt_30_lt_60 = bcadd($sum_gt_30_lt_60, $card->content[$j]['j_montant']); } else { printf('0;'); } if ($show && $card->content[$j]['day_paid'] > 60 && $card->content[$j]['day_paid'] <= 90) { printf("%s;", nb($card->content[$j]['j_montant'])); $sum_gt_60_lt_90 = bcadd($sum_gt_60_lt_90, $card->content[$j]['j_montant']); } else { printf('0;'); } if ($show && $card->content[$j]['day_paid'] > 90) { printf("%s", nb($card->content[$j]['j_montant'])); $sum_gt_90 = bcadd($sum_gt_90, $card->content[$j]['j_montant']); } else { printf('0;'); } printf("\n\r"); } printf('"%s";', _('Totaux')); printf('"";'); printf('"";'); printf('"";'); printf('"";'); printf('"";'); printf('%s;', nb($sum_fin)); printf('%s;', nb($sum_lt_30)); printf('%s;', nb($sum_gt_30_lt_60)); printf('%s;', nb($sum_gt_60_lt_90)); printf('%s', nb($sum_gt_90)); printf("\n\r"); } }
* */ /** * @file * @brief show the result of balance ageing, included from Balance_Age::display_purchase * @see Balance_Age */ bcscale(2); ?> <?php $nb_fiche = count($a_fiche); for ($i = 0; $i < $nb_fiche; $i++) { $card = new Lettering_Card($this->cn, $a_fiche[$i]['quick_code']); $card->set_parameter('start', $p_date_start); $card->get_balance_ageing($p_let); if (empty($card->content)) { continue; } echo HtmlInput::card_detail($a_fiche[$i]['quick_code'], h($a_fiche[$i]['name']) . ' ' . h($a_fiche[$i]['first_name'])); ?> <table class="result"> <tr> <th> <?php echo _('Date opération'); ?> </th> <th> <?php
} echo '<hr>'; //-------------------------------------------------------------------------------- // record the data //-------------------------------------------------------------------------------- if (isset($_POST['record'])) { $letter = new Lettering_Account($cn); $letter->save($_POST); } //-------------------------------------------------------------------------------- // Show the result //-------------------------------------------------------------------------------- echo '<div id="list">'; $letter = new Lettering_Card($cn); $quick_code = strtoupper(trim($_GET['acc'])); $letter->set_parameter('quick_code', $quick_code); $letter->set_parameter('start', $_GET['start']); $letter->set_parameter('end', $_GET['end']); if ($sel->selected == 0) { echo $letter->show_list('all'); } if ($sel->selected == 1) { echo $letter->show_list('letter'); } if ($sel->selected == 2) { echo $letter->show_list('unletter'); } if ($sel->selected == 3) { echo $letter->show_list('letter_diff'); } echo '</div>';