345 if ($p_acc_operation->jrnx_id == 0) {
346 throw new Exception(__FILE__.__LINE__.
'invalid acc_operation.j_id');
348 $source_j_id=$p_acc_operation->jrnx_id ;
353 if ($p_nd_amount->amount_nd_rate != 0)
363 $dna = $dna_default->p_value;
365 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
367 $p_acc_operation->type =
'd';
368 $p_acc_operation->amount = $p_nd_amount->amount_nd;
369 $p_acc_operation->poste = $dna;
370 $p_acc_operation->qcode =
'';
372 if ($p_nd_amount->amount_nd > 0)
373 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->amount_nd );
379 if ($p_nd_amount->amount_perso != 0)
384 $p_acc_operation->type =
'd';
390 $dna = $dna_default->p_value;
392 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
394 $p_acc_operation->amount = $p_nd_amount->amount_perso ;
395 $p_acc_operation->poste = $dna;
396 $p_acc_operation->qcode =
'';
398 if ($p_nd_amount->amount_perso> 0)
399 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->amount_perso);
402 if ($p_nd_amount->nd_vat != 0)
407 $p_acc_operation->type =
'd';
408 $p_acc_operation->qcode =
'';
414 $dna = $dna_default->p_value;
416 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
418 $p_acc_operation->amount = $p_nd_amount->nd_vat;
419 $p_acc_operation->poste = $dna;
427 $op->oa_group=$p_group;
429 $op->oa_date=$p_acc_operation->date;
433 $op->oa_jrnx_id_source=$source_j_id;
434 $op->save_form_plan_vat_nd(
$_POST,
$idx,
$j_id,$p_nd_amount->nd_vat,$p_acc_operation->jrnx_id);
436 if ($p_nd_amount->nd_vat> 0)
437 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->nd_vat);
440 if ($p_nd_amount->nd_ded_vat != 0)
449 $dna = $dna_default->p_value;
451 $dna = ($dna ==
'') ? $dna_default->value : $dna;
455 $p_acc_operation->type =
'd';
456 $p_acc_operation->qcode =
'';
457 $p_acc_operation->amount = $p_nd_amount->nd_ded_vat;
458 $p_acc_operation->poste = $dna;
460 if ($p_nd_amount->nd_ded_vat > 0)
461 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->nd_ded_vat);
468 $op->oa_group=$p_group;
470 $op->oa_date=$p_acc_operation->date;
474 $op->oa_jrnx_id_source=$source_j_id;
524 $group=$this->
db->get_next_seq(
"s_oa_group");
525 $seq=$this->
db->get_next_seq(
's_grpt');
529 $this->
internal=$internal;
532 $cust->get_by_qcode($e_client);
535 if ( strpos($sposte,
',') != 0 )
537 $array=explode(
',',$sposte);
576 $tva_reverse = array();
579 $tva_reverse_credit = array();
589 for (
$i=0;
$i< $nb_item;
$i++)
591 if ( empty(${
'e_march'.$i}) || empty(${
'e_quant'.$i}) )
continue;
595 $fiche->get_by_qcode(${
"e_march".$i});
601 $idx_tva=trim(${
'e_march'.$i.
'_tva_id'});
605 $tva_both=$oTva->get_parameter(
"both_side");
610 $acc_operation->grpt=
$seq;
611 $acc_operation->jrn=
$p_jrn;
612 $acc_operation->type=
'd';
613 $acc_operation->periode=$tperiode;
614 $acc_operation->qcode=
"";
615 $amount_4=bcmul(${
'e_march'.$i.
'_price'},${
'e_quant'.$i});
620 $acc_amount->check=
false;
621 $acc_amount->set_parameter(
'amount',$amount_4);
623 $acc_amount->set_parameter(
"currency_rate", $p_currency_rate);
624 $acc_amount->convert_euro();
625 $amount_euro=$acc_amount->amount;
630 $acc_amount->set_parameter(
'amount_vat_rate',$oTva->get_parameter(
'rate'));
631 if (
noalyss_strlentrim(${
'e_march'.$i.
'_tva_amount'}) ==0 || ${
'e_march'.$i.
'_tva_amount'} == 0)
634 $acc_amount->compute_vat();
640 $acc_amount->set_parameter(
"amount_vat", ${
'e_march'.$i.
'_tva_amount'});
641 $acc_amount->convert_euro_vat();
645 $tot_tva=bcadd($tot_tva,$acc_amount->amount_vat);
646 $tot_tva=round($tot_tva,2);
652 $save_amount_vat=$acc_amount->amount_vat;
654 $acc_amount->correct();
656 if ( $tva_both == 1 ) {
657 $acc_amount->autoreverse=$save_amount_vat;
658 $tot_tva_reversed=bcadd($tot_tva_reversed,$save_amount_vat);
670 if ( strpos($sposte,
',') != 0 )
672 $array=explode(
',',$sposte);
681 $acc_operation->desc=strip_tags(${
"e_march".$i.
"_label"});
685 $acc_operation->desc=
null;
687 $acc_operation->poste=$poste_val;
688 $acc_operation->amount=$acc_amount->amount;
689 $acc_operation->qcode=${
"e_march".$i};
690 if ($acc_amount->amount>0)
692 $tot_debit=bcadd($tot_debit, $acc_amount->amount);
694 $j_id=$acc_operation->insert_jrnx();
703 $tva_item=$acc_amount->amount_vat;
705 if ($tva_both == 0 ){
706 $tva[$idx_tva]=(isset( $tva[$idx_tva]))? $tva[$idx_tva]:0;
707 $tva[$idx_tva]=bcadd($tva[$idx_tva], $tva_item);
710 $tva_reverse[$idx_tva]=(isset($tva_reverse[$idx_tva]))?$tva_reverse[$idx_tva]:0;
711 $tva_reverse[$idx_tva]=bcadd($tva_item,$tva_reverse[$idx_tva]);
712 $tva_reverse_credit[$idx_tva]=(isset($tva_reverse_credit[$idx_tva]))?$tva_reverse_credit[$idx_tva]:0;
713 $tva_reverse_credit[$idx_tva]=bcadd($save_amount_vat,$tva_reverse_credit[$idx_tva]);
720 $nNeg=(${
"e_quant" .
$i}< 0) ? -1 : 1;
726 $dir=(${
'e_quant'.$i} < 0 ) ?
'c':
'd';
734 $op->set_currency_rate($p_currency_rate);
735 $op->oa_group=$group;
745 if (empty( ${
'e_march' .
$i .
'_price'} ) ) ${
'e_march' .
$i .
'_price'} = 0;
746 if (empty( ${
'e_march' .
$i } ) ) ${
'e_march' .
$i } = 0;
747 if (empty( ${
'e_quant' .
$i } ) ) ${
'e_quant' .
$i } = 0;
748 $price_euro=bcdiv(${
'e_march'.$i.
'_price'}, $p_currency_rate);
753 $r=$this->
db->exec_sql(
"select insert_quant_purchase ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)",
759 ,round($amount_euro,2)
760 ,$acc_amount->amount_vat
761 ,$oTva->get_parameter(
'id')
762 ,$acc_amount->amount_nd
764 ,$acc_amount->nd_ded_vat
765 ,$acc_amount->amount_perso
767 , $acc_amount->autoreverse
775 $acc_amount->amount_vat=0;
776 $r=$this->
db->exec_sql(
"select insert_quant_purchase ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)",
782 ,round($acc_amount->amount,2)
785 ,$acc_amount->amount_nd
787 ,$acc_amount->nd_ded_vat
788 ,$acc_amount->amount_perso
790 , $acc_amount->autoreverse
798 $operation_currency->oc_amount=$acc_amount->amount_currency;
799 $operation_currency->oc_vat_amount=($tva_both==0)?$acc_amount->amount_vat_currency:0;
800 $operation_currency->oc_price_unit=${
'e_march'.$i.
'_price'};
801 $operation_currency->j_id=
$j_id;
802 $operation_currency->insert();
803 $tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_currency,4),4);
804 $tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_vat_currency,4),4);
805 if ( DEBUGNOALYSS > 1 ) {
806 echo __LINE__.
" insert into operation currency oc_amount:{$acc_amount->amount_currency} oc_vat_amount {$acc_amount->amount_vat_currency} <br>";
813 $row=$this->
db->get_row(
"select ac_id,ac_label,ac_accounting
817 if ( ! empty (
$row )) {
821 $acc_operation->poste=
$row[
'ac_accounting'];
823 $acc_operation->grpt=
$seq;
824 $acc_operation->jrn=
$p_jrn;
825 $acc_operation->type=
'd';
826 $acc_operation->periode=$tperiode;
827 $acc_operation->desc=
$row[
'ac_label'];
829 $jrn_tax_sql->j_id=$acc_operation->insert_jrnx();
830 $jrn_tax_sql->ac_id=
$row[
'ac_id'];
831 $jrn_tax_sql->pcm_val=
$row[
'ac_accounting'];
832 $jrn_tax_sql->insert();
834 $operation_currency->oc_amount=
$p_array[
'other_tax_amount'];
835 $operation_currency->oc_vat_amount=0;
836 $operation_currency->oc_price_unit=0;
837 $operation_currency->j_id=$jrn_tax_sql->j_id;
838 $operation_currency->insert();
848 if ( DEBUGNOALYSS > 1 ) {
849 echo __LINE__.
" tot_amount $tot_amount<br>";
850 echo __LINE__.
" tot_tva $tot_tva<br>";
856 $acc_operation->poste=
$poste;
857 $acc_operation->amount=bcsub($cust_amount,$tot_tva_reversed);
858 $acc_operation->grpt=
$seq;
859 $acc_operation->jrn=
$p_jrn;
860 $acc_operation->type=
'c';
861 $acc_operation->periode=$tperiode;
862 $acc_operation->qcode=${
"e_client"};
865 $tot_debit=bcadd($tot_debit, abs($cust_amount));
867 $let_client=$acc_operation->insert_jrnx();
871 $operation_currency->oc_amount=$tot_amount_cur;
872 $operation_currency->oc_vat_amount=0;
873 $operation_currency->oc_price_unit=0;
874 $operation_currency->j_id=$let_client ;
875 $operation_currency->insert();
885 $poste_vat=$oTva->get_side(
'd');
890 $acc_operation->poste=$poste_vat;
891 $acc_operation->amount=
$value;
892 $acc_operation->grpt=
$seq;
893 $acc_operation->jrn=
$p_jrn;
894 $acc_operation->type=
'd';
895 $acc_operation->periode=$tperiode;
896 if (
$value > 0 ) $tot_debit=bcadd($tot_debit,abs(
$value));
897 $acc_operation->insert_jrnx();
900 foreach ($tva_reverse as
$i =>
$value) {
902 $poste_vat = $oTva->get_side(
'd');
903 if ( $poste_vat ==
'#')
905 $poste_vat=$oTva->get_side(
'c');
909 $acc_operation->date =
$e_date;
910 $acc_operation->poste = $poste_vat;
911 $acc_operation->amount =
$value;
912 $acc_operation->grpt =
$seq;
913 $acc_operation->jrn =
$p_jrn;
914 $acc_operation->type =
'd';
915 $acc_operation->periode = $tperiode;
917 $acc_operation->insert_jrnx();
921 $x=$oTva->get_parameter(
"tva_reverse_account");
922 $poste_vat =(trim($x??
"")==
"")? $oTva->get_side(
'c'):$x;
924 if ( $poste_vat ==
'#')
926 $poste_vat=$oTva->get_side(
'd');
929 $acc_operation->date =
$e_date;
930 $acc_operation->poste = $poste_vat;
931 $acc_operation->amount = $tva_reverse_credit[
$i];
932 $acc_operation->grpt =
$seq;
933 $acc_operation->jrn =
$p_jrn;
934 $acc_operation->type =
'c';
935 $acc_operation->periode = $tperiode;
936 $acc_operation->insert_jrnx();
937 $tot_debit = bcadd($tot_debit,
$value);
938 $tot_debit = round($tot_debit, 2);
945 $acc_operation->echeance=$e_ech;
947 $acc_operation->amount=$this->
db->get_value(
"select sum(j_montant) from jrnx where j_grpt = $1 and j_debit='t'",
949 $acc_operation->desc=$e_comm;
950 $acc_operation->grpt=
$seq;
951 $acc_operation->jrn=
$p_jrn;
952 $acc_operation->periode=$tperiode;
953 $acc_operation->pj=$e_pj;
954 $acc_operation->mt=$mt;
955 $acc_operation->currency_id=$p_currency_code;
956 $acc_operation->currency_rate=$p_currency_rate;
957 $acc_operation->currency_rate_ref=$currency_rate_ref->get_rate();
959 if ( ! $this->
jr_id=$acc_operation->insert_jrn() ) {
960 throw new Exception (
_(
"Erreur de balance"),
EXC_BALANCE);
962 $this->pj=$acc_operation->update_receipt();
968 $this->
db->exec_sql(
'update quant_purchase set qp_internal = $1 where j_id in (select j_id from jrnx where j_grpt=$2)',
969 array($internal,
$seq));
978 if ( isset ($_FILES))
980 if (
sizeof($_FILES) != 0 )
981 $this->
db->save_receipt(
$seq);
986 if ( isset(
$_POST[
'gen_invoice']) )
989 $this->doc=HtmlInput::show_receipt_document($this->
jr_id,
h($ref_doc));
1002 $acseq=$this->
db->get_next_seq(
's_grpt');
1003 $acjrn=
new Acc_Ledger($this->
db,$mp->get_parameter(
'ledger_target'));
1004 $acinternal=$acjrn->compute_internal_code($acseq);
1008 if ( $acjrn->get_type()==
'FIN') {
1010 $acfiche=
new Fiche($this->
db,$acjrn->get_bank());
1013 $fqcode = ${
'e_mp_qcode_' . $e_mp};
1014 $acfiche =
new Fiche($this->
db);
1015 $acfiche->get_by_qcode($fqcode);
1024 if ( strpos($sposte,
',') != 0 )
1026 $array=explode(
',',$sposte);
1034 $cust_amount=bcsub($cust_amount, $tot_tva_reversed);
1037 $acompte_defcur=bcdiv(
$acompte, $p_currency_rate);
1039 $famount=bcsub($cust_amount,$acompte_defcur);
1041 $acc_pay->poste=$poste_val;
1042 $acc_pay->qcode=$fqcode;
1043 $acc_pay->amount=abs(round($famount,2));
1045 $acc_pay->grpt=$acseq;
1046 $acc_pay->jrn=$mp->get_parameter(
'ledger_target');
1047 $acc_pay->periode=$tperiode;
1048 $acc_pay->type=($famount>=0)?
'c':
'd';
1049 $let_pay=$acc_pay->insert_jrnx();
1053 $acc_pay->date=empty($mp_date)?
$e_date:$mp_date;
1055 $acc_pay->qcode=$e_client;
1056 $acc_pay->amount=abs(round($famount,2));
1058 $acc_pay->grpt=$acseq;
1059 $acc_pay->jrn=$mp->get_parameter(
'ledger_target');
1060 $acc_pay->periode=$tperiode;
1061 $acc_pay->type=($famount>=0)?
'd':
'c';
1062 $let_other=$acc_pay->insert_jrnx();
1066 $operation_currency->oc_amount=bcsub($tot_amount_cur,
$acompte);
1067 $operation_currency->oc_vat_amount=0;
1068 $operation_currency->oc_price_unit=0;
1069 $operation_currency->j_id=$let_other;
1070 $operation_currency->insert();
1074 $operation_currency->oc_amount=bcsub($tot_amount_cur,
$acompte);
1075 $operation_currency->oc_vat_amount=0;
1076 $operation_currency->oc_price_unit=0;
1077 $operation_currency->j_id=$let_pay;
1078 $operation_currency->insert();
1082 $acc_pay->desc=(!isset($e_comm_paiement) ||
noalyss_strlentrim($e_comm_paiement) == 0) ?$e_comm:$e_comm_paiement;
1085 $acc_pay->currency_id=$p_currency_code;
1086 $acc_pay->currency_rate=$p_currency_rate;
1087 $acc_pay->currency_rate_ref=$currency_rate_ref->get_rate();
1091 $mp_jr_id=$acc_pay->insert_jrn();
1092 $this->payment_operation=$mp_jr_id;
1093 $acjrn->grpt_id=$acseq;
1094 $acjrn->update_internal_code($acinternal);
1096 if ($acjrn->get_type()==
"ODS") {
1097 $acc_pay->pj=$acjrn->guess_pj();
1098 $acc_pay->update_receipt();
1100 $r1=$this->
get_id($internal);
1101 $r2=$this->
get_id($acinternal);
1107 $oletter->insert_couple($let_client,$let_other);
1110 $Res=$this->
db->exec_sql(
"update jrn set jr_rapt='paid' where jr_id=$1",array($r1));
1114 $rec->set_jr_id($r1);
1125 if (
$prop[
'jrn_def_type'] ==
'FIN' )
1127 $ledger->insert_quant_fin($acfiche->id,$mp_jr_id,$cust->id,bcmul($famount,-1),$let_other);
1135 if (isset(
$p_array[
'jrn_note_input']) && !empty(
$p_array[
'jrn_note_input'])) {
1137 $acc_operation_note->setNote(
$p_array[
'jrn_note_input']);
1138 $acc_operation_note->setOperation_id( $this->
jr_id);
1139 $acc_operation_note->save();
1142 catch (Exception
$e)
1145 $this->
db->rollback();
1148 $this->
db->commit();
1195 $str_add_button_tiers =
"";
1199 $str_add_button_tiers = $this->
add_card(
"cred",
"e_client");
1203 list ($l_date_start,$l_date_end)=
$oPeriode->get_date_limit(
$g_user->get_periode());
1209 $e_ech=(isset($e_ech))?$e_ech:
"";
1210 $e_comm=(isset($e_comm))?$e_comm:
"";
1213 $r.=dossier::hidden();
1214 $f_legend_detail=
_(
"Détail articles achetés");
1219 $Date->setReadOnly(
false);
1222 $f_date=$Date->input(
"e_date",$op_date);
1225 $Echeance=
new IDate();
1226 $Echeance->setReadOnly(
false);
1227 $Echeance->tabindex=2;
1229 $f_echeance=$Echeance->input(
'e_ech',$e_ech,
'Echéance'.
$label);
1235 $l_user_per=
$g_user->get_periode();
1238 $period=
new IPeriod(
"period");
1241 $period->value=
$def;
1245 $l_form_per=$period->input();
1247 catch (Exception
$e)
1250 if (
$e->getCode() == 1 )
1252 throw new Exception(
_(
"Aucune période ouverte"));
1258 $f_periode=
td(
_(
"Période comptable").
" $label ").td($l_form_per);
1266 $add_js=
"update_receipt();";
1270 $add_js.=
'get_last_date();';
1272 $add_js.=
'update_name();';
1273 $add_js.=
'update_pay_method();';
1274 $add_js.=
'update_row("sold_item");';
1275 $add_js.=
'update_other_tax();';
1276 $add_js.=
'update_visibility_quantity();';
1280 if (
$wLedger ==
null)
throw new Exception(
_(
'Pas de journal disponible'));
1281 $wLedger->javascript=
"onChange='update_predef(\"ach\",\"f\",\"".$http->request(
"ac").
"\");$add_js'";
1287 $Commentaire=
new IText();
1288 $Commentaire->table=0;
1289 $Commentaire->setReadOnly(
false);
1290 $Commentaire->size=60;
1291 $Commentaire->tabindex=3;
1293 $f_desc=$Commentaire->input(
"e_comm",$e_comm);
1305 $pj->value=(isset($e_pj))?$e_pj:$default_pj;
1309 $pj->setReadOnly(
true);
1315 $pj->readonly=
false;
1317 $f_pj=$pj->input().HtmlInput::hidden(
'e_pj_suggest',$default_pj);
1325 $e_client=( isset ($e_client) )?$e_client:
"";
1326 $e_client_label=
" ";
1334 $fClient=
new Fiche($this->
db);
1335 $fClient->get_by_qcode($e_client);
1345 $W1->label=
_(
"Fournisseur ").Icon_Action::infobulle(0) ;
1346 $W1->name=
"e_client";
1348 $W1->value=$e_client;
1350 $W1->set_dblclick(
"fill_ipopcard(this);");
1351 $W1->set_attribute(
'ipopup',
'ipopcard');
1354 $W1->set_attribute(
'label',
'e_client_label');
1356 $W1->set_attribute(
'typecard',
'cred');
1359 $W1->set_callback(
'filter_card');
1360 $W1->set_function(
'fill_data');
1361 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
1363 $f_client_qcode=$W1->input();
1364 $client_label=
new ISpan();
1365 $client_label->style=
"vertical-align:top";
1366 $client_label->table=0;
1367 $f_client=$client_label->input(
"e_client_label",$e_client_label);
1368 $f_client_bt=$W1->search();
1373 $e_comment=(isset($e_comment))?$e_comment:
"";
1374 $p_article= ( isset ($nb_item))?$nb_item:$this->
get_min_row();
1378 $r.=$Hid->input(
"nb_item",$p_article);
1382 for (
$i=0;
$i< $p_article ;
$i++)
1386 $march=(isset(${
"e_march$i"}))?${
"e_march$i"}:
"" ;
1387 $march_price=(isset(${
"e_march".$i.
"_price"}))?${
"e_march".$i.
"_price"}:
""
1392 $march_tva_id=(isset(${
"e_march$i".
"_tva_id"}))?${
"e_march$i".
"_tva_id"}:
"";
1393 $march_tva_amount=(isset(${
"e_march$i".
"_tva_amount"}))?${
"e_march$i".
"_tva_amount"}:
"";
1398 $march_label=(isset(${
"e_march".$i.
"_label"}))?${
"e_march".$i.
"_label"}:
"";
1404 $fMarch->get_by_qcode($march);
1407 if ( ! isset($march_tva_id) &&
$g_parameter->MY_TVA_USE==
'Y' )
1414 $W1->name=
"e_march".$i;
1417 $W1->set_dblclick(
"fill_ipopcard(this);");
1418 $W1->set_attribute(
'ipopup',
'ipopcard');
1420 $W1->set_attribute(
'typecard',
'deb');
1423 $W1->set_attribute(
'label',
'e_march'.
$i.
'_label');
1425 $W1->set_attribute(
'purchase',
'e_march'.
$i.
'_price');
1426 $W1->set_attribute(
'price',
'e_march'.
$i.
'_price');
1429 $W1->set_attribute(
'tvaid',
'e_march'.
$i.
'_tva_id');
1431 $W1->set_callback(
'filter_card');
1432 $W1->set_function(
'fill_data');
1433 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
1435 $W1->readonly=
false;
1436 $array[
$i][
'quick_code']=$W1->input();
1438 $array[
$i][
'card_add']=($add_card==TRUE)?$this->
add_card(
"deb", $W1->id):
"";
1444 $array[
$i][
'hidden'].=HtmlInput::hidden(
'tva_march'.
$i,0);
1448 $tvac=
new INum(
'tvac_march'.
$i);
1456 $htva=
new INum(
'htva_march'.
$i);
1464 $Span=
new IText(
"e_march".
$i.
"_label");
1465 $Span->style=
'class="input_text label_item"';
1468 $Span=
new ISpan(
"e_march".
$i.
"_label");
1469 $Span->extra=
'class="label_item"';
1471 $Span->value=$march_label;
1472 $Span->setReadOnly(
false);
1475 $array[
$i][
'denom']=$Span->input(
"e_march".
$i.
"_label",$march_label);
1478 $Price->setReadOnly(
false);
1480 $Price->javascript=
"onblur=\"format_number(this,4);clean_tva($i);compute_ledger($i)\"";
1481 $array[
$i][
'pu']=$Price->input(
"e_march".
$i.
"_price",$march_price);
1488 $Tva->js=
"onblur=\"clean_tva($i);compute_ledger($i)\"";
1489 $Tva->in_table=
true;
1490 $Tva->set_attribute(
'compute',
$i);
1491 $Tva->set_filter(
"purchase");
1492 $Tva->value=$march_tva_id;
1493 $array[
$i][
'tva']=$Tva->input(
"e_march$i".
"_tva_id");
1498 $Tva_amount=
new INum();
1499 $Tva_amount->setReadOnly(
false);
1500 $Tva_amount->size=9;
1501 $Tva_amount->javascript=
"onblur=\"format_number(this);compute_ledger($i)\"";
1502 $array[
$i][
'amount_tva']=$Tva_amount->input(
"e_march".
$i.
"_tva_amount",$march_tva_amount);
1506 $quant=(isset(${
"e_quant$i"}))?${
"e_quant$i"}:
"1"
1508 $Quantity=
new INum();
1509 $Quantity->setReadOnly(
false);
1511 $Quantity->javascript=
"onchange=\"format_number(this,2);clean_tva($i);compute_ledger($i)\"";
1512 $array[
$i][
'quantity']=$Quantity->input(
"e_quant".
$i,$quant);
1515 $f_type=
_(
'Fournisseur');
1518 $currency_select = $this->
CurrencyInput(
"currency_code",
"p_currency_rate" ,
"p_currency_euro");
1519 $currency_select->selected=
$http->request(
'p_currency_code',
'string',0);
1521 $currency_input=
new INum(
"p_currency_rate");
1522 $currency_input->prec=8;
1523 $currency_input->id=
"p_currency_rate";
1524 $currency_input->value=
$http->request(
'p_currency_rate',
'string',1);
1525 $currency_input->javascript=
'onchange="format_number(this,6);CurrencyCompute(\'p_currency_rate\',\'p_currency_euro\');"';
1533 echo
'<div id="predef_form">';
1534 echo HtmlInput::hidden(
'p_jrn_predef', $this->
id);
1536 $op->set_p_jrn($this->
id);
1537 $op->set_jrn_type(
"ACH");
1538 $op->set_od_direct(
'f');
1539 $url=http_build_query(array(
'p_jrn_predef'=>$this->
id,
'ac'=>
$http->request(
'ac'),
'gDossier'=>dossier::id()));
1540 echo
$op->form_get(
'do.php?'.
$url);
1542 $str_op_template=ob_get_contents();
1546 require_once NOALYSS_TEMPLATE.
'/form_ledger_detail.php';
1547 $r.=ob_get_contents();
1551 $r.= HtmlInput::hidden(
'jrn_type',
'ACH');
1559 $r.=
'<script> update_receipt();</script>';
1563 $r.=
'<div id="additional_tax_div">';