noalyss Version-9
html_input_noalyss.class.php
Go to the documentation of this file.
1<?php
2
3
4
5/*
6 * This file is part of NOALYSS.
7 *
8 * NOALYSS is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NOALYSS is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NOALYSS; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * 1/03/20
22*/
23/**
24 * @file
25 * @brief HtmlInput specific to Noalyss
26 *
27 */
28// Copyright Author Dany De Bontridder danydb@noalyss.eu
29
30/**
31 * @class Html_Input_Noalyss
32 * @brief HtmlInput specific to Noalyss
33 *
34 *
35 */
37{
38 /**
39 * Build a HTML string for adding multiple rows
40 * @param string $p_ledger ledger type /Fin , Other = sale / purchase , M miscelleaneous
41 */
42 static function ledger_add_item($p_ledger)
43 {
44 //Fin , Other = sale / purchase , M miscelleaneous
45 if ( ! in_array($p_ledger ,["F","O","M"]) ) {
46 throw new Exception(_("LAD46 Erreur type"));
47 }
48 $id=uniqid();
49 $num=new INum($id,0);
50 $num->value=1;
51 $num->size=2;
52 $s_js=sprintf(' onClick="ledger_add_multiple(\'%s\')"',$id);
53
54 $r=HtmlInput::hidden($id."_ledger",$p_ledger);
55 $r.=$num->input();
56 $r.=HtmlInput::button('add_item',_('ligne à ajouter'),
57 $s_js);
58
59 return $r;
60 }
61
62 /**
63 * @brief display the supplementax if any
64 * @param $p_ledger_id jrn_def.jrn_def_id , id of the ledger
65 */
67 {
69 // if there is an additional tax for this ledger
70 $has_suppl_tax=$cn->get_value("select count(*) from acc_other_tax where array_position(ajrn_def_id,$1)
71is not null",[$p_ledger_id]);
72 if ($has_suppl_tax ==0 ) {
73 return "";
74 }
75 if ( $has_suppl_tax>1) {
76 throw new Exception("HIN76:too many supplemental taxes");
77 }
78 $ac_id=$cn->get_value("select ac_id
79 from acc_other_tax
80 where
81 array_position(ajrn_def_id,$1) is not null",[$p_ledger_id]);
82
83 $ac_other_tax=new Acc_Other_Tax_SQL($cn,$ac_id);
84 $msg=_("Autre taxe");
85 $checkbox=new ICheckBox("new_tax",$ac_id);
86
87
88 }
89}
else $num
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
ORM public.acc_other_tax.
static connect()
HtmlInput specific to Noalyss.
static ledger_add_item($p_ledger)
Build a HTML string for adding multiple rows.
static ledger_supplemental_tax($p_ledger_id)
display the supplementax if any
class widget This class is used to create all the HTML INPUT TYPE and some specials which works with ...
static button($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
static hidden($p_name, $p_value, $p_id="")
Html Input.
This class handles only the numeric input, the input will call a javascript to change comma to period...
Definition: inum.class.php:42
$p_ledger_id
Definition: periode.inc.php:33