Plugins  LAST
 All Data Structures Files Functions Variables Pages
class_bank_item.php
Go to the documentation of this file.
1 <?php
2 /*
3  * This file is part of NOALYSS.
4  *
5  * NOALYSS is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * NOALYSS is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with NOALYSS; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 /* $Revision$ */
20 
21 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
22 
23 /*!\file
24  * \brief
25  */
26 require_once('class_temp_bank_sql.php');
27 class Bank_Item
28 {
29  function __construct($id=-1)
30  {
31  $this->id=$id;
32  }
33  /**
34  *show a dialog box to reconciliate or remove a record, is using the $_GET[id] for importbank.import_temp
35  */
36  function show_item($ctl)
37  {
38  global $cn,$msg;
39  $id=$_GET['id'];
40  $bi=new Temp_Bank_Sql($cn,$id);
41  $jrn='';
42  if ( $bi->jrn_def_id != '')
43  {
44  $jrn=$cn->get_value('select jrn_def_name from jrn_def where jrn_def_id=$1',
45  array($bi->jrn_def_id));
46  $w=new ICard();
47  $w->jrn=$bi->jrn_def_id;
48  $w->name='fiche'.$id;
49  $w->extra='filter';
50  $w->typecard='deb';
51  $w->set_dblclick("fill_ipopcard(this);");
52  $w->set_attribute('ipopup','ipopcard');
53  $w->set_attribute('label','e_third');
54  $w->set_attribute('typecard','deb');
55  $w->set_callback('filter_card');
56  $w->set_function('fill_data');
57  $w->set_attribute('inp','fiche');
58  $w->autocomplete=1;
59  $w->choice="choice_suggest".$ctl;
60  $w->choice_create=0;
61  $wConcerned=new IConcerned();
62  $wConcerned->name="e_concerned".$id;
63  $wConcerned->amount_id=abs($bi->amount);
64  $wConcerned->extra2='paid';
65  $wConcerned->label=_('op. concernée');
66  $wConcerned->table=0;
67  $wConcerned->value=$bi->tp_rec;
68  $wConcerned->tiers=$w->name;
69 
70  $name='';$status='';
71  if ( $bi->f_id != null)
72  {
73  $w->value=$cn->get_value('select ad_value from fiche_detail where f_id=$1 and ad_id=23',array($bi->f_id));
74  $name=$cn->get_value('select ad_value from fiche_detail where f_id=$1 and ad_id=1',array($bi->f_id));
75  }
76  $third=new IText('tp_third');
77  $third->value=$bi->tp_third;
78 
79  $extra=new IText('tp_extra');
80  $extra->value=$bi->tp_extra;
81  if ( strlen($bi->libelle) > 20)
82  {
83  $libelle=new ITextArea('libelle');
84  $libelle->value=$bi->libelle;
85  $libelle->heigh=3;
86  $libelle->width=60;
87 
88  }
89  else
90  {
91  $libelle=new IText('libelle');
92  $libelle->value=$bi->libelle;
93  $libelle->size=strlen($bi->libelle);
94  }
95  $amount=new INum('amount');
96  $amount->value=$bi->amount;
97 
98  $date=new IDate('tp_date');
99  $date->value=$bi->tp_date;
100 
101  switch($bi->status)
102  {
103  case 'N':
104  $status='Nouveau';
105  break;
106  case 'E':
107  $status='Erreur : '.$bi->tp_error_msg;
108  break;
109  case 'W':
110  $status='Attente';
111  break;
112  case 'T':
113  $status='Transféré';
114  $w->readOnly=true;
115  $wConcerned->readOnly=true;
116  $amount->readOnly=true;
117  $third->readOnly=true;
118  $extra->readOnly=true;
119  $libelle->readOnly=true;
120  $date->readOnly=true;
121 
122  break;
123  case 'D':
124  $status='Effacer';
125  break;
126 
127  }
128  }
129  $remove=new ICheckBox('remove');
130  $recup=new ICheckBox('recup');
131 
132 
133  require_once('template/detail_item.php');
134  }
135  function show_delete($ctl)
136  {
137  global $cn,$msg;
138  $id=$_GET['id'];
139  $bi=new Temp_Bank_Sql($cn,$id);
140  $jrn='';
141  if ( $bi->jrn_def_id != '')
142  {
143  $jrn=$cn->get_value('select jrn_def_name from jrn_def where jrn_def_id=$1',
144  array($bi->jrn_def_id));
145  }
146  require_once('template/delete_item.php');
147 
148  }
149  function update()
150  {
151  global $cn;
152  $bi_sql=new Temp_Bank_Sql($cn,$this->id);
153  $bi_sql->f_id=$this->f_id;
154  $bi_sql->status=$this->status;
155  $bi_sql->tp_rec=$this->tp_rec;
156 
157  $bi_sql->update();
158  }
159 }
$msg
__construct($id=-1)
$ctl
Definition: ajax.php:31
$extra
Definition: ajax.php:33
show_item($ctl)
show a dialog box to reconciliate or remove a record, is using the $_GET[id] for importbank.import_temp
global $cn
$name