36require_once NOALYSS_INCLUDE .
"/database/forecast_item_sql.class.php";
37require_once NOALYSS_INCLUDE .
"/database/forecast_sql.class.php";
45 parent::__construct($p_table);
46 $this->forecast_id = -1;
60 join forecast_category fc on (fi.fc_id=fc.fc_id)
62 fi_id=$1",array(
$p_id));
88 $nCategory =
$object->cn->get_value(
"select count(*) from forecast_category where f_id=$1",[$this->forecast_id]);
100 $sql =
"select fi_id,fi_text,fi_account,
101 fi_account str_account_card,
104 (select p_start from parm_periode pp where pp.p_id=fi.fi_pid) as str_periode
105 from forecast_item fi join forecast_category fc on (fi.fc_id=fc.fc_id)
107 order by fc_desc,fi_text ";
109 require_once NOALYSS_TEMPLATE .
"/forecast_item_mtable-display_table.php";
114 if ( ! isset($p_row[
'fc_desc'])) {
116 $sql=
"select fi_id,fi_text,fi_account,
117 fi_account str_account_card,
120 (select p_start from parm_periode pp where pp.p_id=fi.fi_pid) as str_periode
121 from forecast_item fi join forecast_category fc on (fi.fc_id=fc.fc_id)
123 $p_row=
$cn->get_row(
$sql,[$p_row[
'fi_id']]);
126 if ( ! isset ($p_row[
'str_account_card'])) {
127 $p_row[
'str_account_card']=
"";
129 if ( !isset ($p_row[
'str_periode'])){
130 $p_row[
'str_periode']=
"";
132 printf(
'<tr id="%s_%s">', $this->object_name, $p_row[
'fi_id']);
135 print td($p_row[
'str_account_card']);
137 print td($p_row[
'str_periode']);
140 $jsdel = sprintf(
"%s.remove('%s','%s');",
145 $jsupd = sprintf(
"%s.input('%s','%s');",
163 echo
span(_(
"Sans catégorie il n'est pas possible d'ajouter de nouveaux éléments"),
'class="notice"');
167 require_once NOALYSS_TEMPLATE.
"/forecast_item_mtable-input.php";
187 $object_sql->setp(
"fi_text",
$http->post(
"fi_text"));
188 $object_sql->setp(
"fc_id",
$http->post(
'fc_id',
"number"));
189 $object_sql->setp(
"fi_account",
$http->post(
'fi_account'));
190 $object_sql->setp(
"fi_amount",
$http->post(
'fi_amount',
"number"));
191 $object_sql->setp(
"fi_pid",
$http->post(
'fi_pid',
"number"));
192 $object_sql->setp(
"fi_amount_initial",
$http->post(
"fi_amount_initial",
"number"));
200 if ( trim(
$object->getp(
"fi_text") ) ==
"") {
201 $this->
set_error(
"fi_text", _(
"Intitulé est vide"));
203 if ( trim (
$object->getp(
"fi_account"))==
"") {
204 $this->
set_error(
"fi_account", _(
"Formule est vide"));
206 if ( trim (
$object->getp(
"fi_account"))==
"") {
207 $this->
set_error(
"fi_account", _(
"Formule est vide"));
210 $this->
set_error(
"fi_account", _(
"Formule invalide"));
span($p_string, $p_extra='')
td($p_string='', $p_extra='')
surround the string with td
nbm($p_number, $p_dec=2)
format the number with a sep.
catch(Exception $e) $forecast_item
this an abstract class , all the SQL class, like noalyss_sql (table), Acc_Plan_SQL (based on a SQL no...
display the item for forecast
from_request()
forecast_id: 14 p_id: 143 action: save ctl: tbl6058da883ded6 fc_id: 88 fi_text: Gérant fi_account: [4...
display_row($p_row)
display a data row in the table, with the order defined in a_order and depending of the visibility of...
set_forecast_id(int $forecast_id)
input()
display into a dialog box the datarow in order to be appended or modified.
__construct(Data_SQL $p_table)
display_table($p_string="", $p_array=NULL)
Display list of items, if there is no category the list is empty and you cannot add new ones.
ORM abstract of the table public.forecast_item.
static modify($p_id, $p_javascript)
Display the icon to modify a idem.
static trash($p_id, $p_javascript)
Display the icon of a trashbin.
static check_formula($p_string)
Purpose is to propose a librairy to display a table content and allow to update and delete row ,...
count_error()
returns the nb of errors found
add_json_param($p_attribute, $p_value)
Add json parameter to the current one.
set_error($p_col, $p_message)
set the error message for a wrong input