noalyss Version-9
anc_great_ledger.inc.php
Go to the documentation of this file.
1<?php
2//This file is part of NOALYSS and is under GPL
3//see licence.txt
4/**
5 *@file
6 *@brief Print the great ledger for Analytic accounting
7 * @see Anc_GrandLivre
8 */
9if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
10echo '<div style="content">';
11global $http;
13$grandLivre=new Anc_Grandlivre($cn);
14
15$grandLivre->get_request();
16
17/*
18 * Form
19 */
20echo '<form method="get" >';
21echo $grandLivre->display_form();
22echo '<p>' . HtmlInput::submit('Recherche', _('Rechercher')) . '</p>';
23echo HtmlInput::request_to_hidden(array('sa','ac','gDossier'));
24echo '</form>';
25
26$result=$http->request('result',"string",null);
27
28if ($result != null)
29{
30 $grandLivre->load();
31 if ($grandLivre->has_data != 0 )
32 {
33 echo '<span style="display:block">';
34 echo _('Tout sélectionner')." ".ICheckBox::toggle_checkbox('export_pdf_bt1','export_anc_receipt_pdf');
35 echo '</span>';
36 $task_id=uniqid();
37 echo $grandLivre->button_export_csv();
38 printf ('<form method="GET" id="export_anc_receipt_pdf" action="export.php"
39 style="display:inline" onsubmit="return start_export_anc_receipt_pdf(\'%s\',\'%s\');">',
41 _("Le traitement est en cours , merci de patienter sans recharger la page")
42 );
43 echo HtmlInput::hidden("task_id",$task_id);
44 $type_pdf=new Select_Box("type_pdf",_("Type export PDF"));
45 $type_pdf->add_value(_("Un seul PDF"),1);
46 $type_pdf->add_value(_("Un PDF par opération"),2);
47 $type_pdf->set_position("in-absolute");
48 echo $type_pdf->input();
49
50 // propose to download also the reconcilied operation with its receipt
51// echo _("Avec documents des opérations rapprochées");
52// $checkbox=new ICheckBox("receipt_reconcilied", 0);
53//
54// echo $checkbox->input();
55 $type_pdf=new Select_Box("reconcilied_document",_("Opérations rapprochées"));
56 $type_pdf->add_value(_("Opérations rapprochées avec documents"),1);
57 $type_pdf->add_value(_("Opérations rapprochées sans documents"),2);
58 $type_pdf->set_position("in-absolute");
59 echo $type_pdf->input();
60
61 echo $grandLivre->button_export_pdf();
62 echo $grandLivre->display_html();
63 echo HtmlInput::get_to_hidden(array('ac','gDossier','sa'));
64 echo $grandLivre->button_export_pdf();
65 echo '</form>';
66 echo $grandLivre->button_export_csv();
67 ?>
68<script>
69 function start_export_anc_receipt_pdf(p_task_id,p_message)
70 {
71 var a=document.getElementsByName("ck[]");
72 var i=0;
73 var valid=false;
74 for ( i =0;i < a.length;i++) {
75 if ( a[i].checked == true) {
76 valid=true;
77 break;
78 }
79 }
80 if (document.getElementById("type_pdf").value == "-1" )
81 {
82 valid=false;
83 }
84 if (document.getElementById("reconcilied_document").value == "-1" )
85 {
86 valid=false;
87 }
88 if ( valid ) {
89 progress_bar_start(p_task_id,p_message);
90 return true;
91 } else {
92 smoke.alert("<?=_('Choisissez au moins une opération, les opérations rapprochées et le type d\'export')?>");
93 return false;
94 }
95
96 }
97
98</script>
99<?php
100 }
101 else
102 {
103 echo '<p class="notice">';
104 echo _('Aucune donnée trouvée');
105 echo '</p>';
106 }
107
108}
109echo '</div>';
110?>
global $http
static connect()
static request_to_hidden(array $array)
transform $_REQUEST data to hidden
static hidden($p_name, $p_value, $p_id="")
static get_to_hidden($array)
transform $_GET data to hidden
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
static toggle_checkbox($p_name, $p_form)
Display a kind of select.