Cosmetic : Opération prédéfinie, modèle

This commit is contained in:
Dany De Bontridder 2020-03-02 20:39:34 +01:00
parent 5bd1ed9373
commit 53a36e7ab6
4 changed files with 20 additions and 21 deletions

View file

@ -1227,9 +1227,7 @@ function mod_predf_op(dossier_id, od_id)
{
var target = "mod_predf_op";
removeDiv(target);
var sx = '20%';
var sy = '10%';
var str_style = "top:" + sx + ";left:" + sy + ";";
var str_style = "top:10%;left:2%;width:96%";
var div = {id: target, cssclass: 'inner_box', style: str_style, html: loading(), drag: 1};

View file

@ -40,18 +40,19 @@ class Pre_op_ach extends Pre_operation_detail
function get_post()
{
parent::get_post();
$http=new HttpInput();
$this->operation->od_direct='f';
$this->e_client=$_POST['e_client'];
$this->e_client=$http->post('e_client');
for ($i=0;$i<$this->operation->nb_item;$i++)
{
$march="e_march".$i;
$this->$march=$_POST['e_march'.$i];
$this->{"e_march".$i."_price"}=(isset ($_POST['e_march'.$i."_price"]))?$_POST['e_march'.$i."_price"]:0;
$this->{"e_march".$i."_price"}=(trim($_POST['e_march'.$i."_price"])=="")?0:$_POST['e_march'.$i."_price"];
$this->{"e_march".$i."_tva_id"}=(isset ($_POST['e_march'.$i."_tva_id"]))?$_POST['e_march'.$i."_tva_id"]:0;
$this->{"e_march".$i."_tva_amount"}=(isset($_POST['e_march'.$i."_tva_amount"]))?$_POST['e_march'.$i."_tva_amount"]:0;
$this->{"e_march".$i."_label"}=(isset($_POST['e_march'.$i."_label"]))?$_POST['e_march'.$i."_label"]:null;
$this->{"e_quant".$i}=$_POST['e_quant'.$i];
$this->$march=$http->post('e_march'.$i);
$this->{"e_march".$i."_price"}=$http->post('e_march'.$i."_price","string",0);
$this->{"e_march".$i."_price"}=$http->post('e_march'.$i."_price","string",0);
$this->{"e_march".$i."_tva_id"}=$http->post('e_march'.$i."_tva_id","string",0);
$this->{"e_march".$i."_tva_amount"}=$http->post('e_march'.$i."_tva_amount","string",0);
$this->{"e_march".$i."_label"}=$http->post('e_march'.$i."_label","string",NULL);
$this->{"e_quant".$i}=$http->post('e_quant'.$i);
}
}
@ -403,7 +404,7 @@ class Pre_op_ach extends Pre_operation_detail
// Set correctly the REQUEST param for jrn_type
$r.= HtmlInput::hidden('jrn_type','ACH');
$r.= HtmlInput::button('add_item',_('Ajout article'), ' onClick="ledger_add_row()"');
$r.= Html_Input_Noalyss::ledger_add_item("O");
return $r;
}

View file

@ -71,14 +71,14 @@ class Pre_operation
/*!\brief fill the object with the $_POST variable */
function get_post()
{
$this->nb_item=$_POST['nb_item'];
$this->p_jrn=$_REQUEST['p_jrn'];
$this->jrn_type=$_POST['jrn_type'];
$this->name=$_POST['opd_name'];
$http=new HttpInput();
$this->nb_item=$http->post('nb_item',"number");
$this->p_jrn=$http->request('p_jrn',"number");
$this->jrn_type=$http->post('jrn_type');
$this->name=$http->post('opd_name');
$this->name=(trim($this->name)=='')?$_POST['e_comm']:$this->name;
$this->description= $_POST['od_description'];
$this->name=(trim($this->name)=='')?$http->post('e_comm'):$this->name;
$this->description= $http->post('od_description');
if ( $this->name=="")
{
$n=$this->db->get_next_seq('op_def_op_seq');
@ -106,7 +106,7 @@ class Pre_operation
}
if ( $this->count() > MAX_PREDEFINED_OPERATION )
{
echo '<span class="notice">'.("Vous avez atteint le max. d'op&eacute;ration pr&eacute;d&eacute;finie, d&eacute;sol&eacute;").'</span>';
echo '<span class="notice">'.("Vous avez atteint le max. d'opération prédéfinie, désolé").'</span>';
return false;
}
$sql='insert into op_predef (jrn_def_id,od_name,od_item,od_jrn_type,od_direct,od_description)'.

View file

@ -36,7 +36,7 @@ echo '<tr>';
echo $item['quick_code'];
echo '<td>'.$item['bt'].'</td>';
?>
<td style="border-bottom: 1px dotted grey; width: 75%;"><?php echo $item['denom'] ?></td>
<td style="border-bottom: 1px dotted grey;"><?php echo $item['denom'] ?></td>
<?php
echo td($item['pu']);
echo td($item['quantity' ]);