noalyss Version-9
acc_ledger-input_extra_info.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * PhpCompta is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2002-2021) Author Dany De Bontridder <danydb@noalyss.eu>
21
22if (!defined('ALLOWED'))
23 die('Appel direct ne sont pas permis');
25/**
26 * @file
27 * @brief display supplemental information to save when entering an operation of
28 * sale, purchase, financial or for a misc. operation
29 */
31$ledger_type = $this->get_type();
33$a_div=["template"=>"modele_div_id",
34 "repo"=>"repo_div_id" ,
35 "invoice"=>"facturation_div_id",
36 "reverse"=>"reverse_div_id",
37 "type_operation"=>'operationtype_div_id',
38 "document"=>"document_div_id",
39 "action_gestion"=>"actiongestion_div_id"];
40
41//-- Define option to display
42// template : template of operation , invoice : doc. to generate, document : document
43// to upload , reverse : reverse operation
44 if ( $ledger_type == 'ACH' || $ledger_type == 'VEN') {
45 $a_show=['template','repo','invoice','reverse','action_gestion'];
46 $show="facturation_div_id";
47 } elseif ($ledger_type=='ODS') {
48 $a_show=['template','document','reverse','type_operation','action_gestion'];
49 $show="document_div_id";
50 }
51
52 $str_tab = "";$sep="";
53 foreach ($a_show as $tab) { $str_tab .=$sep. "'".$a_div[$tab]."'";$sep =",";}
54?>
55<div id="tab_id" >
56 <script>
57 var a_tab = [ <?=$str_tab?>];
58 console.table(a_tab);
59 </script>
60
61<ul class="tabs">
62 <?php if (in_array('invoice',$a_show)) :?>
63 <li class="tabs_selected" style="float: none"><a href="javascript:void(0)" title="<?php echo _("Générer une facture ou charger un document")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'facturation_div_id')"><?php echo _('Facture')?></a></li>
64 <?php endif; ?>
65
66 <?php if (in_array('document',$a_show)) :?>
67 <li class="tabs" style="float: none"> <a href="javascript:void(0)" title="<?php echo _("Document")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'document_div_id')"> <?php echo _('Document')?> </a></li>
68 <?php endif; ?>
69
70 <?php if (in_array('repo',$a_show)) :?>
71 <li class="tabs" style="float: none"> <a href="javascript:void(0)" title="<?php echo _("Choix du dépôt")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'repo_div_id')"> <?php echo _('Dépôt')?> </a></li>
72 <?php endif; ?>
73
74 <?php if (in_array('template',$a_show)) :?>
75 <li class="tabs" style="float: none"> <a href="javascript:void(0)" title="<?php echo _("Modèle à sauver")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'modele_div_id')"> <?php echo _('Modèle')?> </a></li>
76 <?php endif; ?>
77
78 <?php if (in_array('reverse',$a_show)) :?>
79 <li class="tabs" style="float: none"> <a href="javascript:void(0)" title="<?php echo _("Extourne")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'reverse_div_id')"> <?php echo _('Extourne')?> </a></li>
80 <?php endif; ?>
81
82 <?php if (in_array('type_operation',$a_show)) :?>
83 <li class="tabs" style="float: none"> <a href="javascript:void(0)" title="<?php echo _("Type opération")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'operationtype_div_id')"> <?php echo _('Type opération')?> </a></li>
84 <?php endif; ?>
85
86 <?php if (in_array('action_gestion',$a_show)) :?>
87 <li class="tabs" style="float: none"> <a href="javascript:void(0)" title="<?php echo _("Action gestion")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'actiongestion_div_id')"> <?php echo _('Action gestion')?> </a></li>
88 <?php endif; ?>
89</ul>
90</div>
91<?php
92if (in_array('repo',$a_show)) {
93 echo $this->select_depot(false, -1);
94}
95if (in_array('invoice',$a_show)) {
96 echo $this->extra_info();
97}
98if ( in_array("document",$a_show)) {
99 if ( in_array("invoice",$a_show)) {
100 throw new Exception("ACC_LEDGER_INPUT100 : document and invoice available in same time");
101 }
102?>
103<div id="document_div_id" style="display:none;height:185px;height:10rem">
104 <?php
105 $file = new IFile();
106 $file->setAlertOnSize(true);
107 $file->table = 0;
108 echo '<p class="decale">';
109 echo _("Ajoutez une pièce justificative ");
110 echo $file->input("pj", "");
111 echo '</p>';
112 ?>
113</div>
114<?php
115
116}
117?>
118<div id="modele_div_id" style="display:none;height:185px;height:10rem">
119<?php echo Pre_operation::save_propose();?>
120</div>
121
122
123<div id="reverse_div_id" style="display:none;height:185px;height:10rem">
124<?php
125 $reverse_date=new IDate('reverse_date');
126 $reverse_ck=new ICheckBox('reverse_ck');
127 echo _('Extourne opération')." ".$reverse_ck->input()." ";
128 echo $reverse_date->input();
129 $msg_reverse=new IText("ext_label");
130 $msg_reverse->placeholder=_("Message extourne");
131 $msg_reverse->size=60;
132 echo _("Message")." ".$msg_reverse->input();
133?>
134</div>
135
136<div id="operationtype_div_id" style="display:none;height:185px;height:10rem">
137 <?php
138 $status=$http->request("jr_optype","string","NOR");
140 ?>
141</div>
142
143<div id="actiongestion_div_id" style="display:none;height:185px;height:10rem">
144 Action gestion
145 <?php
146 $irelated_action=new IRelated_Action("action_gestion");
147 $irelated_action->value=$http->request("action_gestion","string","");
148 echo $irelated_action->input();
149 ?>
150</div>
151
152
153
154<script>
155 show_tabs(a_tab,'<?=$show?>');
156</script>
if($ledger_type=='ACH'||$ledger_type=='VEN') elseif($ledger_type=='ODS') $str_tab
$opd_description style
for($j=0;$j< $nb_row;$j++)($j%2==0)? 'even' $show
static select_operation_type($p_status)
Return a select object to choose the type of operation.
Class Document corresponds to the table document.
manage the http input (get , post, request) and extract from an array
Html Input.
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Definition: idate.class.php:34
Html Input for uploading file, must be in a form with enctype="multipart/form-data".
Definition: ifile.class.php:31
Html Input.
Definition: itext.class.php:30
static echo_file($msg, $print=true)
display the file
Definition: dbg.php:88
static save_propose()
Propose to save the operation into a predefined operation.
$anc_filter title
if( $delta< 0) elseif( $delta==0)