From cae5c0af762acf7e7b6b58d25dd5d7a18ef55a49 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 20 Dec 2011 14:16:52 +0000 Subject: [PATCH] =?UTF-8?q?#315=20D=C3=A9tail=20article=20Pour=20journaux?= =?UTF-8?q?=20VEN=20et=20ach=20on=20peut=20changer=20le=20libell=C3=A9=20d?= =?UTF-8?q?e=20la=20ligne,=20par=20d=C3=A9faut,=20nom=20de=20la=20fiche.?= =?UTF-8?q?=20En=20cas=20de=20g=C3=A9n=C3=A9ration=20de=20document,=20ce?= =?UTF-8?q?=20libell=C3=A9=20sera=20utilis=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/ajax_ledger.php | 6 ++++++ include/class_acc_ledger_purchase.php | 11 ++++++----- include/class_acc_ledger_sold.php | 7 ++++--- include/class_document.php | 7 +++++++ include/template/ledger_detail_ach.php | 5 ++++- include/template/ledger_detail_ven.php | 5 ++++- 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/html/ajax_ledger.php b/html/ajax_ledger.php index 5036a42f7..0cd5d59e1 100644 --- a/html/ajax_ledger.php +++ b/html/ajax_ledger.php @@ -362,6 +362,12 @@ case 'save': $cn->exec_sql("select comptaproc.jrn_add_note($1,$2)", array($jr_id,$_POST['jrn_note'])); $rapt=$_POST['rapt']; + $a_rowid=$_POST["j_id"]; + for ($e=0;$eexec_sql('update jrnx set j_text=$1 where j_id=$2', array(strip_tags($_POST[$id]),$a_rowid[$e])); + } if (trim($rapt) != '') { $rec=new Acc_Reconciliation ($cn); diff --git a/include/class_acc_ledger_purchase.php b/include/class_acc_ledger_purchase.php index 0b93a2a7b..05e482054 100644 --- a/include/class_acc_ledger_purchase.php +++ b/include/class_acc_ledger_purchase.php @@ -390,6 +390,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger $acc_operation->type='d'; $acc_operation->periode=$tperiode; $acc_operation->qcode=""; + $acc_operation->desc=strip_tags(${"e_march".$i."_label"}); @@ -1068,8 +1069,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger { // Code id, price & vat code //-- - $march=(isset(${"e_march$i"}))?${"e_march$i"}:"" - ; + $march=(isset(${"e_march$i"}))?${"e_march$i"}:"" ; $march_price=(isset(${"e_march".$i."_price"}))?${"e_march".$i."_price"}:"" ; /* use vat */ @@ -1083,7 +1083,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger - $march_label=" "; + $march_label=(isset(${"e_march".$i."_label"}))?${"e_march".$i."_label"}:""; // retrieve the tva label and name //-- if ( strlen(trim($march))!=0 ) @@ -1146,7 +1146,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger $htva->value=0; $array[$i]['htva']=$htva->input(); - $Span=new ISpan(); + $Span=new IText("e_march".$i."_label"); + $Span->value=$march_label; $Span->setReadOnly(false); // card's name, price //-- @@ -1317,7 +1318,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger /* retrieve information for card */ $fiche=new Fiche($this->db); $fiche->get_by_qcode(${"e_march".$i}); - $fiche_name=h($fiche->getName()); + $fiche_name=h(${"e_march".$i."_label"}); if ( $g_parameter->MY_TVA_USE=='Y') { diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php index 42e7fd668..71673e8cb 100644 --- a/include/class_acc_ledger_sold.php +++ b/include/class_acc_ledger_sold.php @@ -307,6 +307,7 @@ class Acc_Ledger_Sold extends Acc_Ledger $acc_operation->jrn=$p_jrn; $acc_operation->type='c'; $acc_operation->periode=$tperiode; + $acc_operation->desc=strip_tags(${"e_march".$i."_label"}); $acc_operation->qcode=${"e_march".$i}; if ( $amount < 0 ) $tot_debit=bcadd($tot_debit,abs($amount)); @@ -715,7 +716,7 @@ class Acc_Ledger_Sold extends Acc_Ledger /* retrieve information for card */ $fiche=new Fiche($this->db); $fiche->get_by_qcode(${"e_march".$i}); - $fiche_name=h($fiche->getName()); + $fiche_name=h(${"e_march".$i."_label"}); if ( $g_parameter->MY_TVA_USE=='Y') { $oTva=new Acc_Tva($this->db); @@ -1187,7 +1188,7 @@ class Acc_Ledger_Sold extends Acc_Ledger $march_tva_amount=(isset(${"e_march$i"."_tva_amount"}))?${"e_march$i"."_tva_amount"}:"" ; } - $march_label=' '; + $march_label=(isset(${"e_march".$i."_label"}))?${"e_march".$i."_label"}:""; // retrieve the tva label and name //-- @@ -1248,7 +1249,7 @@ class Acc_Ledger_Sold extends Acc_Ledger $array[$i]['tvac']=$tvac->input(); - $Span=new ISpan(); + $Span=new IText("e_march".$i."_label"); $Span->setReadOnly(false); // card's name, price //-- diff --git a/include/class_document.php b/include/class_document.php index 589818f3a..c97400ac1 100644 --- a/include/class_document.php +++ b/include/class_document.php @@ -800,6 +800,13 @@ class Document } else $r = ""; break; + case 'VEN_ART_LABEL': + extract ($_POST); + $id='e_march'.$counter."_label"; + // check if the march exists + if ( ! isset (${$id})) return ""; + $r=${'e_march'.$counter.'_label'}; + break; case 'VEN_ART_PRICE': extract ($_POST); diff --git a/include/template/ledger_detail_ach.php b/include/template/ledger_detail_ach.php index dc428ff26..c487c2568 100644 --- a/include/template/ledger_detail_ach.php +++ b/include/template/ledger_detail_ach.php @@ -149,7 +149,10 @@ echo ''; $tva->load(); $sym_tva=h($tva->get_parameter('label')); } - $row.=td($fiche->strAttribut(ATTR_DEF_NAME)); + $l_lib=($q[$e]['j_text']=='')?$fiche->strAttribut(ATTR_DEF_NAME):$q[$e]['j_text']; + $hidden=HtmlInput::hidden("j_id[]",$q[$e]['j_id']); + $input=new IText("e_march".$q[$e]['j_id']."_label",$l_lib); + $row.=td($input->input().$hidden); $row.=td($sym_tva,'style="text-align:center"'); $pu=bcdiv($q['qp_price'],$q['qp_quantite']); $row.=td(nbm($pu),'class="num"'); diff --git a/include/template/ledger_detail_ven.php b/include/template/ledger_detail_ven.php index 7397aa122..e536f6e9f 100644 --- a/include/template/ledger_detail_ven.php +++ b/include/template/ledger_detail_ven.php @@ -139,7 +139,10 @@ echo ''; $fiche->id, $gDossier, $fiche->strAttribut(ATTR_DEF_QUICKCODE)); $row=td($view_history); - $row.=td($fiche->strAttribut(ATTR_DEF_NAME)); + $l_lib=($q[$e]['j_text']=='')?$fiche->strAttribut(ATTR_DEF_NAME):$q[$e]['j_text']; + $hidden=HtmlInput::hidden("j_id[]",$q[$e]['j_id']); + $input=new IText("e_march".$q[$e]['j_id']."_label",$l_lib); + $row.=td($input->input().$hidden); $sym_tva=''; $pu=bcdiv($q['qs_price'],$q['qs_quantite']); $row.=td(nbm($pu),'class="num"');