25require_once NOALYSS_INCLUDE.
'/lib/user_common.php';
26require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
38 $this->ledger_type=
'ACH';
39 parent::__construct($p_cn,$p_init);
40 $this->payment_operation=-1;
52 throw new Exception (
"Array empty");
61 throw new Exception (_(
'Accès interdit'),20);
65 if ( isset($mt) && $this->
db->count_sql(
'select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 )
66 throw new Exception (_(
'Double Encodage'),5);
70 throw new Exception(_(
'Vous n\'avez pas donné de fournisseur'),11);
75 throw new Exception(_(
'Date invalide'), 2);
90 throw new Exception(_(
'Date et periode ne correspondent pas'),6);
95 throw new Exception(_(
'Periode fermee'),6);
105 throw new Exception(_(
'Vous utilisez le mode strict la dernière operation est à la date du ')
106 .$last_date._(
' vous ne pouvez pas encoder à une '.
107 ' date antérieure dans ce journal'),13);
113 $fiche->get_by_qcode($e_client);
116 throw new Exception(_(
'La fiche ').$e_client._(
'n\'a pas de poste comptable'),8);
121 if ( strpos($sposte,
',') != 0 )
123 $array=explode(
',',$sposte);
133 if (
$poste->load() ==
false )
135 throw new Exception(_(
'Pour la fiche ').$e_client._(
' le poste comptable [').$poste->id.
'] '._(
'n\'existe pas'),9);
139 $fiche->get_by_qcode($e_client,
'cred');
141 throw new Exception(_(
'La fiche ').$e_client._(
'n\'est pas accessible à ce journal'),10);
158 for (
$i=0;
$i< $nb_item;
$i++)
162 if (
isNumber(${
'e_march'.$i.
'_price'}) == 0 )
163 throw new Exception(_(
'La fiche ').${
'e_march'.$i}._(
'a un montant invalide').
' ['.${
'e_march'.$i}.
']',6);
164 if (
isNumber(${
'e_quant'.$i}) == 0 )
165 throw new Exception(_(
'La fiche ').${
'e_march'.$i}._(
'a une quantité invalide').
' ['.${
'e_quant'.$i}.
']',7);
170 if ( empty(${
'e_march'.$i.
'_tva_id'}) )
171 throw new Exception(_(
'La fiche ').${
'e_march'.$i}._(
'a un code tva invalide').
' ['.${
'e_march'.$i.
'_tva_id'}.
']',13);
173 $tva_rate->set_parameter(
'id',${
'e_march'.$i.
'_tva_id'});
176 throw new Exception(_(
'La fiche ').${
'e_march'.$i}._(
'a un code tva invalide').
' ['.${
'e_march'.$i.
'_tva_id'}.
']',13);
183 $this->
db->get_value(
'select count(*) from tmp_pcmn where pcm_val=$1',array(
$a_poste[0])) == 0 )
184 throw new Exception(_(
" La TVA ".
$tva_rate->tva_label.
" utilise des postes comptables inexistants"));
189 $fiche->get_by_qcode(${
'e_march'.$i});
191 throw new Exception(_(
'La fiche ').${
'e_march'.$i}._(
'n\'a pas de poste comptable'),8);
196 if ( strpos($sposte,
',') != 0 )
198 $array=explode(
',',$sposte);
208 if (
$poste->load() ==
false )
210 throw new Exception(_(
'Pour la fiche ').${
'e_march'.$i}._(
' le poste comptable').
' ['.
$poste->id._(
'n\'existe pas'),9);
214 $fiche->get_by_qcode(${
'e_march'.$i});
216 throw new Exception(_(
'La fiche ').${
'e_march'.$i}._(
'n\'est pas accessible à ce journal'),10);
230 if ( !
$fiche->empty_attribute($key[0]) &&
$fiche->empty_attribute($key[2]))
233 if ( $this->
db->count_sql(
'select pcm_val from tmp_pcmn where pcm_val=$1',array(
$a->p_value))==0)
234 throw new Exception ($key[1]._(
"ce code n'a pas de poste comptable, créez ce poste : [".
$a->p_value.
"]"));
236 if ( !
$fiche->empty_attribute($key[0]) && !
$fiche->empty_attribute($key[2]))
238 $nd_str=
$fiche->strAttribut($key[2]);
242 if ( $poste_nd->load() ==
false)
244 $nd_msg=sprintf(_(
"Pour la fiche %s, le compte contrepartie %s n'existe pas"),
245 $fiche->getName(),$poste_nd->id);
247 throw new Exception ($nd_msg);
252 if ( ${
"e_quant".$i} != 0 && trim(${
"e_quant".$i}) !=
"" ) {
$nb++;}
256 throw new Exception(_(
'Il n\'y a aucune marchandise'),12);
259 if ( isset ($mp_date) && trim ($mp_date) !=
"" &&
isDate($mp_date) ==
null) {
260 throw new Exception(_(
'Date de paiement invalide'),13);
264 if ( isset ($mp_date) && trim ($mp_date) !=
"" &&
isDate($mp_date) == $mp_date ) {
269 throw new Exception(_(
"Période fermée").
" $mp_date ");
274 if ( isset ($e_ech) && trim ($e_ech)!=
"" &&
isDate($e_ech) ==
null )
276 throw new Exception(_(
'Date échéance invalide'),14);
280 if (
isNumber($p_currency_rate) == 0 || $p_currency_rate <=0 ) {
281 throw new Exception(_(
'Taux devise invalide'),15);
334 if ($p_acc_operation->jrnx_id == 0) {
335 throw new Exception(__FILE__.__LINE__.
'invalid acc_operation.j_id');
337 $source_j_id=$p_acc_operation->jrnx_id ;
342 if ($p_nd_amount->amount_nd_rate != 0)
352 $dna = $dna_default->p_value;
354 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
356 $p_acc_operation->type =
'd';
357 $p_acc_operation->amount = $p_nd_amount->amount_nd;
358 $p_acc_operation->poste = $dna;
359 $p_acc_operation->qcode =
'';
361 if ($p_nd_amount->amount_nd > 0)
362 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->amount_nd );
368 if ($p_nd_amount->amount_perso != 0)
373 $p_acc_operation->type =
'd';
379 $dna = $dna_default->p_value;
381 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
383 $p_acc_operation->amount = $p_nd_amount->amount_perso ;
384 $p_acc_operation->poste = $dna;
385 $p_acc_operation->qcode =
'';
387 if ($p_nd_amount->amount_perso> 0)
388 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->amount_perso);
391 if ($p_nd_amount->nd_vat != 0)
396 $p_acc_operation->type =
'd';
397 $p_acc_operation->qcode =
'';
403 $dna = $dna_default->p_value;
405 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
407 $p_acc_operation->amount = $p_nd_amount->nd_vat;
408 $p_acc_operation->poste = $dna;
416 $op->oa_group=$p_group;
418 $op->oa_date=$p_acc_operation->date;
422 $op->oa_jrnx_id_source=$source_j_id;
423 $op->save_form_plan_vat_nd(
$_POST,
$idx,
$j_id,$p_nd_amount->nd_vat,$p_acc_operation->jrnx_id);
425 if ($p_nd_amount->nd_vat> 0)
426 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->nd_vat);
429 if ($p_nd_amount->nd_ded_vat != 0)
438 $dna = $dna_default->p_value;
440 $dna = ($dna ==
'') ? $dna_default->value : $dna;
444 $p_acc_operation->type =
'd';
445 $p_acc_operation->qcode =
'';
446 $p_acc_operation->amount = $p_nd_amount->nd_ded_vat;
447 $p_acc_operation->poste = $dna;
449 if ($p_nd_amount->nd_ded_vat > 0)
450 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->nd_ded_vat);
457 $op->oa_group=$p_group;
459 $op->oa_date=$p_acc_operation->date;
463 $op->oa_jrnx_id_source=$source_j_id;
512 $group=$this->
db->get_next_seq(
"s_oa_group");
513 $seq=$this->
db->get_next_seq(
's_grpt');
517 $this->
internal=$internal;
520 $cust->get_by_qcode($e_client);
523 if ( strpos($sposte,
',') != 0 )
525 $array=explode(
',',$sposte);
561 for (
$i=0;
$i< $nb_item;
$i++)
563 if ( empty(${
'e_march'.$i}) || empty(${
'e_quant'.$i}) )
continue;
567 $fiche->get_by_qcode(${
"e_march".$i});
572 $idx_tva=trim(${
'e_march'.$i.
'_tva_id'});
575 $oTva->set_parameter(
'id',$idx_tva);
577 $tva_both=$oTva->get_parameter(
"both_side");
582 $acc_operation->grpt=
$seq;
583 $acc_operation->jrn=
$p_jrn;
584 $acc_operation->type=
'd';
585 $acc_operation->periode=$tperiode;
586 $acc_operation->qcode=
"";
587 $amount_4=bcmul(${
'e_march'.$i.
'_price'},${
'e_quant'.$i});
592 $acc_amount->check=
false;
593 $acc_amount->set_parameter(
'amount',$amount_4);
595 $acc_amount->set_parameter(
"currency_rate", $p_currency_rate);
596 $acc_amount->convert_euro();
597 $amount_euro=$acc_amount->amount;
602 $acc_amount->set_parameter(
'amount_vat_rate',$oTva->get_parameter(
'rate'));
603 if (
noalyss_strlentrim(${
'e_march'.$i.
'_tva_amount'}) ==0 || ${
'e_march'.$i.
'_tva_amount'} == 0)
606 $acc_amount->compute_vat();
612 $acc_amount->set_parameter(
"amount_vat", ${
'e_march'.$i.
'_tva_amount'});
613 $acc_amount->convert_euro_vat();
617 $tot_tva=bcadd($tot_tva,$acc_amount->amount_vat);
618 $tot_tva=round($tot_tva,2);
623 $save_amount_vat=$acc_amount->amount_vat;
625 $acc_amount->correct();
627 $acc_amount->amount_unpaid=($tva_both == 1 ) ? $save_amount_vat :0 ;
628 $tot_tva_reversed=bcadd($tot_tva_reversed,$acc_amount->amount_unpaid);
639 if ( strpos($sposte,
',') != 0 )
641 $array=explode(
',',$sposte);
650 $acc_operation->desc=strip_tags(${
"e_march".$i.
"_label"});
654 $acc_operation->desc=
null;
656 $acc_operation->poste=$poste_val;
657 $acc_operation->amount=$acc_amount->amount;
658 $acc_operation->qcode=${
"e_march".$i};
659 if ($acc_amount->amount>0)
661 $tot_debit=bcadd($tot_debit, $acc_amount->amount);
663 $j_id=$acc_operation->insert_jrnx();
672 $tva_item=$acc_amount->amount_vat;
674 if (isset($tva[$idx_tva]))
676 $tva[$idx_tva]=bcadd($tva[$idx_tva], $tva_item);
679 $tva[$idx_tva]=$tva_item;
685 $nNeg=(${
"e_quant" .
$i}< 0) ? -1 : 1;
691 $dir=(${
'e_quant'.$i} < 0 ) ?
'c':
'd';
699 $op->set_currency_rate($p_currency_rate);
700 $op->oa_group=$group;
710 if (empty( ${
'e_march' .
$i .
'_price'} ) ) ${
'e_march' .
$i .
'_price'} = 0;
711 if (empty( ${
'e_march' .
$i } ) ) ${
'e_march' .
$i } = 0;
712 if (empty( ${
'e_quant' .
$i } ) ) ${
'e_quant' .
$i } = 0;
713 $price_euro=bcdiv(${
'e_march'.$i.
'_price'}, $p_currency_rate);
718 $r=$this->
db->exec_sql(
"select insert_quant_purchase ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)",
724 ,round($amount_euro,2)
725 ,$acc_amount->amount_vat
726 ,$oTva->get_parameter(
'id')
727 ,$acc_amount->amount_nd
729 ,$acc_amount->nd_ded_vat
730 ,$acc_amount->amount_perso
732 , $acc_amount->amount_unpaid
740 $acc_amount->amount_vat=0;
741 $r=$this->
db->exec_sql(
"select insert_quant_purchase ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)",
747 ,round($acc_amount->amount,2)
750 ,$acc_amount->amount_nd
752 ,$acc_amount->nd_ded_vat
753 ,$acc_amount->amount_perso
755 , $acc_amount->amount_unpaid
763 $operation_currency->oc_amount=$acc_amount->amount_currency;
764 $operation_currency->oc_vat_amount=($tva_both==0)?$acc_amount->amount_vat_currency:0;
765 $operation_currency->oc_price_unit=${
'e_march'.$i.
'_price'};
766 $operation_currency->j_id=
$j_id;
767 $operation_currency->insert();
768 $tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_currency,4),4);
769 $tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_vat_currency,4),4);
770 if ( DEBUGNOALYSS > 1 ) {
771 echo __LINE__.
" insert into operation currency oc_amount:{$acc_amount->amount_currency} oc_vat_amount {$acc_amount->amount_vat_currency} <br>";
778 $row=$this->
db->get_row(
"select ac_id,ac_label,ac_accounting
782 if ( ! empty (
$row )) {
786 $acc_operation->poste=
$row[
'ac_accounting'];
788 $acc_operation->grpt=
$seq;
789 $acc_operation->jrn=
$p_jrn;
790 $acc_operation->type=
'd';
791 $acc_operation->periode=$tperiode;
792 $acc_operation->desc=
$row[
'ac_label'];
794 $jrn_tax_sql->j_id=$acc_operation->insert_jrnx();
795 $jrn_tax_sql->ac_id=
$row[
'ac_id'];
796 $jrn_tax_sql->pcm_val=
$row[
'ac_accounting'];
797 $jrn_tax_sql->insert();
799 $operation_currency->oc_amount=
$p_array[
'other_tax_amount'];
800 $operation_currency->oc_vat_amount=0;
801 $operation_currency->oc_price_unit=0;
802 $operation_currency->j_id=$jrn_tax_sql->j_id;
803 $operation_currency->insert();
813 if ( DEBUGNOALYSS > 1 ) {
814 echo __LINE__.
" tot_amount $tot_amount<br>";
815 echo __LINE__.
" tot_tva $tot_tva<br>";
821 $acc_operation->poste=
$poste;
822 $acc_operation->amount=bcsub($cust_amount,$tot_tva_reversed);
823 $acc_operation->grpt=
$seq;
824 $acc_operation->jrn=
$p_jrn;
825 $acc_operation->type=
'c';
826 $acc_operation->periode=$tperiode;
827 $acc_operation->qcode=${
"e_client"};
830 $tot_debit=bcadd($tot_debit, abs($cust_amount));
832 $let_client=$acc_operation->insert_jrnx();
836 $operation_currency->oc_amount=$tot_amount_cur;
837 $operation_currency->oc_vat_amount=0;
838 $operation_currency->oc_price_unit=0;
839 $operation_currency->j_id=$let_client ;
840 $operation_currency->insert();
850 $oTva->set_parameter(
'id',
$i);
853 $poste_vat=$oTva->get_side(
'd');
858 $acc_operation->poste=$poste_vat;
859 $acc_operation->amount=
$value;
860 $acc_operation->grpt=
$seq;
861 $acc_operation->jrn=
$p_jrn;
862 $acc_operation->type=
'd';
863 $acc_operation->periode=$tperiode;
864 if (
$value > 0 ) $tot_debit=bcadd($tot_debit,abs(
$value));
865 $acc_operation->insert_jrnx();
868 if ( $oTva->get_parameter(
"both_side")==1 )
870 $poste_vat=$oTva->get_side(
'c');
871 if ( $poste_vat ==
'#')
873 $poste_vat=$oTva->get_side(
'd');
877 $acc_operation->poste=$poste_vat;
878 $acc_operation->amount=$tot_tva_reversed;
879 $acc_operation->grpt=
$seq;
880 $acc_operation->jrn=
$p_jrn;
881 $acc_operation->type=
'c';
882 $acc_operation->periode=$tperiode;
883 $acc_operation->insert_jrnx();
884 if (
$value < 0 ) $tot_debit=bcadd($tot_debit,abs(
$value));
893 $acc_operation->echeance=$e_ech;
895 $acc_operation->amount=$this->
db->get_value(
"select sum(j_montant) from jrnx where j_grpt = $1 and j_debit='t'",
897 if ( DEBUGNOALYSS > 1 ) {
898 echo __LINE__.
" amount ".$acc_operation->amount.
"<br>";
901 $acc_operation->desc=$e_comm;
902 $acc_operation->grpt=
$seq;
903 $acc_operation->jrn=
$p_jrn;
904 $acc_operation->periode=$tperiode;
905 $acc_operation->pj=$e_pj;
906 $acc_operation->mt=$mt;
907 $acc_operation->currency_id=$p_currency_code;
908 $acc_operation->currency_rate=$p_currency_rate;
909 $acc_operation->currency_rate_ref=$currency_rate_ref->get_rate();
911 if ( ! $this->
jr_id=$acc_operation->insert_jrn() ) {
912 throw new Exception (_(
"Erreur de balance"));
914 $this->pj=$acc_operation->set_pj();
920 $this->
db->exec_sql(
'update quant_purchase set qp_internal = $1 where j_id in (select j_id from jrnx where j_grpt=$2)',
921 array($internal,
$seq));
930 if ( isset ($_FILES))
932 if (
sizeof($_FILES) != 0 )
933 $this->
db->save_receipt(
$seq);
938 if ( isset(
$_POST[
'gen_invoice']) )
954 $acseq=$this->
db->get_next_seq(
's_grpt');
955 $acjrn=
new Acc_Ledger($this->
db,$mp->get_parameter(
'ledger_target'));
956 $acinternal=$acjrn->compute_internal_code($acseq);
960 if ( $acjrn->get_type()==
'FIN') {
962 $acfiche=
new Fiche($this->
db,$acjrn->get_bank());
965 $fqcode = ${
'e_mp_qcode_' . $e_mp};
966 $acfiche =
new Fiche($this->
db);
967 $acfiche->get_by_qcode($fqcode);
976 if ( strpos($sposte,
',') != 0 )
978 $array=explode(
',',$sposte);
986 $cust_amount=bcsub($cust_amount, $tot_tva_reversed);
989 $acompte_defcur=bcdiv(
$acompte, $p_currency_rate);
991 $famount=bcsub($cust_amount,$acompte_defcur);
993 $acc_pay->poste=$poste_val;
994 $acc_pay->qcode=$fqcode;
995 $acc_pay->amount=abs(round($famount,2));
997 $acc_pay->grpt=$acseq;
998 $acc_pay->jrn=$mp->get_parameter(
'ledger_target');
999 $acc_pay->periode=$tperiode;
1000 $acc_pay->type=($famount>=0)?
'c':
'd';
1001 $let_pay=$acc_pay->insert_jrnx();
1005 $acc_pay->date=empty($mp_date)?
$e_date:$mp_date;
1007 $acc_pay->qcode=$e_client;
1008 $acc_pay->amount=abs(round($famount,2));
1010 $acc_pay->grpt=$acseq;
1011 $acc_pay->jrn=$mp->get_parameter(
'ledger_target');
1012 $acc_pay->periode=$tperiode;
1013 $acc_pay->type=($famount>=0)?
'd':
'c';
1014 $let_other=$acc_pay->insert_jrnx();
1018 $operation_currency->oc_amount=bcsub($tot_amount_cur,
$acompte);
1019 $operation_currency->oc_vat_amount=0;
1020 $operation_currency->oc_price_unit=0;
1021 $operation_currency->j_id=$let_other;
1022 $operation_currency->insert();
1026 $operation_currency->oc_amount=bcsub($tot_amount_cur,
$acompte);
1027 $operation_currency->oc_vat_amount=0;
1028 $operation_currency->oc_price_unit=0;
1029 $operation_currency->j_id=$let_pay;
1030 $operation_currency->insert();
1034 $acc_pay->desc=(!isset($e_comm_paiement) ||
noalyss_strlentrim($e_comm_paiement) == 0) ?$e_comm:$e_comm_paiement;
1037 $acc_pay->currency_id=$p_currency_code;
1038 $acc_pay->currency_rate=$p_currency_rate;
1039 $acc_pay->currency_rate_ref=$currency_rate_ref->get_rate();
1043 $mp_jr_id=$acc_pay->insert_jrn();
1044 $this->payment_operation=$mp_jr_id;
1045 $acjrn->grpt_id=$acseq;
1046 $acjrn->update_internal_code($acinternal);
1048 if ($acjrn->get_type()==
"ODS") {
1049 $acc_pay->pj=$acjrn->guess_pj();
1052 $r1=$this->
get_id($internal);
1053 $r2=$this->
get_id($acinternal);
1059 $oletter->insert_couple($let_client,$let_other);
1062 $Res=$this->
db->exec_sql(
"update jrn set jr_rapt='paid' where jr_id=$1",array($r1));
1066 $rec->set_jr_id($r1);
1077 if (
$prop[
'jrn_def_type'] ==
'FIN' )
1079 $ledger->insert_quant_fin($acfiche->id,$mp_jr_id,$cust->id,bcmul($famount,-1),$let_other);
1087 if (isset(
$p_array[
'jrn_note_input']) && !empty(
$p_array[
'jrn_note_input'])) {
1089 $acc_operation_note->setNote(
$p_array[
'jrn_note_input']);
1090 $acc_operation_note->setOperation_id( $this->
jr_id);
1091 $acc_operation_note->save();
1094 catch (Exception
$e)
1097 echo
'<span class="error">'.
1098 'Erreur dans l\'enregistrement '.
1099 __FILE__.
':'.__LINE__.
' '.
1100 $e->getMessage().$e->getMessage();
1102 $this->
db->rollback();
1103 throw new Exception(
$e);
1105 $this->
db->commit();
1152 $str_add_button_tiers =
"";
1156 $str_add_button_tiers = $this->add_card(
"cred",
"e_client");
1160 list ($l_date_start,$l_date_end)=
$oPeriode->get_date_limit(
$g_user->get_periode());
1166 $e_ech=(isset($e_ech))?$e_ech:
"";
1167 $e_comm=(isset($e_comm))?$e_comm:
"";
1170 $r.=dossier::hidden();
1171 $f_legend_detail=_(
"Détail articles achetés");
1176 $Date->setReadOnly(
false);
1179 $f_date=$Date->input(
"e_date",$op_date);
1182 $Echeance=
new IDate();
1183 $Echeance->setReadOnly(
false);
1184 $Echeance->tabindex=2;
1186 $f_echeance=$Echeance->input(
'e_ech',$e_ech,
'Echéance'.
$label);
1188 if ($this->check_periode() ==
true)
1192 $l_user_per=
$g_user->get_periode();
1195 $period=
new IPeriod(
"period");
1197 $period->cn=$this->db;
1198 $period->value=
$def;
1202 $l_form_per=$period->input();
1204 catch (Exception
$e)
1207 if (
$e->getCode() == 1 )
1209 throw new Exception( _(
"Aucune période ouverte"));
1215 $f_periode=
td(_(
"Période comptable").
" $label ").td($l_form_per);
1223 $add_js=
"update_pj();";
1227 $add_js.=
'get_last_date();';
1229 $add_js.=
'update_name();';
1230 $add_js.=
'update_pay_method();';
1231 $add_js.=
'update_row("sold_item");';
1232 $add_js.=
'update_other_tax();';
1233 $add_js.=
'update_visibility_quantity();';
1235 $wLedger=$this->select_ledger(
'ACH',2,FALSE);
1237 if (
$wLedger ==
null)
throw new Exception(_(
'Pas de journal disponible'));
1238 $wLedger->javascript=
"onChange='update_predef(\"ach\",\"f\",\"".$http->request(
"ac").
"\");$add_js'";
1244 $Commentaire=
new IText();
1245 $Commentaire->table=0;
1246 $Commentaire->setReadOnly(
false);
1247 $Commentaire->size=60;
1248 $Commentaire->tabindex=3;
1250 $f_desc=$Commentaire->input(
"e_comm",$e_comm);
1258 $default_pj=$this->guess_pj();
1262 $pj->value=(isset($e_pj))?$e_pj:$default_pj;
1266 $pj->setReadOnly(
true);
1272 $pj->readonly=
false;
1274 $f_pj=$pj->input().HtmlInput::hidden(
'e_pj_suggest',$default_pj);
1282 $e_client=( isset ($e_client) )?$e_client:
"";
1283 $e_client_label=
" ";
1291 $fClient=
new Fiche($this->
db);
1292 $fClient->get_by_qcode($e_client);
1302 $W1->label=_(
"Fournisseur ").Icon_Action::infobulle(0) ;
1303 $W1->name=
"e_client";
1305 $W1->value=$e_client;
1307 $W1->set_dblclick(
"fill_ipopcard(this);");
1308 $W1->set_attribute(
'ipopup',
'ipopcard');
1311 $W1->set_attribute(
'label',
'e_client_label');
1313 $W1->set_attribute(
'typecard',
'cred');
1316 $W1->set_callback(
'filter_card');
1317 $W1->set_function(
'fill_data');
1318 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
1320 $f_client_qcode=$W1->input();
1321 $client_label=
new ISpan();
1322 $client_label->style=
"vertical-align:top";
1323 $client_label->table=0;
1324 $f_client=$client_label->input(
"e_client_label",$e_client_label);
1325 $f_client_bt=$W1->search();
1330 $e_comment=(isset($e_comment))?$e_comment:
"";
1331 $p_article= ( isset ($nb_item))?$nb_item:$this->get_min_row();
1332 $p_article=($p_article < $this->get_min_row())?$this->get_min_row():$p_article;
1335 $r.=$Hid->input(
"nb_item",$p_article);
1339 for (
$i=0;
$i< $p_article ;
$i++)
1343 $march=(isset(${
"e_march$i"}))?${
"e_march$i"}:
"" ;
1344 $march_price=(isset(${
"e_march".$i.
"_price"}))?${
"e_march".$i.
"_price"}:
""
1349 $march_tva_id=(isset(${
"e_march$i".
"_tva_id"}))?${
"e_march$i".
"_tva_id"}:
"";
1350 $march_tva_amount=(isset(${
"e_march$i".
"_tva_amount"}))?${
"e_march$i".
"_tva_amount"}:
"";
1355 $march_label=(isset(${
"e_march".$i.
"_label"}))?${
"e_march".$i.
"_label"}:
"";
1361 $fMarch->get_by_qcode($march);
1364 if ( ! isset($march_tva_id) &&
$g_parameter->MY_TVA_USE==
'Y' )
1371 $W1->name=
"e_march".$i;
1374 $W1->set_dblclick(
"fill_ipopcard(this);");
1375 $W1->set_attribute(
'ipopup',
'ipopcard');
1377 $W1->set_attribute(
'typecard',
'deb');
1380 $W1->set_attribute(
'label',
'e_march'.
$i.
'_label');
1382 $W1->set_attribute(
'purchase',
'e_march'.
$i.
'_price');
1383 $W1->set_attribute(
'price',
'e_march'.
$i.
'_price');
1386 $W1->set_attribute(
'tvaid',
'e_march'.
$i.
'_tva_id');
1388 $W1->set_callback(
'filter_card');
1389 $W1->set_function(
'fill_data');
1390 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
1392 $W1->readonly=
false;
1393 $array[
$i][
'quick_code']=$W1->input();
1395 $array[
$i][
'card_add']=($add_card==TRUE)?$this->add_card(
"deb", $W1->id):
"";
1405 $tvac=
new INum(
'tvac_march'.
$i);
1413 $htva=
new INum(
'htva_march'.
$i);
1421 $Span=
new IText(
"e_march".
$i.
"_label");
1422 $Span->style=
'class="input_text label_item"';
1425 $Span=
new ISpan(
"e_march".
$i.
"_label");
1426 $Span->extra=
'class="label_item"';
1428 $Span->value=$march_label;
1429 $Span->setReadOnly(
false);
1432 $array[
$i][
'denom']=$Span->input(
"e_march".
$i.
"_label",$march_label);
1435 $Price->setReadOnly(
false);
1437 $Price->javascript=
"onblur=\"format_number(this,4);clean_tva($i);compute_ledger($i)\"";
1438 $array[
$i][
'pu']=$Price->input(
"e_march".
$i.
"_price",$march_price);
1445 $Tva->js=
"onblur=\"clean_tva($i);compute_ledger($i)\"";
1446 $Tva->in_table=
true;
1447 $Tva->set_attribute(
'compute',
$i);
1448 $Tva->set_filter(
"purchase");
1449 $Tva->value=$march_tva_id;
1450 $array[
$i][
'tva']=$Tva->input(
"e_march$i".
"_tva_id");
1455 $Tva_amount=
new INum();
1456 $Tva_amount->setReadOnly(
false);
1457 $Tva_amount->size=9;
1458 $Tva_amount->javascript=
"onblur=\"format_number(this);compute_ledger($i)\"";
1459 $array[
$i][
'amount_tva']=$Tva_amount->input(
"e_march".
$i.
"_tva_amount",$march_tva_amount);
1463 $quant=(isset(${
"e_quant$i"}))?${
"e_quant$i"}:
"1"
1465 $Quantity=
new INum();
1466 $Quantity->setReadOnly(
false);
1468 $Quantity->javascript=
"onchange=\"format_number(this,2);clean_tva($i);compute_ledger($i)\"";
1469 $array[
$i][
'quantity']=$Quantity->input(
"e_quant".
$i,$quant);
1472 $f_type=_(
'Fournisseur');
1475 $currency_select = $this->CurrencyInput(
"currency_code",
"p_currency_rate" ,
"p_currency_euro");
1476 $currency_select->selected=
$http->request(
'p_currency_code',
'string',0);
1478 $currency_input=
new INum(
"p_currency_rate");
1479 $currency_input->prec=8;
1480 $currency_input->id=
"p_currency_rate";
1481 $currency_input->value=
$http->request(
'p_currency_rate',
'string',1);
1482 $currency_input->javascript=
'onchange="format_number(this,6);CurrencyCompute(\'p_currency_rate\',\'p_currency_euro\');"';
1490 echo
'<div id="predef_form">';
1493 $op->set_p_jrn($this->
id);
1494 $op->set_jrn_type(
"ACH");
1495 $op->set_od_direct(
'f');
1496 $url=http_build_query(array(
'p_jrn_predef'=>$this->
id,
'ac'=>
$http->request(
'ac'),
'gDossier'=>
dossier::id()));
1497 echo
$op->form_get(
'do.php?'.
$url);
1499 $str_op_template=ob_get_contents();
1503 require_once NOALYSS_TEMPLATE.
'/form_ledger_detail.php';
1504 $r.=ob_get_contents();
1516 $r.=
'<script> update_pj();</script>';
1520 $r.=
'<div id="additional_tax_div">';
1521 $r.=$this->input_additional_tax();
1538 if ( ! $p_summary ){$this->verify(
$p_array) ;}
1546 $client->get_by_qcode($e_client,
true);
1548 $client_name=
h($client->getName().
1553 if ($this->check_periode() ==
true)
1555 $lPeriode->p_id=$period;
1559 $lPeriode->find_periode(
$e_date);
1563 $r .=
'<div id="summary_op1">';
1566 $jr_id=$this->
db->get_value(
'select jr_id from jrn where jr_internal=$1',array($this->
internal));
1569 $r.=_(
'Détail opération ');
1572 $r.=sprintf (
'<a class="line" style="display:inline" href="javascript:modifyOperation(%d,%d)">%s</a>',
1580 if ( ! $p_summary) {
1581 $r.=
'<td>' . _(
'Numéro Pièce') .$span.
'</td><td>'.
hb($e_pj) .
'</td>';
1585 if ( strcmp($this->pj,$e_pj) != 0 )
1587 $r.=
'<td>' . _(
'Numéro Pièce').$span .
'</td><td>'.
hb($this->pj) .
1588 '<span class="notice"> '._(
'Attention numéro pièce existante, elle a du être adaptée').
'</span></td>';
1590 $r.=
'<td>' . _(
'Numéro Pièce') .$span.
'</td><td>'.
hb($this->pj) .
'</td>';
1594 $r.=
'<td> ' . _(
'Date') .
'</td><td> ' .
hb(
$e_date) .
'</td>';
1597 $r.=
'<td>' . _(
'Echeance') .
'</td><td> ' .
hb($e_ech) .
'</td>';
1602 $r.=
'<td> ' . _(
'Période Comptable') .
'</td><td> ' .hb(
$date_limit[
'p_start'] .
'-' .
$date_limit[
'p_end']) .
'</td>';
1606 $r .=
'<div id="summary_op2">';
1609 $r.=
'<td> ' . _(
'Journal') .
'</td><td> ' .
hb($this->get_name()) .
'</td>';
1612 $r.=
'<td> ' . _(
'Libellé') .
'</td><td> ' .
hb($e_comm) .
'</td>';
1617 $r.=
'<td> ' . _(
'Fournisseur') .
'</td><td> ' .
hb($e_client .
':' . $client_name) .
'</td>';
1620 $r.=
'<pre>'._(
'Note').
' '.
h(
$p_array[
'jrn_note_input']).
'</pre>';
1622 $r.=
'<div style="position:float;clear:both">';
1624 $r.=
'<h2>' . _(
'Détail articles achetés') .
'</h2>';
1625 $r.=
'<p class="decale">';
1626 $r.=
'<table class="result" >';
1628 $r.=
"<th>" . _(
'Code') .
"</th>";
1629 $r.=
"<th>" . _(
'Dénomination') .
"</th>";
1630 $r.=
"<th style=\"text-align:right\">" . _(
'prix') .
"</th>";
1631 $r.=
"<th style=\"text-align:right\">" . _(
'quantité') .
"</th>";
1635 $r.=
"<th style=\"text-align:right\">" . _(
'tva') .
"</th>";
1636 $r.=
'<th style="text-align:right"> ' . _(
'Montant TVA') .
'</th>';
1637 $r.=
'<th style="text-align:right">' . _(
'Montant HTVA') .
'</th>';
1638 $r.=
'<th style="text-align:right">' . _(
'Montant TVAC') .
'</th>';
1640 $r.=
'<th style="text-align:right">' . _(
'Montant') .
'</th>';
1647 $a_anc=
$anc->get_list();
1650 $r.=
'<th colspan="'.$x.
'">'._(
'Compt. Analytique').
'</th>';
1662 for (
$i = 0;
$i < $nb_item;
$i++)
1669 $fiche->get_by_qcode(${
"e_march".$i});
1671 $fiche_name=
h(${
"e_march".$i.
"_label"});
1674 $amount=bcmul(${
"e_march".$i.
"_price"},${
'e_quant'.$i});
1677 $idx_tva=${
"e_march".$i.
"_tva_id"};
1679 $oTva->set_parameter(
'id',$idx_tva);
1684 $op->set_parameter(
'amount_vat_rate',$oTva->get_parameter(
'rate'));
1686 $tva_computed=
$op->get_parameter(
'amount_vat');
1688 if ( strlen (trim (${
'e_march'.$i.
'_tva_amount'})) == 0)
1690 $tva_item=
$op->get_parameter(
'amount_vat');
1693 $tva_item=round(${
'e_march'.$i.
'_tva_amount'},2);
1695 if (isset($tva[$idx_tva] ) )
1696 $tva[$idx_tva]=bcadd($tva_item,$tva[$idx_tva]);
1698 $tva[$idx_tva]=$tva_item;
1704 $tot_row=round(bcadd($tot_row,
$amount),2);
1707 $r.=${
"e_march".$i};
1709 $r.=
'<TD style="border-bottom:1px dotted grey;">';
1712 $r.=
'<td class="num">';
1713 $r.=
nbm(${
"e_march".$i.
"_price"},4);
1715 $r.=
'<td class="num">';
1716 $r.=
nbm(${
"e_quant".$i},4);
1721 $r.=
'<td class="num">';
1722 $r.=$oTva->get_parameter(
'label');
1723 $both_side=$oTva->get_parameter(
"both_side");
1724 if ( $both_side == 0) {
1725 $tot_row=bcadd($tot_row,$tva_item);
1726 $tot_tva=round(bcadd($tva_item,$tot_tva),2);
1731 $css_void_tva=($both_side == 1)?
'style="text-decoration:line-through"':
'';
1732 if ( bcsub($tva_item,$tva_computed) != 0 && ! ($tva_item == 0 && $both_side == 1))
1735 $r.=
'<td style="background-color:red" class="num" '.$css_void_tva.
'>';
1737 $r.=
'<a href="#" class="error" style="display:inline" title="'. _(
"Attention Différence entre TVA calculée et donnée").
'">'
1738 .nbm($tva_item).
'<a>';
1741 $r.=
'<td class="num" '.$css_void_tva.
'>';
1745 $r.=
'<td class="num"> ';
1749 $r.=
'<td class="num">';
1750 $r.=
nbm(round($tot_row,2));
1761 $p_mode=($p_summary==
false)?1:0;
1774 $decalage=(
$g_parameter->MY_TVA_USE ==
'Y')?
'<td></td><td></td><td></td><td></td>':
'<td></td>';
1776 $str_tot=_(
'Totaux');
1777 $tot_eur=round(bcdiv(
$tot, $p_currency_rate),2);
1782 if ( $p_currency_code != 0 ) {
1784 $acc_currency->set_id($p_currency_code);
1789 $tot_tva=
nbm($tot_tva);
1794<
tr class=
"highlight">
1810 if ($p_currency_code !=0) {
1813<
tr class=
"highlight">
1822 {$rate} {$p_currency_rate}
1832<
tr class=
"highlight">
1847<
tr class=
"highlight">
1865 $r.=
'<input type="button" class="button" value="'._(
'Vérifiez imputation analytique').
'" onClick="verify_ca(\'\');">';
1867 $r.=
'<div id="total_div_id" >';
1868 $r.=
'<h2>Totaux</h2>';
1869 $other_tax_label=
"";
1871 if ( $this->has_other_tax() && isset(
$p_array[
'other_tax'])) {
1872 $other_tax_label=_(
"Autre taxe");
1878 $r.=
'<tr><td>Total HTVA</td>';
1881 $oTva->set_parameter(
'id',
$i);
1884 $r.=
'<tr><td> TVA ' . $oTva->get_parameter(
'label').
'</td>';
1887 $r.=
'<tr>'.td(_(
'Total TVA')).td(
hb($tot_tva),
'class="num"');
1888 if ( ! empty($other_tax_label) ) {
1892 $r.=
'<tr>'.td(_(
'Total TVAC')).td(
hb(
$tot),
'class="num"');
1895 if ( ! empty($other_tax_label) ) {
1899 $r.=
'<br>Total '.hb(
$tot);
1908 if ( isset($period))
1917 if ( $this->has_other_tax() && isset(
$p_array[
"other_tax"])) {
1921 $mt=microtime(
true);
1924 $e_mp=(isset($e_mp))?$e_mp:0;
1930 for (
$i=0;
$i < $nb_item;
$i++)
1933 if (isset (${
"e_march".$i.
"_label"}))
$r.=
HtmlInput::hidden(
"e_march".
$i.
"_label",${
"e_march".$i.
"_label"});
1947 if ( $e_mp!=0 && strlen (trim (${
'e_mp_qcode_'.$e_mp})) != 0 )
1956 $fname =
new Fiche($this->
db);
1957 $fname->get_by_qcode(${
'e_mp_qcode_' . $e_mp});
1960 if ($this->payment_operation != 1) {
1961 $pay_internal=$this->
db->get_value(
"select jr_internal from jrn where jr_id=$1",
1962 [$this->payment_operation]);
1965 $r.=
'<h2>' . _(
"Payé par").
" " . ${
'e_mp_qcode_' . $e_mp} .
1966 " " . $fname->getName() .$detail_payment.
'</h2> ' ;
1967 $r.=
'<p class="decale">' . _(
'Déduction acompte ') .
h(
$acompte) .
'</p>' .
1968 _(
'Libellé :') .
h($e_comm_paiement) ;
1978 $negative=$this->display_negative_warning(
$tot);
1979 if ( $negative !=
"") {
1980 $r.=
span($negative,
'class="warning" ');
1994 $r =
'<div id="facturation_div_id" style="height:185px;height:10rem">';
1995 $r.=
'<p class="decale">';
1998 $file->setAlertOnSize(
true);
2000 $r.=_(
"Ajoutez une pièce justificative ");
2003 if ( $this->
db->count_sql(
"select md_id,md_name from document_modele where md_affect='ACH'") > 0 )
2006 $r.=_(
'ou générer un document').
' <input type="checkbox" name="gen_invoice" >';
2009 $doc_gen->name=
"gen_doc";
2010 $doc_gen->value=$this->
db->make_array(
2011 "select md_id,md_name ".
2012 " from document_modele where md_affect='ACH' order by 2");
2013 $r.=$doc_gen->input().
'<br>';
2017 $r.=_(
'Numero de bon de commande : ').$obj->input(
'bon_comm').
'<br>';
2018 $r.=_(
'Autre information : ').$obj->input(
'other_info').
'<br>';
2035 $step=$_SESSION[SESSION_KEY.
'g_pagesize'];
2043 list($max_line2,$list2)=$this->list_operation(
$sql,
null,
$offset,1);
2050 echo
'<h2 class="info"> '._(
'Echeance dépassée').
' </h2>';
2052 echo
'<h2 class="info"> '._(
'Non Payée').
' </h2>';
2076 if ( $this->
id == 0 ) die (__FILE__.
":".__LINE__.
" Journal invalide");
2077 switch ( $p_filter_operation)
2083 $sql_filter=
" and (jr_date_paid is not null or jr_rapt ='paid' ) ";
2086 $sql_filter=
" and (jr_date_paid is null and coalesce(jr_rapt,'x') <> 'paid' ) ";
2089 throw new Exception(_(
"Filtre invalide",5));
2095 from v_detail_purchase
2098 and jr_date >= (select p_start from parm_periode where p_id = $2)
2100 and jr_date <= (select p_end from parm_periode where p_id = $3) "
2101 .
' order by jr_date,substring(jr_pj_number,\'[0-9]+$\')::numeric asc ';
2112 $array[
'jr_id'] = _(
'Numéro opération');
2113 $array[
'jr_date'] = _(
'Date');
2114 $array[
'jr_date_paid'] = _(
'Date paiement');
2115 $array[
'jr_ech'] = _(
'Date échéance');
2116 $array[
'jr_tech_per'] = _(
'Période');
2117 $array[
'jr_comment'] = _(
'Libellé');
2118 $array[
'jr_pj_number'] = _(
'Pièce');
2119 $array[
'jr_internal'] = _(
'Interne');
2120 $array[
'jr_def_id'] = _(
'Code journal');
2121 $array[
'j_poste'] = _(
'Poste');
2122 $array[
'j_text'] = _(
'Commentaire');
2123 $array[
'j_qcode'] = _(
'Code Item');
2124 $array[
'jr_rapt'] = _(
'Payé');
2125 $array[
'item_card'] = _(
'N° fiche');
2126 $array[
'item_name'] = _(
'Nom fiche');
2127 $array[
'qp_supplier'] = _(
'N° fiche fournisseur');
2128 $array[
'tiers_name'] = _(
'Nom fournisseur');
2129 $array[
'quick_code'] = _(
'Code fournisseur');
2130 $array[
'tva_label'] = _(
'Nom TVA');
2131 $array[
'tva_comment'] = _(
'Commentaire TVA');
2132 $array[
'tva_both_side'] = _(
'TVA annulée');
2133 $array[
'vat_sided'] = _(
'TVA Non Payé');
2134 $array[
'vat_code'] = _(
'Code TVA');
2135 $array[
'vat'] = _(
'Montant TVA');
2136 $array[
'price'] = _(
'Total HTVA');
2137 $array[
'quantity'] = _(
'quantité');
2138 $array[
'price_per_unit'] = _(
'PU');
2139 $array[
'non_ded_amount'] = _(
'Montant ND');
2140 $array[
'non_ded_tva'] = _(
'Montant TVA ND');
2141 $array[
'non_ded_tva_recup'] = _(
'TVA récup.');
2142 $array[
'htva'] = _(
'HTVA Opération');
2143 $array[
'tot_vat'] = _(
'TVA Opération');
2144 $array[
'tot_tva_np'] = _(
'TVA NP opération');
2145 $array[
'other_tax'] = _(
"Autre taxe");
2146 $array[
'oc_amount'] = _(
'Mont. Devise');
2147 $array[
'oc_vat_amount'] = _(
'Mont. TVA Devise');
2148 $array[
'cr_code_iso'] = _(
'Devise');
span($p_string, $p_extra='')
noalyss_strlentrim($p_string)
tr($p_string, $p_extra='')
record_log($p_message)
Record an error message into the log file of the server.
sql_string($p_string)
Fix the problem with the quote char for the database.
td($p_string='', $p_extra='')
surround the string with td
nbm($p_number, $p_dec=2)
format the number with a sep.
cmpDate($p_date, $p_date_oth)
Compare 2 dates.
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(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
catch(Exception $e) $tva_rate
Manage the account from the table jrn, jrnx or tmp_pcmn.
this class aims to compute different amount
compute_nd()
Compute the no deductible part of the amount, it reduce also the vat.
display currency , convert to euro , and save them if used.
the class Acc_Ledger_Fin inherits from Acc_Ledger, this object permit to manage the financial ledger
Handle the ledger of purchase,.
insert($p_array=null)
insert into the database, it calls first the verify function change the value of this->jr_id and this...
static heading_detail_purchase()
compute an array with the heading cells for the details, used for the export in CSV
insert_no_deductible(Acc_Compute $p_nd_amount, Fiche $p_fiche, $p_tva_both, &$p_tot_debit, Acc_Operation $p_acc_operation, $p_group, $idx)
Insert into JRNX the No Deductible amount and into Analytic Accountancy for the ND VAT.
__construct($p_cn, $p_init)
input($p_array=null, $p_readonly=0)
display the form for entering data for invoice
compute_no_deductible(Acc_Compute $p_nd_amount, Fiche $p_fiche)
Compute the ND amount thanks the attribute of the concerned card.
verify_operation($p_array)
verify that the data are correct before inserting or confirming
confirm($p_array, $p_summary=false)
show the summary of the operation and propose to save it
show_unpaid_deprecated()
update the payment
get_detail_purchase($p_from, $p_end, $p_filter_operation='all')
Retrieve data from the view v_detail_purchase.
extra_info()
the function extra info allows to
$nb
!< type of the ledger ACH ODS FIN VEN or GL
inc_seq_pj()
increment the sequence for the pj
compute_internal_code($p_grpt)
compute the internal code of the saved operation and set the $this->jr_internal to the computed value
check_currency($p_qcode_payment, $p_currency_id)
When we write a record for the payment at the same time as a sale or a purchase, to have a bank saldo...
$row
!< database connextion
create_document($internal, $p_array)
create the invoice and saved it as attachment to the operation,
is_closed($p_periode)
check if the current ledger is closed
has_other_tax()
returns true if the ledger has an additional tax
update_internal_code($p_internal)
check_payment($e_mp, $e_mp_qcode)
check if the payment method is valid
get_last_date()
get the date of the last operation
check_periode()
Check if a Dossier is using the check on the periode, if true than the user has to enter the date and...
check_strict()
Check if a Dossier is using the strict mode or not.
get_id($p_internal)
retrieve the jr_id thanks the internal code, do not change anything to the current object
check_currency_setting($p_currency_code)
Check that the currency code does exist and the setting of the folder is correct.
static build_jrn_id($p_jr_id)
this file match the tables jrn & jrnx the purpose is to remove or save accountant writing to these ta...
insert_jrnx()
Insert into the table Jrn The needed data are :
Manage the table parm_code which contains the custom parameter for the module accountancy.
Handle the table payment_method.
new class for managing the reconciliation it must be used instead of the function InsertRapt,...
Acc_Tva is used for to map the table tva_rate parameter are.
this class is used to show the form for entering an operation only FOR analytic operation to save it,...
Concerns the Analytic plan (table plan_analytique)
static hidden($p_array)
return an HTML string containing hidden input type to hold the differant PA_ID
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
strAttribut($p_ad_id, $p_return=1)
empty_attribute($p_attr)
check if an attribute is empty
Input HTML for the card show buttons, in the file, you have to add card.js How to use :
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Html Input for uploading file, must be in a form with enctype="multipart/form-data".
This class handles only the numeric input, the input will call a javascript to change comma to period...
Generate the form for the periode Data Members.
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
ORM of the table public.jrn_tax.
mother class for the lettering by account and by card use the tables jnt_letter, letter_deb and lette...
static echo_var($n_level, $msg, $print=true)
Display the value of a var if DEBUGNOALYSS is greater than $n_level, the debugging info has a certain...
ORM abstract of the table public.operation_currency.
For the periode tables parm_periode and jrn_periode.
manage the predefined operation, link to the table op_def and op_def_detail
static insert_goods(&$p_cn, $p_array)
Insert into stock_goods from ACH and VEN.
$def
show a form for quick_writing
if( $g_parameter->MY_PJ_SUGGEST=='Y') $e_date
const ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP
const ATTR_DEF_ACCOUNT_ND_TVA_ND
const SQL_LIST_UNPAID_INVOICE
const ATTR_DEF_ACCOUNT_ND
const ATTR_DEF_ACCOUNT_ND_TVA
const SQL_LIST_UNPAID_INVOICE_DATE_LIMIT
const ATTR_DEF_ACCOUNT_ND_PERSO
const ATTR_DEF_TVA_NON_DEDUCTIBLE
const ATTR_DEF_DEPENSE_NON_DEDUCTIBLE
create_script($p_string)
create the HTML for adding the script tags around of the script
check_parameter($p_array, $p_needed)
Check that all the index are in the array, used by function to check if the array contains the needed...
navigation_bar($p_offset, $p_line, $p_size=0, $p_page=1, $p_javascript="")
Create a navigation_bar (pagesize)