";
$disable=($p_mode==0)?"disabled":"";
$str_dossier=dossier::get();
$count=0;
for ( $i =0 ; $i < sizeof($l_array); $i++) {
$content=$l_array[$i] ;
// for the first line
if ( $i == 0 ) {
$r.="
";
$r.="
";
// Date
$r.="
";
$r.=$content['jr_date'];
$r.="
";
// Internal
$r.="
";
$r.=$content['jr_internal'];
$r.="
";
$r.='
';
// for upload document we need the grpt_id
$r.='';
// comment can be changed
$r.="
";
}
$r.="";
$r.="";
$r.="Total ".$content['jr_montant']." ";
/* count the number of additionnal info */
$acc_jrn_info=new Acc_Ledger_Info($p_cn);
$acc_jrn_info->set_jrn_id($p_jr_id);
/* if additional info > 0 show them */
if ( $acc_jrn_info->count() > 0 ) {
$array=$acc_jrn_info->load_all();
foreach ($array as $row) {
if ( strpos($row->id_type,'BON_COMMANDE') ===0) {
$r.="Num bon de commande : ".$row->ji_value.' ';
}
if ( strpos($row->id_type,'OTHER') ===0) {
$r.="Autre info : ".$row->ji_value.' ';
}
}
}
if ( $p_mode==1) {
// show all the related operation
$rec=new Acc_Reconciliation($p_cn);
$rec->set_jr_id($content['jr_id']);
$a=$rec->get();
$sessid=$_REQUEST["PHPSESSID"];
if ( $a != null ) {
$r.="Operation concernée ";
$r.= '
'.$search;
} // if mode == 1
$r.='';
return $r;
}
/*!
* \brief Display the form to UPDATE account operation in the user view
*
* \param $p_cn database connection
* \param $jr_id pk of jrn
* \param mode 1 editable, 0 for CA
*/
function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
{
$gDossier=dossier::id();
$l_array=get_dataJrnJrIdUser($p_cn,$p_jr_id);
$str_dossier=dossier::get();
/* if the operation doesn't exist in the quant_xxx table then we
* show the expert view
*/
if ( $l_array == null || empty($l_array) == true) {
// If the operation is not in quant_sold or quant_purchase
// because those tables comes later
$r=ShowOperationExpert($p_cn,$p_jr_id,$p_mode);
return $r;
}
// own
$own=new own($p_cn);
echo_debug('jrn.php',__LINE__,$l_array);
// Javascript
$r=JS_LEDGER;
// Build the form
$col_vide="
";
$content=$l_array[0] ;
// for the first line
$internal=$content['jr_internal'];
$r.='
";
echo_debug(__FILE__.":".__LINE__."jrn_Def_type = ".$content['jrn_def_type']);
// for others lines
$own=new Own($p_cn);
// for purchase ledger
if ( $content['jrn_def_type'] == 'ACH' )
{
$r.='
';
$r.='
';
echo_debug(__FILE__.":".__LINE__." content['qp_supplier'] ".$content['qp_supplier']);
$client=new fiche($p_cn,$content['qp_supplier']);
$r.="Client : ".$client->getName();
echo_debug(__FILE__,__LINE__,$content);
/* now we get the different lines for this operation thanks */
/* the qp_internal == jr_internal */
$r.='
";
}
// for selling ledger
if ( $content['jrn_def_type'] == 'VEN' )
{
echo_debug(__FILE__.":".__LINE__." content['qs_client'] ".$content['qs_client']);
$client=new fiche($p_cn,$content['qs_client']);
$r.="Client : ".$client->getName();
echo_debug(__FILE__,__LINE__,$content);
/* now we get the different lines for this operation thanks */
/* the qs_internal == jr_internal */
$r.'
";
/* count the number of additionnal info */
$acc_jrn_info=new Acc_Ledger_Info($p_cn);
$acc_jrn_info->set_jrn_id($p_jr_id);
/* if additional info > 0 show them */
if ( $acc_jrn_info->count() > 0 ) {
$array=$acc_jrn_info->load_all();
foreach ($array as $row) {
if ( strpos($row->id_type,'BON_COMMANDE') ===0) {
$r.="Num bon de commande : ".$row->ji_value.' ';
}
if ( strpos($row->id_type,'OTHER') ===0) {
$r.="Autre info : ".$row->ji_value.' ';
}
}
}
$r.="";
if ( $p_mode == 1 ) {
$r.= "
";
$r.="
".$file->input("pj","","Pièce justificative")."
";
$r.="
";
$r.="";
$r.="";
$r.="Total ".$content['jr_montant']." ";
// show all the related operation
$rec=new Acc_Reconciliation($p_cn);
$rec->set_jr_id($content['jr_id']);
$a=$rec->get();
$sessid=$_REQUEST["PHPSESSID"];
if ( $a != null ) {
$r.="Operation concernée ";
$r.= '