72 $this->
user=$_SESSION[SESSION_KEY.
'g_user'];
73 $this->periode=
$g_user->get_periode();
75 $this->jr_optype=
"NOR";
77 $this->currency_rate=1;
78 $this->currency_rate_ref=1;
79 $this->currency_id=NULL;
90 periode {$this->periode}
92 jr_optype {$this->jr_optype}
93 amount {$this->amount}
94 currency_rate {$this->amount}
95 currency_rate_ref {$this->amount}
96 currency_id {$this->amount}
109 $ret=$this->
db->get_value(
'select jr_grpt_id from jrn where jr_id=$1',
110 array($this->
jr_id));
121 $this->
db->prepare(
'prep_tiers',
"select fiche_detail.f_id,ad_value from
123 join (select qf_other as f_id
128 select qp_supplier as f_id
130 where quant_purchase.j_id=$2
132 select qs_client as f_id
134 where quant_sold.j_id=$2 ) as v_fiche on (fiche_detail.f_id=v_fiche.f_id) where ad_id=23 ");
144 $this->
db->prepare(
'prep_counterpart',
"select fiche_detail.f_id,ad_value from
146 join (select qf_bank as f_id
151 select qp_fiche as f_id
153 where quant_purchase.j_id=$2
155 select qs_fiche as f_id
157 where quant_sold.j_id=$2 ) as v_fiche on (fiche_detail.f_id=v_fiche.f_id) where ad_id=23 ");
176 $res_tiers=$this->
db->execute(
'prep_tiers',
177 array($pn_jrn_id,$pn_jrnx_id));
180 $tiers=$atiers[
'ad_value'];
185 $res_counterpart=$this->
db->execute(
'prep_counterpart',
186 array($pn_jrn_id,$pn_jrnx_id));
190 $tiers=$atiers[
'ad_value'];
216 if ( $this->poste ==
"") {
throw new Exception (__FILE__.
':'.__LINE__.
' Poste comptable vide');
return false; }
218 if ( $this->amount < 0 )
220 $this->
type=($this->
type==
'd')?
'c':
'd';
222 if ( DEBUGNOALYSS > 1 ) {
223 echo
"insert_jrnx = [{ $this->poste}] {$this->amount} rounded ".round($this->amount,2).
" type {$this->type}<br>";
225 $this->amount=abs($this->amount);
227 $this->desc=(isset($this->desc))?$this->desc:
'';
228 $this->amount=(trim($this->amount)==
''||$this->amount==NULL)?0:
$this->amount;
229 $Res=$this->
db->exec_sql(
"select insert_jrnx
230 ($1::text,abs($2)::numeric,$3::account_type,$4::integer,$5::integer,$6::bool,$7::text,$8::integer,upper($9),$10::text)",
233 round($this->amount,2),
242 if (
$Res===FALSE)
return FALSE;
243 $this->jrnx_id=$this->
db->get_current_seq(
's_jrn_op');
252 if ( $this->
jr_id == 0 ) {
return 0;}
253 $sum=$this->
db->get_value(
"select
254 sum(case when j_debit is false and jrn_def.jrn_def_type='ACH'
255 then 0-j_montant when j_debit is true and jrn_def.jrn_def_type='VEN'
257 else j_montant end) sum_tax
259 jrn_tax join jrnx j1 using (j_id)
260 join jrn on (jr_grpt_id=j1.j_grpt)
261 join jrn_def on (jrn.jr_def_id=jrn_def.jrn_def_id)
263 jrn.jr_id=$1",[$this->
jr_id]);
265 if ( $this->
db->count()==0) {
return 0;}
278 $sql=
"update jrn set jr_pj_number=$1 where jr_id=$2";
279 $this->
db->exec_sql(
$sql,array(
null,$this->
jr_id));
283 if ( $this->
db->count_sql(
"select jr_id from jrn
284 where jr_pj_number=$1 and jr_def_id=$2
286 array($this->pj,$this->
jrn,$this->
jr_id)
290 $sql=
"update jrn set jr_pj_number=$1 where jr_id=$2";
291 $this->
db->exec_sql(
$sql,array($this->pj,$this->
jr_id));
296 $pref=$this->
db->get_value(
"select jrn_def_pj_pref from jrn_def where jrn_def_id=$1",
311 $padding=$this->
db->get_value(
"select jrn_def_pj_padding from jrn_def where jrn_def_id=$1",
314 $seq=$this->
db->get_next_seq(
's_jrn_pj'.$this->
jrn);
317 $this->pj=$pref.str_pad(
$seq,$padding??0,
'0',STR_PAD_LEFT);
320 $c=$this->
db->count_sql(
"select jr_id from jrn where jr_pj_number=$1 and jr_def_id=$2
322 array($this->pj,$this->
jrn,$this->
jr_id)
334 $sql=
"update jrn set jr_pj_number=$1 where jr_id=$2";
335 $this->
db->exec_sql(
$sql,array($this->pj,$this->
jr_id));
352 if ( DEBUGNOALYSS > 1 ) {
353 echo
"insert_jrn = {$this->amount} <br>";
355 $diff=$this->
db->get_value(
"select check_balance ($1)",array($this->grpt));
359 printf (
_(
"Erreur : balance incorrecte :diff = %s"),
$diff);
364 if ( ! isset($this->mt) )
366 $this->mt=microtime(
true);
371 $this->amount=(trim($this->amount)==
''||$this->amount==NULL)?0:
$this->amount;
372 $Res=$this->
db->exec_sql(
"insert into jrn (jr_def_id,jr_montant,jr_comment,".
373 "jr_date,jr_ech,jr_grpt_id,jr_tech_per,jr_mt,jr_optype,currency_id,currency_rate,currency_rate_ref) values (".
375 "to_date($4,'DD.MM.YYYY'),to_date($5,'DD.MM.YYYY'),$6,$7,$8,$9,$10,$11,$12)",
376 array ($this->
jrn, $this->amount,$p_comment,
377 $this->date,
$echeance,$this->grpt,$this->periode,$this->mt,$this->jr_optype,
378 $this->currency_id,$this->currency_rate,$this->currency_rate_ref)
384 $this->
jr_id=$this->
db->get_current_seq(
's_jrn');
395 if ( ! isset($this->
jr_id) )
396 throw new Exception(
'jr_id is not set',1);
397 $Res=$this->
db->exec_sql(
"select jr_internal from jrn where jr_id=".$this->
jr_id);
400 $this->jr_internal= $l_line[
'jr_internal'];
410 $res=$this->
db->exec_sql(
'select jr_id from jrn where jr_internal=$1',
424 $filter_sql=
$g_user->get_ledger_sql(
'ALL',3);
426 if ( $this->
jr_id==0 )
return;
427 $sql=
" select jr_id,j_id,jr_date,j_qcode,j_poste,j_montant,jr_internal,case when j_debit = 'f' then 'C' else 'D' end as debit,jr_comment as description,
428 vw_name,pcm_lib,j_debit,coalesce(comptaproc.get_letter_jnt(j_id),-1) as letter,jr_def_id ".
429 " from jrnx join jrn on (jr_grpt_id=j_grpt)
430 join tmp_pcmn on (j_poste=pcm_val)
431 left join vw_fiche_attr on (j_qcode=quick_code)
433 jr_id=$1 and $filter_sql order by j_debit desc";
442 $sql=
"update jrnx set j_text=$1 where j_id=$2";
443 $this->
db->exec_sql(
$sql,array($p_text,$this->jrnx_id));
448 $sql=
"update jrn set jr_comment=$1 where jr_id=$2";
449 $this->
db->exec_sql(
$sql,array($p_text,$this->
jr_id));
454 if (
isDate($p_text) ==
null )
458 $sql=
"update jrn set jr_ech=to_date($1,'DD.MM.YYYY') where jr_id=$2";
459 $this->
db->exec_sql(
$sql,array($p_text,$this->
jr_id));
464 $sql=
"select jr_def_id from jrn where jr_id=$1";
483 if (
$l[
'j_poste'] == $this->poste || (
$l[
'j_qcode']==$this->qcode && trim($this->qcode) !=
''))
484 $border=
' class="highlight"';
485 $r.=
'<tr '.$border.
'>';
494 $r.=
'<td '.$border.
'>';
501 $r.=
'<td '.$border.
'>';
509 $r.=
'<td '.$border.
'>';
516 $r.=
'<td '.$border.
'>';
524 $r.=
'<td '.$border.
'>';
525 $a=(
$l[
'letter']!=-1)?
$l[
'letter']:
'';
547 return "ERROR PARAMETRE";
583 $Res=$this->
db->exec_sql(
"select
584 to_char(j_date,'DD.MM.YYYY') as j_date,
588 coalesce(j_qcode,'-') as qcode,
592 to_char(jr_ech,'DD.MM.YYYY') as jr_ech,
593 to_char(jr_date,'DD.MM.YYYY') as jr_date,
594 jr_id,jr_internal,jr_def_id,jr_pj
595 from jrnx inner join jrn on j_grpt=jr_grpt_id where j_grpt=$1",array($p_grpt));
597 if ( $MaxLine == 0 )
return null;
600 for (
$i=0;
$i < $MaxLine;
$i++)
604 $l_array[
'op_date']=$l_line[
'j_date'];
605 if ( $l_line[
'j_debit'] ==
't' )
607 $l_class=sprintf(
"class_deb%d",
$deb);
608 $l_montant=sprintf(
"mont_deb%d",
$deb);
609 $l_text=sprintf(
"text_deb%d",
$deb);
610 $l_qcode=sprintf(
"qcode_deb%d",
$deb);
611 $l_array[$l_class]=$l_line[
'j_poste'];
612 $l_array[$l_montant]=$l_line[
'j_montant'];
613 $l_array[$l_text]=$l_line[
'j_text'];
614 $l_array[$l_qcode]=$l_line[
'qcode'];
615 $l_id=sprintf(
"op_deb%d",
$deb);
616 $l_array[$l_id]=$l_line[
'j_id'];
619 if ( $l_line[
'j_debit'] ==
'f' )
621 $l_class=sprintf(
"class_cred%d",
$cred);
622 $l_montant=sprintf(
"mont_cred%d",
$cred);
623 $l_array[$l_class]=$l_line[
'j_poste'];
624 $l_array[$l_montant]=$l_line[
'j_montant'];
625 $l_id=sprintf(
"op_cred%d",
$cred);
626 $l_array[$l_id]=$l_line[
'j_id'];
627 $l_text=sprintf(
"text_cred%d",
$cred);
628 $l_array[$l_text]=$l_line[
'j_text'];
629 $l_qcode=sprintf(
"qcode_cred%d",
$cred);
630 $l_array[$l_qcode]=$l_line[
'qcode'];
633 $l_array[
'jr_internal']=$l_line[
'jr_internal'];
634 $l_array[
'comment']=$l_line[
'jr_comment'];
635 $l_array[
'ech']=$l_line[
'jr_ech'];
636 $l_array[
'jr_id']=$l_line[
'jr_id'];
637 $l_array[
'jr_def_id']=$l_line[
'jr_def_id'];
665 if (
$ledger_id==
'')
throw new Exception(
_(
'Journal non trouvé'));
671 switch($oledger->get_type())
687 if ( empty(
$ret->det->array))
702 if ( $this->det->currency_id == 0 ) {
706 if (
$ledger_id==
'')
throw new Exception(
_(
'Journal non trouvé'));
712 switch($oledger->get_type())
717 sum(oc_amount)+sum(oc_vat_amount )
718 from operation_currency oc
719 join quant_sold qs using(j_id)
721 oc.j_id in (select j_id
722 from jrnx join jrn on (jr_grpt_id=j_grpt)
729 sum(oc_amount)+sum(oc_vat_amount )
730 from operation_currency oc
731 join quant_purchase qs using(j_id)
733 oc.j_id in (select j_id
734 from jrnx join jrn on (jr_grpt_id=j_grpt)
741 sum(oc_amount)+sum(oc_vat_amount )
742 from operation_currency oc
743 join quant_fin qs using(j_id)
745 oc.j_id in (select j_id
746 from jrnx join jrn on (jr_grpt_id=j_grpt)
753 sum(oc_amount)+sum(oc_vat_amount )
754 from operation_currency oc
755 join jrnx using(j_id)
756 join jrn on (jr_grpt_id=j_grpt)
758 jr_id=$1 and j_debit='t';
772 $this->info=
new stdClass();
774 $array=$this->
db->get_value(
"select ji_value from jrn_info where
775 jr_id=$1 and id_type=$2",array($this->
jr_id,
'OTHER'));
776 $this->info->other=
$array;
779 $array=$this->
db->get_value(
"select ji_value from jrn_info where
780 jr_id=$1 and id_type=$2",array($this->
jr_id,
'BON_COMMANDE'));
781 $this->info->command=
$array;
791 if ( ! in_array(
$p_type,array(
'OTHER',
'BON_COMMANDE')))
return;
792 if (trim($p_info)==
"") {
793 $this->
db->exec_sql(
'delete from jrn_info where jr_id=$1 and id_type=$2',array($this->
jr_id,
$p_type));
796 $exist=$this->
db->get_value(
'select count(ji_id) from jrn_info where jr_id=$1 and id_type=$2',array($this->
jr_id,
$p_type));
797 if ( $exist ==
"0" ) {
799 $this->
db->exec_sql(
'insert into jrn_info(jr_id,id_type,ji_value) values ($1,$2,$3)',
803 $this->
db->exec_sql(
'update jrn_info set ji_value=$3 where jr_id=$1 and id_type=$2',
810 if ($p_string ==
"")
return;
811 $a_action=explode(
',',$p_string);
812 for (
$i=0;
$i<count($a_action);
$i++)
826 throw new Exception(
_(
'Acc_Operation::set_id , id invalide '));
836 if ( $this->
jr_id == 0 )
837 throw new Exception(
_(
'Object invalide, id incorrect'));
839 $this->
db->get_value(
'select count(*) from jrn where jr_id=$1',
840 array($this->
jr_id)) == 0 )
841 throw new Exception(
_(
'Object invalide, id incorrect'));
843 $this->
db->exec_sql(
"update jrn set jr_rapt = 'paid' where jr_id = $1",
844 array($this->
jr_id));
851 if ( $this->
jr_id == 0 )
852 throw new Exception(
_(
'Object invalide, id incorrect'));
853 $amount=$this->
db->get_value(
'select jr_montant from jrn where jr_id=$1',
854 array($this->
jr_id));
860 $cn=Dossier::connect();
865 echo
h1(
'contain of get_quant() ');
867 echo
h1(
'contain of get_jrnx_detail()');
868 var_dump(
$a->get_jrnx_detail());
881 $type_operation=
new ISelect(
"jr_optype");
882 $type_operation->value=array(
883 array((
"label")=>
_(
"Normal"),
"value"=>
"NOR"),
884 array((
"label")=>
_(
"Ouverture"),
"value"=>
"OPE"),
885 array((
"label")=>
_(
"Fermeture"),
"value"=>
"CLO"),
886 array((
"label")=>
_(
"Extourne"),
"value"=>
"EXT")
889 $type_operation->selected=$p_status;
890 return $type_operation;
907 $a_code=$this->
db->get_array(
"select code from v_menu_dependency vmd where me_code=$1 and p_id=$2",
909 if ( empty ($a_code)) {
910 $r=
_(
"Menu invalide");
916 $r=sprintf(
'<form id="%s" method="POST" ACTION="%s">',
$p_id,NOALYSS_URL.
"/do.php?".http_build_query([
917 "ac"=>$a_code[0][
'code'],
"gDossier"=>Dossier::id()
919 $r.=Dossier::hidden();
924 $r.=
"<ul style=\"margin-left:2rem;padding-left:0;list-style:none;\">";
925 $r.=sprintf(
"<li>%s %s</li>",
_(
"Date"),
$operation->det->jr_pj_number);
926 $r.=sprintf(
"<li>%s %s</li>",
_(
"Libellé"),
$operation->det->jr_comment);
930 $currency=$this->
db->get_value(
"select cr_code_iso from currency where id=$1",[
$operation->det->currency_id]);
932 $r.=sprintf(
"<li>%s %s</li>",
_(
"Taux"),
$operation->det->currency_rate);
938 if (count($a_code) == 1 ) {
939 $r.=HtmlInput::hidden(
"ac",$a_code[0][
'code']);
940 $r.=sprintf(
_(
"Voulez-vous aller à %s pour dupliquer cette opération ?"),$a_code[0][
'code']);
945 $nb_code=count($a_code);
947 for (
$i=0;
$i<$nb_code;
$i++) {
948 $select->value[]=array(
"label"=>$a_code[
$i][
'code'],
"value"=>$a_code[
$i][
'code']);
950 $r.=sprintf(
_(
"Voulez-vous aller à %s pour dupliquer cette opération ?"),
$select->input());
980 $array[
'e_march'.$idx.
'_tva_amount']=$item[
'oc_vat_amount'];
981 $array[
'e_march'.$idx.
'_tva_amount']=$item[
'oc_amount'];
982 $array[
'e_march'.$idx.
'_price']=$item[
'oc_price_unit'];
985 if ( isset ($item[
'qs_vat_sided']) && $item[
'qs_vat_sided'] != 0 ) {
986 $array[
'e_march'.$idx.
'_tva_amount']=0;
987 }
elseif (isset ($item[
'qp_vat_sided']) && $item[
'qp_vat_sided'] != 0 ){
988 $array[
'e_march'.$idx.
'_tva_amount']=0;
997 $array[
'e_other' .
$idx .
'_amount'] = $item[
'oc_amount'];
1003 if ( DEBUGNOALYSS>1) {
1004 echo \Noalyss\Dbg::hidden_info(
"operation->det_array",
$operation->det->array);
1005 echo \Noalyss\Dbg::hidden_info(
"operation->det",
$operation->det);
1006 echo \Noalyss\Dbg::hidden_info(
"array",
$array);
1009 $r.=HtmlInput::simple_array_to_hidden(
$array);
1010 $r.=HtmlInput::hidden(
"e_comm",
$operation->det->jr_comment);
1011 $r.=HtmlInput::submit(uniqid(),
_(
"Dupliquer"));
1012 $r.=HtmlInput::button_close(
"duplicate_operation_div");
1035 parent::__construct($p_cn);
1036 $this->
jr_id=$p_jrid;
1037 $this->det=
new stdClass();
1045 $sql=
"SELECT jr_id, jr_def_id, jr_montant, jr_comment, jr_date, jr_grpt_id,
1046 jr_internal, jr_tech_date, jr_tech_per, jrn_ech, jr_ech, jr_rapt,jr_ech,
1047 jr_valid, jr_opid, jr_c_opid, jr_pj, jr_pj_name, jr_pj_type,
1048 jr_pj_number, jr_mt,jr_rapt,jr_date_paid,jr_optype,currency_id,currency_rate,currency_rate_ref
1049 FROM jrn where jr_id=$1";
1051 if ( count(
$array) == 0 )
throw new Exception(
'Aucune ligne trouvée');
1052 foreach (
$array[0] as $key=>$val)
1054 $this->det->$key=$val;
1056 $sql=
"select n_text from jrn_note where jr_id=$1";
1057 $this->det->note=$this->
db->get_value(
$sql,array($this->
jr_id));
1058 $this->det->note=strip_tags($this->det->note);
1066 $array[
'desc']=$this->det->jr_comment;
1069 $array[
'p_jrn']=$this->det->jr_def_id;
1087 parent::__construct($p_cn,$p_jrid);
1088 $this->signature=
'ODS';
1089 $this->det=
new stdClass();
1113 left join operation_currency oc1 using(j_id)
1116 order by jx1.j_debit desc,jx1.j_poste
1118 $this->det->array=$this->
db->get_array(
$sql,array($this->det->jr_grpt_id));
1127 $array=parent::compute_array();
1132 $array[
"qc_".$i]=$this->det->array[
$i][
'j_qcode'];
1133 $array[
"poste".$i]=$this->det->array[
$i][
'j_poste'];
1134 $array[
"amount".$i]=$this->det->array[
$i][
'j_montant'];
1135 if ( $this->det->array[
$i][
'j_debit'] ==
't') {
1138 $array[
"ld".$i]=$this->det->array[
$i][
'j_text'];
1156 parent::__construct($p_cn,$p_jrid);
1157 $this->signature=
'VEN';
1158 $this->det=
new stdClass();
1164 select qs_id, qs_internal
1181join jrnx jx1 using(j_id)
1182left join operation_currency oc1 using(j_id)
1183where jx1.j_grpt = $1
1186 $this->det->array=$this->
db->get_array(
$sql,array($this->det->jr_grpt_id));
1195 $array=parent::compute_array();
1200 $array[
"e_client"]=$this->
db->get_value(
"select ad_value from fiche_detail where f_id=$1 and ad_id=23",
1201 array($this->det->array[0][
'qs_client']));
1204 $array[
"e_march".$i]=$this->
db->get_value(
"select ad_value from fiche_detail where f_id=$1 and ad_id=23",
1205 array($this->det->array[
$i][
'qs_fiche']));
1207 $array[
"e_march".$i.
"_price"]=$this->det->array[
$i][
'qs_unit'];
1208 $array[
"e_march".$i.
"_label"]=$this->det->array[
$i][
'j_text'];
1209 $array[
"e_march".$i.
"_tva_id"]=$this->det->array[
$i][
'qs_vat_code'];
1210 $array[
"e_march".$i.
"_tva_amount"]=$this->det->array[
$i][
'qs_vat'];
1211 $array[
"e_quant".$i]=$this->det->array[
$i][
'qs_quantite'];
1231 parent::__construct($p_cn,$p_jrid);
1232 $this->signature=
'ACH';
1239 select qp_id, qp_internal
1248, qp1.qp_nd_tva_recup
1259from quant_purchase qp1
1260join jrnx jx1 using(j_id)
1261left join operation_currency oc1 using(j_id)
1262where jx1.j_grpt = $1
1265 $this->det->array=$this->
db->get_array(
$sql,array($this->det->jr_grpt_id));
1276 $array=parent::compute_array();
1281 $array[
"e_client"]=$this->
db->get_value(
"select ad_value from fiche_detail where f_id=$1 and ad_id=23",
1282 array($this->det->array[0][
'qp_supplier']));
1285 $array[
"e_march".$i]=$this->
db->get_value(
"select ad_value from fiche_detail where f_id=$1 and ad_id=23",
1286 array($this->det->array[
$i][
'qp_fiche']));
1288 $array[
"e_march".$i.
"_price"]=$this->det->array[
$i][
'qp_unit'];
1289 $array[
"e_march".$i.
"_label"]=$this->det->array[
$i][
'j_text'];
1290 $array[
"e_march".$i.
"_tva_id"]=$this->det->array[
$i][
'qp_vat_code'];
1291 $array[
"e_march".$i.
"_tva_amount"]=$this->det->array[
$i][
'qp_vat'];
1292 $array[
"e_quant".$i]=$this->det->array[
$i][
'qp_quantite'];
1314 parent::__construct($p_cn,$p_jrid);
1315 $this->signature=
'FIN';
1330 left join operation_currency oc1 using(j_id)
1333 $this->det->array=$this->
db->get_array(
$sql,array($this->
jr_id));
1342 $array=parent::compute_array();
1348 $array[
"e_other".$i]=$this->
db->get_value(
"select ad_value from fiche_detail where f_id=$1 and ad_id=23",
1349 array($this->det->array[
$i][
'qf_other']));
1351 $array[
"e_other".$i.
"_amount"]=$this->det->array[
$i][
'qf_amount'];
1352 $array[
"e_other".$i.
"_comment"]=$this->det->jr_comment;
noalyss_strlentrim($p_string)
h1($p_string, $p_class="")
noalyss_str_replace($search, $replace, $string)
nbm($p_number, $p_dec=2)
format the number with a sep.
global $g_user
if no group available , then stop
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
h( $row[ 'oa_description'])
if(isNumber($jr_id)==0) $ledger_id
_("actif, passif,charge,...")
for($j=0;$j< $nb_row;$j++)($j%2==0)? 'even' $show
display currency , convert to euro , and save them if used.
Contains the detail of an operation Acc_Operation.
__construct($p_cn, $p_jrid=0)
this class manage data from the QUANT_FIN table
__construct($p_cn, $p_jrid=0)
Class for jrn, class acc_ledger for manipulating the ledger AND some acc.
this class manage data from the JRNX and JRN table
__construct($p_cn, $p_jrid=0)
this file match the tables jrn & jrnx the purpose is to remove or save accountant writing to these ta...
prepare_sql_tiers()
prepare the query for getting the qcode of the tiers, when executing this SQL , an array of (jrn....
get_sum_other_tax()
get the sum of other tax linked to this operation
operation_update_comment($p_text)
add a comment to the operation (jrn.jr_text)
get_quant()
retrieve data from the table QUANT_*
form_clone_operation($p_id)
create a form to recreate the operation and returns it, it works the same as when you want to correct...
insert_jrnx()
Insert into the table Jrn The needed data are :
static select_operation_type($p_status)
Return a select object to choose the type of operation.
get_internal()
Return the internal value, the property jr_id must be set before.
get_data($p_grpt)
Get data from jrnx where p_grpt=jrnx(j_grpt)
get_amount()
return amount of the jr_id
__construct($p_cn)
constructor set automatically the attributes user and periode
set_paid()
flag the operation as paid
update_receipt()
set the pj of a operation in jrn. the jr_id must be set
get_ledger()
return the jrn_def_id from jrn
insert_jrn()
Insert into the table Jrn, the amount is computed from jrnx thanks the group id ($p_grpt)
operation_update_date_limit($p_text)
add a limit of payment to the operation (jrn.jr_ech)
update_comment($p_text)
add a comment to the line (jrnx.j_text)
save_info($p_info, $p_type)
Save into jrn_info.
get_jrnx_detail()
retrieve data from jrnx
prepare_sql_counterpart()
prepare the query for getting the qcode of the tiers, when executing this SQL , an array of (jrn....
get_currency_amount()
retrieve amount in currency for the operation
get_info()
retrieve info from the jrn_info, create 2 new arrays obj->info->command and obj->info->other the colu...
display_jrnx_detail($p_table)
display_jrnx_detail : get the data from get_jrnx_data and return a string with HTML code
find_tiers($pn_jrn_id, $pn_jrnx_id, $p_code)
Find the tiers of an operation , thanks the SQL prepared query prep_tiers and prep_counterpart.
set_id($p_id)
set the operation id (jrn.jr_id)
seek_internal($p_internal)
search an operation thankx it internal code
insert_related_action($p_string)
seek_group()
retrieve the grpt_id from jrn for a jr_id
this class manage data from the QUANT_PURCHASE table
__construct($p_cn, $p_jrid=0)
this class manage data from the QUANT_SOLD table
__construct($p_cn, $p_jrid=0)
static fetch_all($ret)
wrapper for the function pg_fetch_all
static fetch_result($ret, $p_row=0, $p_col=0)
wrapper for the function pg_fetch_all
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
class_action for manipulating actions action can be :
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
if( $delta< 0) elseif( $delta==0)
for($i=0;$i< $nb_jrn;$i++) $deb