28require_once NOALYSS_INCLUDE.
"/database/jrn_def_sql.class.php";
40 parent::__construct($p_table);
44 $this->
set_col_label(
"mp_jrn_def_id", _(
"Enregistrement dans"));
50 $this->icon_mod=
"right";
55 $p_table->cn->make_array(
"select jrn_def_id,jrn_def_name from jrn_def where jrn_def_type in ('FIN','ODS') and jrn_enable=1 order by 2",1));
57 $p_table->cn->make_array(
"select fd_id,fd_label from fiche_def order by 2",1));
59 $p_table->cn->make_array(
"select jrn_def_id,jrn_def_name from jrn_def where jrn_def_type in ('ACH','VEN') and jrn_enable=1 order by 2",1));
62 $this->
set_order([
"mp_lib",
"jrn_def_id",
"mp_jrn_def_id",
"mp_fd_id",
"mp_qcode"]);
72 if ( trim(
$table->mp_lib) ==
"") {
73 $this->
set_error(
"mp_lib", _(
"Un libellé est obligatoire"));
76 $count_ledger_target=0;
77 if ( trim(
$table->mp_jrn_def_id) !=
"") {
78 $count_ledger_target=
$cn->get_value(
"select count(*) from jrn_def where jrn_def_id=$1",[
$table->mp_jrn_def_id]);
81 if ($count_ledger_target == 0 ) {
82 $this->
set_error(
"mp_jrn_def_id", _(
"Choisissez un journal"));
87 if ( trim(
$table->jrn_def_id) !=
"") {
88 $count_ledger_used=
$cn->get_value(
"select count(*) from jrn_def where jrn_def_id=$1",[
$table->jrn_def_id]);
91 if ($count_ledger_used == 0) {
92 $this->
set_error(
"jrn_def_id", _(
"Choisissez un journal"));
96 if ( trim(
$table->mp_lib) ==
"") {
97 $this->
set_error(
"mp_lib", _(
"Un libellé est obligatoire"));
101 if (trim (
$table->mp_qcode) !=
"") {
103 if (
$ledger->get(
'jrn_def_type') ==
'FIN'){
105 if (
$fiche->get_by_qcode(
$table->mp_qcode,FALSE) == 1) {
106 $this->
set_error(
"mp_qcode",_(
"Fiche inexistante"));
112 $a_row=
$cn->get_row(
"select jrn_def_type,jrn_def_bank from jrn_def where jrn_def_id = $1",[
$table->mp_jrn_def_id]);
115 if (
$a_row[
'jrn_def_type'] ==
'FIN') {
118 $table->mp_fd_id=
$cn->get_value(
"select fd_id from fiche where f_id=$1",[
$a_row[
'jrn_def_bank']]);
122 if (
$a_row[
'jrn_def_type'] !=
'FIN' &&
$table->mp_fd_id == -1)
124 $this->
set_error(
"mp_fd_id",_(
"Choisissez un type de fiche"));
127 if ( $has_error > 0)
return FALSE;
141 $w=
new ICard(
"mp_qcode",$p_value);
142 $w->set_attribute(
"typecard",
"all");
149 printf (_(
"Erreur key %s value %s"),$p_key,$p_value);
foreach($array as $idx=> $m) $w
this an abstract class , all the SQL class, like noalyss_sql (table), Acc_Plan_SQL (based on a SQL no...
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Input HTML for the card show buttons, in the file, you have to add card.js How to use :
ORM abstract of the table public.jrn_def.
Purpose is to propose a librairy to display a table content and allow to update and delete row ,...
set_col_tips($p_key, $p_comment)
Set the info for a column, use Icon_Action::infobulle the message are in message_javascript....
set_col_type($p_key, $p_value, $p_array=NULL)
set the type of a column , it will change in the input db box , the select must supply an array of po...
set_property_visible($p_key, $p_value)
set a column of the data row visible or not
set_error($p_col, $p_message)
set the error message for a wrong input
set_col_label($p_key, $p_display)
set the name to display for a column
Manage the Payment method.
input_custom($p_key, $p_value)
For the quickcode.
__construct(\Data_SQL $p_table)