Bug : After move of ajax_ledger , the variable $op override the parameter $op[] , it prevents to save analytic changes
This commit is contained in:
parent
35aa11ba34
commit
8a80d7e3e8
5 changed files with 12 additions and 12 deletions
|
|
@ -799,27 +799,27 @@ class Anc_Operation
|
|||
function save_update_form($p_array)
|
||||
{
|
||||
extract($p_array);
|
||||
for ($i = 0; $i < count($op); $i++)
|
||||
for ($i = 0; $i < count($opanc); $i++)
|
||||
{
|
||||
/* clean operation_analytique */
|
||||
$this->db->exec_sql('delete from operation_analytique where j_id=$1', array($op[$i]));
|
||||
$this->db->exec_sql('delete from operation_analytique where j_id=$1', array($opanc[$i]));
|
||||
|
||||
/* get missing data for adding */
|
||||
$a_missing = $this->db->get_array("select to_char(jr_date,'DD.MM.YYYY')
|
||||
as mdate,j_montant,j_debit,jr_comment ,j_poste
|
||||
from jrnx join jrn on (j_grpt=jr_grpt_id) where j_id=$1", array($op[$i]));
|
||||
from jrnx join jrn on (j_grpt=jr_grpt_id) where j_id=$1", array($opanc[$i]));
|
||||
$missing = $a_missing[0];
|
||||
|
||||
$this->oa_description = $missing['jr_comment'];
|
||||
$this->j_id = $op[$i];
|
||||
$this->j_id = $opanc[$i];
|
||||
$group = $this->db->get_next_seq("s_oa_group"); /* for analytic */
|
||||
$this->oa_group = $group;
|
||||
$this->oa_date = $missing['mdate'];
|
||||
$this->save_form_plan($p_array, $i, $op[$i]);
|
||||
$this->save_form_plan($p_array, $i, $opanc[$i]);
|
||||
|
||||
// There is ND VAT amount
|
||||
$a_nd = $this->db->get_array('select j_id from operation_analytique
|
||||
where oa_jrnx_id_source=$1', array($op[$i]));
|
||||
where oa_jrnx_id_source=$1', array($opanc[$i]));
|
||||
if (count($a_nd) > 0)
|
||||
{
|
||||
// for each ND VAT amount
|
||||
|
|
@ -831,11 +831,11 @@ class Anc_Operation
|
|||
$missing_vat = $a_missing_vat[0];
|
||||
$this->oa_debit = 't';
|
||||
$this->oa_description = $missing_vat['jr_comment'];
|
||||
$this->j_id = $op[$i];
|
||||
$this->j_id = $opanc[$i];
|
||||
$group = $this->db->get_next_seq("s_oa_group"); /* for analytic */
|
||||
$this->oa_group = $group;
|
||||
$this->oa_date = $missing_vat['mdate'];
|
||||
$this->oa_jrnx_id_source=$op[$i];
|
||||
$this->oa_jrnx_id_source=$opanc[$i];
|
||||
$p_array['amount_t'.$i]=$missing['j_montant'];
|
||||
$this->save_form_plan_vat_nd($p_array, $i, $a_nd[$e]['j_id'],$missing_vat['j_montant']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ $str_anc="";
|
|||
$anc_op->in_div=$div;
|
||||
$side=($q['j_debit'] == 'f')?'C':'D';
|
||||
|
||||
echo HtmlInput::hidden('op[]', $anc_op->j_id);
|
||||
echo HtmlInput::hidden('opanc[]', $anc_op->j_id);
|
||||
/* compute total price */
|
||||
bcscale(2);
|
||||
$str_anc.='<tr>';
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ echo td(_('Pièce')).td($itext->input());
|
|||
$str_anc.=td($qcode);
|
||||
$str_anc.=td(nbm($q[$e]['j_montant']));
|
||||
$str_anc.='<td>';
|
||||
$str_anc.= HtmlInput::hidden('op[]',$anc_op->j_id);
|
||||
$str_anc.= HtmlInput::hidden('opanc[]',$anc_op->j_id);
|
||||
$montant=($q[$e]['j_debit'] == "t")?$q[$e]['j_montant']:bcmul($q[$e]['j_montant'], -1);
|
||||
$str_anc.=$anc_op->display_table(1,$montant,$div);
|
||||
$str_anc.='</td>';
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ $amount_idx=0;
|
|||
$side=($q[$e]['j_debit'] == 'f')?'C':'D';
|
||||
|
||||
$str_anc.='<tr>';
|
||||
$str_anc.=HtmlInput::hidden('op[]',$anc_op->j_id);
|
||||
$str_anc.=HtmlInput::hidden('opanc[]',$anc_op->j_id);
|
||||
$str_anc.=td($q[$e]['j_qcode']);
|
||||
$str_anc.=td($q[$e]['j_poste']);
|
||||
$str_anc.=td(nbm($q[$e]['j_montant'])." {$side}");
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ echo $ipaid->input();
|
|||
$anc_op->in_div=$div;
|
||||
$anc_op->j_id = $q['j_id'];
|
||||
$side=($q['j_debit'] == 'f')?'C':'D';
|
||||
echo HtmlInput::hidden('op[]', $anc_op->j_id);
|
||||
echo HtmlInput::hidden('opanc[]', $anc_op->j_id);
|
||||
/* compute total price */
|
||||
bcscale(2);
|
||||
$str_anc.='<tr>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue