422 if ($p_acc_operation->jrnx_id == 0) {
423 throw new Exception(__FILE__.__LINE__.
'invalid acc_operation.j_id');
425 $source_j_id=$p_acc_operation->jrnx_id ;
430 if ($p_nd_amount->amount_nd_rate != 0)
440 $dna = $dna_default->p_value;
442 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
444 $p_acc_operation->type =
'd';
445 $p_acc_operation->amount = $p_nd_amount->amount_nd;
446 $p_acc_operation->poste = $dna;
447 $p_acc_operation->qcode =
'';
449 if ($p_nd_amount->amount_nd > 0)
450 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->amount_nd );
456 if ($p_nd_amount->amount_perso != 0)
461 $p_acc_operation->type =
'd';
467 $dna = $dna_default->p_value;
469 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
471 $p_acc_operation->amount = $p_nd_amount->amount_perso ;
472 $p_acc_operation->poste = $dna;
473 $p_acc_operation->qcode =
'';
475 if ($p_nd_amount->amount_perso> 0)
476 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->amount_perso);
479 if ($p_nd_amount->nd_vat != 0)
484 $p_acc_operation->type =
'd';
485 $p_acc_operation->qcode =
'';
491 $dna = $dna_default->p_value;
493 $dna = ($dna ==
'') ? $dna_default->p_value : $dna;
495 $p_acc_operation->amount = $p_nd_amount->nd_vat;
496 $p_acc_operation->poste = $dna;
504 $op->oa_group=$p_group;
506 $op->oa_date=$p_acc_operation->date;
510 $op->oa_jrnx_id_source=$source_j_id;
511 $op->save_form_plan_vat_nd(
$_POST,
$idx,
$j_id,$p_nd_amount->nd_vat,$p_acc_operation->jrnx_id);
513 if ($p_nd_amount->nd_vat> 0)
514 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->nd_vat);
517 if ($p_nd_amount->nd_ded_vat != 0)
526 $dna = $dna_default->p_value;
528 $dna = ($dna ==
'') ? $dna_default->value : $dna;
532 $p_acc_operation->type =
'd';
533 $p_acc_operation->qcode =
'';
534 $p_acc_operation->amount = $p_nd_amount->nd_ded_vat;
535 $p_acc_operation->poste = $dna;
537 if ($p_nd_amount->nd_ded_vat > 0)
538 $p_tot_debit = bcadd($p_tot_debit, $p_nd_amount->nd_ded_vat);
545 $op->oa_group=$p_group;
547 $op->oa_date=$p_acc_operation->date;
551 $op->oa_jrnx_id_source=$source_j_id;
601 $group=$this->
db->get_next_seq(
"s_oa_group");
602 $seq=$this->
db->get_next_seq(
's_grpt');
606 $this->jr_internal=$internal;
609 $cust->get_by_qcode($e_client);
612 if ( strpos($sposte,
',') != 0 )
614 $array=explode(
',',$sposte);
653 $tva_reverse = array();
656 $tva_reverse_credit = array();
666 for (
$i=0;
$i< $nb_item;
$i++)
668 if ( empty(${
'e_march'.$i}) || empty(${
'e_quant'.$i}) )
continue;
672 $fiche->get_by_qcode(${
"e_march".$i});
678 $idx_tva=trim(${
'e_march'.$i.
'_tva_id'});
682 $tva_both=$oTva->get_parameter(
"both_side");
687 $acc_operation->grpt=
$seq;
688 $acc_operation->jrn=
$p_jrn;
689 $acc_operation->type=
'd';
690 $acc_operation->periode=$tperiode;
691 $acc_operation->qcode=
"";
692 $amount_4=bcmul(${
'e_march'.$i.
'_price'},${
'e_quant'.$i});
697 $acc_amount->check=
false;
698 $acc_amount->set_parameter(
'amount',$amount_4);
700 $acc_amount->set_parameter(
"currency_rate", $p_currency_rate);
701 $acc_amount->convert_euro();
702 $amount_euro=$acc_amount->amount;
707 $acc_amount->set_parameter(
'amount_vat_rate',$oTva->get_parameter(
'rate'));
708 if (
noalyss_strlentrim(${
'e_march'.$i.
'_tva_amount'}) ==0 || ${
'e_march'.$i.
'_tva_amount'} == 0)
711 $acc_amount->compute_vat();
717 $acc_amount->set_parameter(
"amount_vat", ${
'e_march'.$i.
'_tva_amount'});
718 $acc_amount->convert_euro_vat();
722 $tot_tva=bcadd($tot_tva,$acc_amount->amount_vat);
723 $tot_tva=round($tot_tva,2);
729 $save_amount_vat=$acc_amount->amount_vat;
731 $acc_amount->correct();
733 if ( $tva_both == 1 ) {
734 $acc_amount->autoreverse=$save_amount_vat;
735 $tot_tva_reversed=bcadd($tot_tva_reversed,$save_amount_vat);
747 if ( strpos($sposte,
',') != 0 )
749 $array=explode(
',',$sposte);
758 $acc_operation->desc=strip_tags(${
"e_march".$i.
"_label"}??
"");
762 $acc_operation->desc=
"";
764 $acc_operation->poste=$poste_val;
765 $acc_operation->amount=$acc_amount->amount;
766 $acc_operation->qcode=${
"e_march".$i};
767 if ($acc_amount->amount>0)
769 $tot_debit=bcadd($tot_debit, $acc_amount->amount);
771 $j_id=$acc_operation->insert_jrnx();
780 $tva_item=$acc_amount->amount_vat;
782 if ($tva_both == 0 ){
783 $tva[$idx_tva]=(isset( $tva[$idx_tva]))? $tva[$idx_tva]:0;
784 $tva[$idx_tva]=bcadd($tva[$idx_tva], $tva_item);
787 $tva_reverse[$idx_tva]=(isset($tva_reverse[$idx_tva]))?$tva_reverse[$idx_tva]:0;
788 $tva_reverse[$idx_tva]=bcadd($tva_item,$tva_reverse[$idx_tva]);
789 $tva_reverse_credit[$idx_tva]=(isset($tva_reverse_credit[$idx_tva]))?$tva_reverse_credit[$idx_tva]:0;
790 $tva_reverse_credit[$idx_tva]=bcadd($save_amount_vat,$tva_reverse_credit[$idx_tva]);
797 $nNeg=(${
"e_quant" .
$i}< 0) ? -1 : 1;
803 $dir=(${
'e_quant'.$i} < 0 ) ?
'c':
'd';
811 $op->set_currency_rate($p_currency_rate);
812 $op->oa_group=$group;
822 if (empty( ${
'e_march' .
$i .
'_price'} ) ) ${
'e_march' .
$i .
'_price'} = 0;
823 if (empty( ${
'e_march' .
$i } ) ) ${
'e_march' .
$i } = 0;
824 if (empty( ${
'e_quant' .
$i } ) ) ${
'e_quant' .
$i } = 0;
825 $price_euro=bcdiv(${
'e_march'.$i.
'_price'}, $p_currency_rate);
830 $r=$this->
db->exec_sql(
"select insert_quant_purchase ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)",
836 ,round($amount_euro,2)
837 ,$acc_amount->amount_vat
838 ,$oTva->get_parameter(
'id')
839 ,$acc_amount->amount_nd
841 ,$acc_amount->nd_ded_vat
842 ,$acc_amount->amount_perso
844 , $acc_amount->autoreverse
852 $acc_amount->amount_vat=0;
853 $r=$this->
db->exec_sql(
"select insert_quant_purchase ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)",
859 ,round($acc_amount->amount,2)
862 ,$acc_amount->amount_nd
864 ,$acc_amount->nd_ded_vat
865 ,$acc_amount->amount_perso
867 , $acc_amount->autoreverse
875 $operation_currency->oc_amount=$acc_amount->amount_currency;
876 $operation_currency->oc_vat_amount=($tva_both==0)?$acc_amount->amount_vat_currency:0;
877 $operation_currency->oc_price_unit=${
'e_march'.$i.
'_price'};
878 $operation_currency->j_id=
$j_id;
879 $operation_currency->insert();
880 $tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_currency,4),4);
881 $tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_vat_currency,4),4);
882 if ( DEBUGNOALYSS > 1 ) {
883 echo __LINE__.
" insert into operation currency oc_amount:{$acc_amount->amount_currency} oc_vat_amount {$acc_amount->amount_vat_currency} <br>";
890 $row=$this->
db->get_row(
"select ac_id,ac_label,ac_accounting
894 if ( ! empty (
$row )) {
898 $acc_operation->poste=
$row[
'ac_accounting'];
900 $acc_operation->grpt=
$seq;
901 $acc_operation->jrn=
$p_jrn;
902 $acc_operation->type=
'd';
903 $acc_operation->periode=$tperiode;
904 $acc_operation->desc=
$row[
'ac_label'];
906 $jrn_tax_sql->j_id=$acc_operation->insert_jrnx();
907 $jrn_tax_sql->ac_id=
$row[
'ac_id'];
908 $jrn_tax_sql->pcm_val=
$row[
'ac_accounting'];
909 $jrn_tax_sql->insert();
911 $operation_currency->oc_amount=
$p_array[
'other_tax_amount'];
912 $operation_currency->oc_vat_amount=0;
913 $operation_currency->oc_price_unit=0;
914 $operation_currency->j_id=$jrn_tax_sql->j_id;
915 $operation_currency->insert();
925 if ( DEBUGNOALYSS > 1 ) {
926 echo __LINE__.
" tot_amount $tot_amount<br>";
927 echo __LINE__.
" tot_tva $tot_tva<br>";
933 $acc_operation->poste=
$poste;
934 $acc_operation->amount=bcsub($cust_amount,$tot_tva_reversed);
935 $acc_operation->grpt=
$seq;
936 $acc_operation->jrn=
$p_jrn;
937 $acc_operation->type=
'c';
938 $acc_operation->periode=$tperiode;
939 $acc_operation->qcode=${
"e_client"};
942 $tot_debit=bcadd($tot_debit, abs($cust_amount));
944 $let_client=$acc_operation->insert_jrnx();
948 $operation_currency->oc_amount=$tot_amount_cur;
949 $operation_currency->oc_vat_amount=0;
950 $operation_currency->oc_price_unit=0;
951 $operation_currency->j_id=$let_client ;
952 $operation_currency->insert();
962 $poste_vat=$oTva->get_side(
'd');
967 $acc_operation->poste=$poste_vat;
968 $acc_operation->amount=
$value;
969 $acc_operation->grpt=
$seq;
970 $acc_operation->jrn=
$p_jrn;
971 $acc_operation->type=
'd';
972 $acc_operation->periode=$tperiode;
973 if (
$value > 0 ) $tot_debit=bcadd($tot_debit,abs(
$value));
974 $acc_operation->insert_jrnx();
977 foreach ($tva_reverse as
$i =>
$value) {
979 $poste_vat = $oTva->get_side(
'd');
980 if ( $poste_vat ==
'#')
982 $poste_vat=$oTva->get_side(
'c');
986 $acc_operation->date =
$e_date;
987 $acc_operation->poste = $poste_vat;
988 $acc_operation->amount =
$value;
989 $acc_operation->grpt =
$seq;
990 $acc_operation->jrn =
$p_jrn;
991 $acc_operation->type =
'd';
992 $acc_operation->periode = $tperiode;
994 $acc_operation->insert_jrnx();
998 $x=$oTva->get_parameter(
"tva_reverse_account");
999 $poste_vat =(trim(
$x??
"")==
"")? $oTva->get_side(
'c'):
$x;
1001 if ( $poste_vat ==
'#')
1003 $poste_vat=$oTva->get_side(
'd');
1006 $acc_operation->date =
$e_date;
1007 $acc_operation->poste = $poste_vat;
1008 $acc_operation->amount = $tva_reverse_credit[
$i];
1009 $acc_operation->grpt =
$seq;
1010 $acc_operation->jrn =
$p_jrn;
1011 $acc_operation->type =
'c';
1012 $acc_operation->periode = $tperiode;
1013 $acc_operation->insert_jrnx();
1014 $tot_debit = bcadd($tot_debit,
$value);
1015 $tot_debit = round($tot_debit, 2);
1022 $acc_operation->echeance=$e_ech;
1024 $acc_operation->amount=$this->
db->get_value(
"select sum(j_montant) from jrnx where j_grpt = $1 and j_debit='t'",
1026 $acc_operation->desc=$e_comm;
1027 $acc_operation->grpt=
$seq;
1028 $acc_operation->jrn=
$p_jrn;
1029 $acc_operation->periode=$tperiode;
1030 $acc_operation->pj=$e_pj;
1031 $acc_operation->mt=$mt;
1032 $acc_operation->currency_id=$p_currency_code;
1033 $acc_operation->currency_rate=$p_currency_rate;
1034 $acc_operation->currency_rate_ref=$currency_rate_ref->get_rate();
1036 if ( ! $this->
jr_id=$acc_operation->insert_jrn() ) {
1037 throw new Exception (
_(
"Erreur de balance"),
EXC_BALANCE);
1039 $this->pj=$acc_operation->update_receipt();
1042 $this->jr_grpt_id=
$seq;
1045 $this->
db->exec_sql(
'update quant_purchase set qp_internal = $1 where j_id in (select j_id from jrnx where j_grpt=$2)',
1046 array($internal,
$seq));
1055 if ( isset ($_FILES) &&
sizeof($_FILES) != 0 && $_FILES[
"pj"][
"name"] != 0 )
1057 $acc_document=new \Acc_Document($this->
db, $this->
jr_id);
1058 $acc_document->save_receipt();
1059 $this->doc=HtmlInput::show_receipt_document($this->
jr_id,
h($_FILES[
'pj'][
'name']));
1064 if ( isset(
$_POST[
'gen_invoice']) )
1067 $this->doc=HtmlInput::show_receipt_document($this->
jr_id,
h($ref_doc));
1080 $acseq=$this->
db->get_next_seq(
's_grpt');
1081 $acjrn=
new Acc_Ledger($this->
db,$mp->get_parameter(
'ledger_target'));
1082 $acinternal=$acjrn->compute_internal_code($acseq);
1086 if ( $acjrn->get_type()==
'FIN') {
1088 $acfiche=
new Fiche($this->
db,$acjrn->get_bank());
1091 $fqcode = ${
'e_mp_qcode_' . $e_mp};
1092 $acfiche =
new Fiche($this->
db);
1093 $acfiche->get_by_qcode($fqcode);
1102 if ( strpos($sposte,
',') != 0 )
1104 $array=explode(
',',$sposte);
1112 $cust_amount=bcsub($cust_amount, $tot_tva_reversed);
1115 $acompte_defcur=bcdiv(
$acompte, $p_currency_rate);
1117 $famount=bcsub($cust_amount,$acompte_defcur);
1119 $acc_pay->poste=$poste_val;
1120 $acc_pay->qcode=$fqcode;
1121 $acc_pay->amount=abs(round($famount,2));
1123 $acc_pay->grpt=$acseq;
1124 $acc_pay->jrn=$mp->get_parameter(
'ledger_target');
1125 $acc_pay->periode=$tperiode;
1126 $acc_pay->type=($famount>=0)?
'c':
'd';
1127 $let_pay=$acc_pay->insert_jrnx();
1131 $acc_pay->date=empty($mp_date)?
$e_date:$mp_date;
1133 $acc_pay->qcode=$e_client;
1134 $acc_pay->amount=abs(round($famount,2));
1136 $acc_pay->grpt=$acseq;
1137 $acc_pay->jrn=$mp->get_parameter(
'ledger_target');
1138 $acc_pay->periode=$tperiode;
1139 $acc_pay->type=($famount>=0)?
'd':
'c';
1140 $let_other=$acc_pay->insert_jrnx();
1144 $operation_currency->oc_amount=bcsub($tot_amount_cur,
$acompte);
1145 $operation_currency->oc_vat_amount=0;
1146 $operation_currency->oc_price_unit=0;
1147 $operation_currency->j_id=$let_other;
1148 $operation_currency->insert();
1152 $operation_currency->oc_amount=bcsub($tot_amount_cur,
$acompte);
1153 $operation_currency->oc_vat_amount=0;
1154 $operation_currency->oc_price_unit=0;
1155 $operation_currency->j_id=$let_pay;
1156 $operation_currency->insert();
1160 $acc_pay->desc=(!isset($e_comm_paiement) ||
noalyss_strlentrim($e_comm_paiement) == 0) ?$e_comm:$e_comm_paiement;
1163 $acc_pay->currency_id=$p_currency_code;
1164 $acc_pay->currency_rate=$p_currency_rate;
1165 $acc_pay->currency_rate_ref=$currency_rate_ref->get_rate();
1169 $mp_jr_id=$acc_pay->insert_jrn();
1170 $this->payment_operation=$mp_jr_id;
1171 $acjrn->jr_grpt_id=$acseq;
1172 $acjrn->update_internal_code($acinternal);
1174 if ($acjrn->get_type()==
"ODS") {
1175 $acc_pay->pj=$acjrn->guess_pj();
1176 $acc_pay->update_receipt();
1178 $r1=$this->
get_id($internal);
1179 $r2=$this->
get_id($acinternal);
1185 $oletter->insert_couple($let_client,$let_other);
1188 $Res=$this->
db->exec_sql(
"update jrn set jr_rapt='paid' where jr_id=$1",array($r1));
1192 $rec->set_jr_id($r1);
1203 if (
$prop[
'jrn_def_type'] ==
'FIN' )
1205 $ledger->insert_quant_fin($acfiche->id,$mp_jr_id,$cust->id,bcmul($famount,-1),$let_other);
1213 if (isset(
$p_array[
'jrn_note_input']) && !empty(
$p_array[
'jrn_note_input'])) {
1215 $acc_operation_note->setNote(
$p_array[
'jrn_note_input']);
1216 $acc_operation_note->setOperation_id( $this->
jr_id);
1217 $acc_operation_note->save();
1220 catch (Exception
$e)
1223 $this->
db->rollback();
1226 $this->
db->commit();
1273 $str_add_button_tiers =
"";
1277 $str_add_button_tiers = $this->
add_card(
"cred",
"e_client");
1281 list ($l_date_start,$l_date_end)=
$oPeriode->get_date_limit(
$g_user->get_periode());
1287 $e_ech=(isset($e_ech))?$e_ech:
"";
1288 $e_comm=(isset($e_comm))?$e_comm:
"";
1291 $r.=dossier::hidden();
1292 $f_legend_detail=
_(
"Détail articles achetés");
1297 $Date->setReadOnly(
false);
1300 $f_date=$Date->input(
"e_date",$op_date);
1303 $Echeance=
new IDate();
1304 $Echeance->setReadOnly(
false);
1305 $Echeance->tabindex=2;
1307 $f_echeance=$Echeance->input(
'e_ech',$e_ech,
'Echéance'.
$label);
1313 $l_user_per=
$g_user->get_periode();
1316 $period=
new IPeriod(
"period");
1319 $period->value=
$def;
1323 $l_form_per=$period->input();
1325 catch (Exception
$e)
1328 if (
$e->getCode() == 1 )
1330 throw new Exception(
_(
"Aucune période ouverte"));
1336 $f_periode=
td(
_(
"Période comptable").
" $label ").td($l_form_per);
1344 $add_js=
"update_receipt();";
1348 $add_js.=
'get_last_date();';
1350 $add_js.=
'update_name();';
1351 $add_js.=
'update_pay_method();';
1352 $add_js.=
'update_row("sold_item");';
1353 $add_js.=
'update_other_tax();';
1354 $add_js.=
'update_visibility_quantity();';
1358 if (
$wLedger ==
null)
throw new Exception(
_(
'Pas de journal disponible'));
1359 $wLedger->javascript=
"onChange='update_predef(\"ach\",\"f\",\"".$http->request(
"ac").
"\");$add_js'";
1365 $Commentaire=
new IText();
1366 $Commentaire->table=0;
1367 $Commentaire->setReadOnly(
false);
1368 $Commentaire->size=60;
1369 $Commentaire->tabindex=3;
1371 $f_desc=$Commentaire->input(
"e_comm",$e_comm);
1383 $pj->value=(isset($e_pj))?$e_pj:$default_pj;
1387 $pj->setReadOnly(
true);
1393 $pj->readonly=
false;
1395 $f_pj=
$pj->input().HtmlInput::hidden(
'e_pj_suggest',$default_pj);
1403 $e_client=( isset ($e_client) )?$e_client:
"";
1404 $e_client_label=
" ";
1412 $fClient=
new Fiche($this->
db);
1413 $fClient->get_by_qcode($e_client);
1423 $W1->label=
_(
"Fournisseur ").Icon_Action::infobulle(0) ;
1424 $W1->name=
"e_client";
1426 $W1->value=$e_client;
1428 $W1->set_dblclick(
"fill_ipopcard(this);");
1429 $W1->set_attribute(
'ipopup',
'ipopcard');
1432 $W1->set_attribute(
'label',
'e_client_label');
1434 $W1->set_attribute(
'typecard',
'cred');
1437 $W1->set_callback(
'filter_card');
1438 $W1->set_function(
'fill_data');
1439 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
1441 $f_client_qcode=$W1->input();
1442 $client_label=
new ISpan();
1443 $client_label->style=
"vertical-align:top";
1444 $client_label->table=0;
1445 $f_client=$client_label->input(
"e_client_label",$e_client_label);
1446 $f_client_bt=$W1->search();
1451 $e_comment=(isset($e_comment))?$e_comment:
"";
1452 $p_article= ( isset ($nb_item))?$nb_item:$this->
get_min_row();
1456 $r.=$Hid->input(
"nb_item",$p_article);
1460 for (
$i=0;
$i< $p_article ;
$i++)
1464 $march=(isset(${
"e_march$i"}))?${
"e_march$i"}:
"" ;
1465 $march_price=(isset(${
"e_march".$i.
"_price"}))?${
"e_march".$i.
"_price"}:
""
1470 $march_tva_id=(isset(${
"e_march$i".
"_tva_id"}))?${
"e_march$i".
"_tva_id"}:
"";
1471 $march_tva_amount=(isset(${
"e_march$i".
"_tva_amount"}))?${
"e_march$i".
"_tva_amount"}:
"";
1476 $march_label=(isset(${
"e_march".$i.
"_label"}))?${
"e_march".$i.
"_label"}:
"";
1482 $fMarch->get_by_qcode($march);
1485 if ( ! isset($march_tva_id) &&
$g_parameter->MY_TVA_USE==
'Y' )
1492 $W1->name=
"e_march".$i;
1495 $W1->setAfter_clean(
"compute_all_ledger()");
1496 $W1->set_dblclick(
"fill_ipopcard(this);");
1497 $W1->set_attribute(
'ipopup',
'ipopcard');
1499 $W1->set_attribute(
'typecard',
'deb');
1502 $W1->set_attribute(
'label',
'e_march'.
$i.
'_label');
1504 $W1->set_attribute(
'purchase',
'e_march'.
$i.
'_price');
1505 $W1->set_attribute(
'price',
'e_march'.
$i.
'_price');
1508 $W1->set_attribute(
'tvaid',
'e_march'.
$i.
'_tva_id');
1510 $W1->set_callback(
'filter_card');
1511 $W1->set_function(
'fill_data');
1512 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
1514 $W1->readonly=
false;
1515 $array[
$i][
'quick_code']=$W1->input();
1517 $array[
$i][
'card_add']=($add_card==TRUE)?$this->
add_card(
"deb", $W1->id):
"";
1523 $array[
$i][
'hidden'].=HtmlInput::hidden(
'tva_march'.
$i,0);
1527 $tvac=
new INum(
'tvac_march'.
$i);
1535 $htva=
new INum(
'htva_march'.
$i);
1543 $Span=
new IText(
"e_march".
$i.
"_label");
1544 $Span->style=
'class="input_text label_item"';
1547 $Span=
new ISpan(
"e_march".
$i.
"_label");
1548 $Span->extra=
'class="label_item"';
1550 $Span->value=$march_label;
1551 $Span->setReadOnly(
false);
1554 $array[
$i][
'denom']=$Span->input(
"e_march".
$i.
"_label",$march_label);
1557 $Price->setReadOnly(
false);
1559 $Price->javascript=
"onblur=\"format_number(this,4);clean_tva($i);compute_ledger($i)\"";
1560 $array[
$i][
'pu']=$Price->input(
"e_march".
$i.
"_price",$march_price);
1567 $Tva->id=
"e_march$i".
"_tva_id";
1568 $Tva->js=
"onblur=\"clean_tva($i);compute_ledger($i)\"";
1569 $Tva->in_table=
true;
1570 $Tva->set_attribute(
'compute',
$i);
1571 $Tva->set_filter(
"purchase");
1572 $Tva->value=$march_tva_id;
1573 $array[
$i][
'tva']=$Tva->input(
"e_march$i".
"_tva_id");
1578 $Tva_amount=
new INum();
1579 $Tva_amount->setReadOnly(
false);
1580 $Tva_amount->size=9;
1581 $Tva_amount->javascript=
"onblur=\"format_number(this);compute_ledger($i)\"";
1582 $array[
$i][
'amount_tva']=$Tva_amount->input(
"e_march".
$i.
"_tva_amount",$march_tva_amount);
1586 $quant=(isset(${
"e_quant$i"}))?${
"e_quant$i"}:
"1"
1588 $Quantity=
new INum();
1589 $Quantity->setReadOnly(
false);
1591 $Quantity->javascript=
"onchange=\"format_number(this,2);clean_tva($i);compute_ledger($i)\"";
1592 $array[
$i][
'quantity']=$Quantity->input(
"e_quant".
$i,$quant);
1595 $f_type=
_(
'Fournisseur');
1598 $currency_select = $this->
CurrencyInput(
"currency_code",
"p_currency_rate" ,
"p_currency_euro");
1599 $currency_select->selected=
$http->request(
'p_currency_code',
'string',0);
1601 $currency_input=
new INum(
"p_currency_rate");
1602 $currency_input->prec=8;
1603 $currency_input->id=
"p_currency_rate";
1604 $currency_input->value=
$http->request(
'p_currency_rate',
'string',1);
1605 $currency_input->javascript=
'onchange="format_number(this,6);CurrencyCompute(\'p_currency_rate\',\'p_currency_euro\');"';
1613 echo
'<div id="predef_form">';
1614 echo HtmlInput::hidden(
'p_jrn_predef', $this->
id);
1616 $op->set_p_jrn($this->
id);
1617 $op->set_jrn_type(
"ACH");
1618 $op->set_od_direct(
'f');
1619 $url=http_build_query(array(
'p_jrn_predef'=>$this->
id,
'ac'=>
$http->request(
'ac'),
'gDossier'=>dossier::id()));
1620 echo
$op->form_get(
'do.php?'.
$url);
1622 $str_op_template=ob_get_contents();
1626 require_once NOALYSS_TEMPLATE.
'/form_ledger_detail.php';
1627 $r.=ob_get_contents();
1631 $r.= HtmlInput::hidden(
'jrn_type',
'ACH');
1639 $r.=
'<script> update_receipt();</script>';
1643 $r.=
'<div id="additional_tax_div">';