diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index 4f9bf708b..a01abd45b 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -433,13 +433,51 @@ function go_next_concerned() {
}
return true;
}
+function view_history_account(p_value,dossier)
+{
+ layer++;id='det'+layer;
+ var popup={'id':id,'cssclass':'op_detail','html':loading(),'drag':true};
+ querystring='?gDossier='+dossier+'&act=de&pcm_val='+p_value+'&div='+id;
+ add_div(popup);
+ var action=new Ajax.Request(
+ "ajax_history.php",
+ {
+ method:'get',
+ parameters:querystring,
+ onFailure:error_box,
+ onSuccess:success_box
+ }
+ );
+ g(id).style.top=posY-40;
+ g(id).style.left=posX-10;
+}
/*!\brief
- * \param p_value jrn.jr_id
- * \param p_jrn ledger number
- * \param p_vue easy or expert view of the operation
+ * \param p_value f_id of the card
*/
+function view_history_card(p_value,dossier)
+{
+ layer++;id='det'+layer;
+ var popup={'id':id,'cssclass':'op_detail','html':loading(),'drag':true};
+ querystring='?gDossier='+dossier+'&act=de&f_id='+p_value+'&div='+id;
+ add_div(popup);
+ var action=new Ajax.Request(
+ "ajax_history.php",
+ {
+ method:'get',
+ parameters:querystring,
+ onFailure:error_box,
+ onSuccess:success_box
+ }
+ );
+ g(id).style.top=posY-40;
+ g(id).style.left=posX-10;
+
+}
+/*!\brief
+ * \param p_value jrn.jr_id
+ */
function modifyOperation(p_value,dossier)
{
layer++;id='det'+layer;
diff --git a/include/class_acc_account_ledger.php b/include/class_acc_account_ledger.php
index 26ad39b36..5824ea8da 100644
--- a/include/class_acc_account_ledger.php
+++ b/include/class_acc_account_ledger.php
@@ -264,11 +264,12 @@ function get_solde_detail($p_cond="") {
*/
- function HtmlTable()
+ function HtmlTable($p_array=null )
{
+ if ( $p_array==null)$p_array=$_REQUEST;
$this->get_name();
- list($array,$tot_deb,$tot_cred)=$this->get_row_date( $_REQUEST['from_periode'],
- $_REQUEST['to_periode']
+ list($array,$tot_deb,$tot_cred)=$this->get_row_date( $p_array['from_periode'],
+ $p_array['to_periode']
);
if ( count($this->row ) == 0 )
@@ -288,8 +289,11 @@ function get_solde_detail($p_cond="") {
"";
foreach ( $this->row as $op ) {
+ $vw_operation=sprintf('%s',
+ $op['jr_id'], dossier::id(), $op['jr_internal']);
+
echo "
".
- "| ".$op['jr_internal']." | ".
+ "".$vw_operation." | ".
"".$op['j_date']." | ".
"".h($op['description']).' '.h($op['jr_pj_number'])." | ".
"".$op['deb_montant']." | ".
diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php
index d7ddb5e91..3395cb478 100644
--- a/include/class_acc_ledger.php
+++ b/include/class_acc_ledger.php
@@ -541,8 +541,8 @@ jr_comment||' ('||jr_internal||')'||case when jr_pj_number is not null and jr_pj
}
//DEBUG
- $r.=sprintf('%s',
- $row['jr_id'], $gDossier, $row['jrn_def_id'],$vue, $row['jr_internal']);
+ $r.=sprintf('%s',
+ $row['jr_id'], $gDossier, $row['jr_internal']);
$r.="";
if ( $this->type=='') $r.=td($row['jrn_def_name']);
// date
diff --git a/include/class_fiche.php b/include/class_fiche.php
index 666922212..bc874834d 100644
--- a/include/class_fiche.php
+++ b/include/class_fiche.php
@@ -1038,7 +1038,7 @@ av_text1=>'name'
if ( $p_array == null)
$p_array=$_REQUEST;
- $name=h($this->getName());
+ $name=h($this->getName()).'['.$this->strAttribut(ATTR_DEF_QUICKCODE).']';
list($array,$tot_deb,$tot_cred)=$this->get_row_date( $p_array['from_periode'],
$p_array['to_periode']
@@ -1049,7 +1049,7 @@ av_text1=>'name'
$rep="";
- echo ''.$this->id." ".$name.'
';
+ echo ''." ".$name.'
';
echo "";
echo "".
"| "._('Code interne')." | ".
@@ -1060,8 +1060,11 @@ av_text1=>'name'
"
";
foreach ( $this->row as $op ) {
+ $vw_operation=sprintf('%s',
+ $op['jr_id'], dossier::id(), $op['jr_internal']);
+
echo "".
- "| ".$op['jr_internal']." | ".
+ "".$vw_operation." | ".
"".$op['j_date_fmt']." | ".
"".h($op['description'])." | ".
"".$op['deb_montant']." | ".
diff --git a/include/template/history_top.php b/include/template/history_top.php
new file mode 100644
index 000000000..78b6d8d77
--- /dev/null
+++ b/include/template/history_top.php
@@ -0,0 +1,11 @@
+
+
+ if ($div != "popup") {
+ $callback=$_SERVER['PHP_SELF'];
+ $str=$_SERVER['QUERY_STRING']."&act=de&ajax=$callback";
+ echo '
+!pop me up ! ';
+echo '
Fermer';
+}
+?>
+
\ No newline at end of file
diff --git a/include/template/ledger_detail_ach.php b/include/template/ledger_detail_ach.php
index a5788c23a..f25f71bc8 100644
--- a/include/template/ledger_detail_ach.php
+++ b/include/template/ledger_detail_ach.php
@@ -21,13 +21,11 @@ $bk=new Fiche($cn,$obj->det->array[0]['qp_supplier']);
echo td(_('Client'));
/**
*@file
- *@todo ajouter la possiblité d'avoir l'historique si on cliques sur le quick_code
- *@quant_fin les opérations avec visa ne sont pas rentrées dans quant_fin, donc il faut
- * faire une procédure pl/sql : chercher les enregistrements qui ne sont pas dans quant_fin
- * et celui qui est ni client ni fournisseur est forcément le compte banque, insérer.
*@todo Ajouter une clef unique sur quant_fin.jr_id, quant_purchase.j_id et quant_sold.j_id
*/
-echo td(h($bk->getName())).td($bk->get_quick_code());;
+$view_history= sprintf('%s',
+ $bk->id, $gDossier, $bk->get_quick_code());
+echo td(h($bk->getName())).td($view_history);;
?>
@@ -79,7 +77,11 @@ echo '
';
$row='';
$q=$obj->det->array[$e];
$fiche=new Fiche($cn,$q['qp_fiche']);
- $row=td($fiche->strAttribut(ATTR_DEF_QUICKCODE));
+ $view_history= sprintf('%s',
+ $fiche->id, $gDossier, $fiche->strAttribut(ATTR_DEF_QUICKCODE));
+
+ $row=td($view_history);
+
$row.=td($fiche->strAttribut(ATTR_DEF_NAME));
$row.=td($q['qp_vat_code'],'class="num"');
$row.=td(sprintf("%.2f",$q['qp_price']),'class="num"');
@@ -137,8 +139,21 @@ echo th(_('Crédit'),' style="text-align:right"');
echo '';
for ($e=0;$edet->array);$e++) {
$row=''; $q=$detail->det->array;
- $row=td($q[$e]['j_poste']);
- $row.=td($q[$e]['j_qcode']);
+ $view_history= sprintf('%s',
+ $q[$e]['j_poste'], $gDossier, $q[$e]['j_poste']);
+
+ $row.=td($view_history);
+ if ( $q[$e]['j_qcode'] !=''){
+ $fiche=new Fiche($cn);
+ $fiche->get_by_qcode($q[$e]['j_qcode']);
+ $view_history= sprintf('%s',
+ $fiche->id,$gDossier, $q[$e]['j_qcode']);
+ }
+ else
+ $view_history='';
+ $row.=td($view_history);
+ /* $row=td($q[$e]['j_poste']); */
+ /* $row.=td($q[$e]['j_qcode']); */
if ( $q[$e]['j_qcode'] !='') {
// nom de la fiche
$ff=new Fiche($cn);
diff --git a/include/template/ledger_detail_fin.php b/include/template/ledger_detail_fin.php
index 46d286afb..4d6efdadc 100644
--- a/include/template/ledger_detail_fin.php
+++ b/include/template/ledger_detail_fin.php
@@ -14,25 +14,24 @@
$bk=new Fiche($cn,$obj->det->array[0]['qf_bank']);
-echo td($bk->get_quick_code());
+$view_history= sprintf('%s',
+ $bk->id, $gDossier, $bk->get_quick_code());
+echo td(h($bk->getName())).td($view_history);;
+
/**
*@file
- *@todo ajouter la possiblité d'avoir l'historique si on cliques sur le quick_code
- *@quant_fin les opérations avec visa ne sont pas rentrées dans quant_fin, donc il faut
- * faire une procédure pl/sql : chercher les enregistrements qui ne sont pas dans quant_fin
- * et celui qui est ni client ni fournisseur est forcément le compte banque, insérer.
*@todo Ajouter une clef unique sur quant_fin.jr_id, quant_purchase.j_id et quant_sold.j_id
*/
-echo td(h($bk->getName()));
?>
$bk=new Fiche($cn,$obj->det->array[0]['qf_other']);
-
-echo td($bk->get_quick_code());
+$view_history= sprintf('%s',
+ $bk->id, $gDossier, $bk->get_quick_code());
echo td(h($bk->getName()));
+echo td($view_history);
?>
@@ -77,8 +76,19 @@ echo th(_('Crédit'),' style="text-align:right"');
echo '';
for ($e=0;$edet->array);$e++) {
$row=''; $q=$detail->det->array;
- $row=td($q[$e]['j_poste']);
- $row.=td($q[$e]['j_qcode']);
+ $view_history= sprintf('%s',
+ $q[$e]['j_poste'], $gDossier, $q[$e]['j_poste']);
+
+ $row.=td($view_history);
+ if ( $q[$e]['j_qcode'] !=''){
+ $fiche=new Fiche($cn);
+ $fiche->get_by_qcode($q[$e]['j_qcode']);
+ $view_history= sprintf('%s',
+ $fiche->id,$gDossier, $q[$e]['j_qcode']);
+ }
+ else
+ $view_history='';
+ $row.=td($view_history);
if ( $q[$e]['j_qcode'] !='') {
// nom de la fiche
$ff=new Fiche($cn);
diff --git a/include/template/ledger_detail_misc.php b/include/template/ledger_detail_misc.php
index 50378d1cc..7a36a9167 100644
--- a/include/template/ledger_detail_misc.php
+++ b/include/template/ledger_detail_misc.php
@@ -71,8 +71,20 @@ echo th(_('Crédit'), 'style="text-align:right"');
echo '';
for ($e=0;$edet->array);$e++) {
$row=''; $q=$obj->det->array;
- $row=td($q[$e]['j_poste']);
- $row.=td($q[$e]['j_qcode']);
+ $view_history= sprintf('%s',
+ $q[$e]['j_poste'], $gDossier, $q[$e]['j_poste']);
+
+ $row.=td($view_history);
+ if ( $q[$e]['j_qcode'] !='') {
+ $fiche=new Fiche($cn);
+ $fiche->get_by_qcode($q[$e]['j_qcode']);
+ $view_history= sprintf('%s',
+ $fiche->id, $gDossier, $q[$e]['j_qcode']);
+ }
+ else
+ $view_history='';
+ $row.=td($view_history);
+
if ( $q[$e]['j_qcode'] !='') {
// nom de la fiche
$ff=new Fiche($cn);
diff --git a/include/template/ledger_detail_ven.php b/include/template/ledger_detail_ven.php
index 186c86e36..9f3edb77f 100644
--- a/include/template/ledger_detail_ven.php
+++ b/include/template/ledger_detail_ven.php
@@ -21,13 +21,11 @@ $bk=new Fiche($cn,$obj->det->array[0]['qs_client']);
echo td(_('Client'));
/**
*@file
- *@todo ajouter la possiblité d'avoir l'historique si on cliques sur le quick_code
- *@quant_fin les opérations avec visa ne sont pas rentrées dans quant_fin, donc il faut
- * faire une procédure pl/sql : chercher les enregistrements qui ne sont pas dans quant_fin
- * et celui qui est ni client ni fournisseur est forcément le compte banque, insérer.
*@todo Ajouter une clef unique sur quant_fin.jr_id, quant_purchase.j_id et quant_sold.j_id
*/
-echo td(h($bk->getName())).td($bk->get_quick_code());;
+$view_history= sprintf('%s',
+ $bk->id, $gDossier, $bk->get_quick_code());
+echo td(h($bk->getName())).td($view_history);;
?>
@@ -79,7 +77,10 @@ echo '
';
$row='';
$q=$obj->det->array[$e];
$fiche=new Fiche($cn,$q['qs_fiche']);
- $row=td($fiche->strAttribut(ATTR_DEF_QUICKCODE));
+ $view_history= sprintf('%s',
+ $fiche->id, $gDossier, $fiche->strAttribut(ATTR_DEF_QUICKCODE));
+
+ $row=td($view_history);
$row.=td($fiche->strAttribut(ATTR_DEF_NAME));
$row.=td($q['qs_vat_code'],'class="num"');
$row.=td(sprintf("%.2f",$q['qs_price']),'class="num"');
@@ -136,22 +137,34 @@ echo th(_('Débit'),' style="text-align:right"');
echo th(_('Crédit'),' style="text-align:right"');
echo '';
for ($e=0;$edet->array);$e++) {
- $row=''; $q=$detail->det->array;
- $row=td($q[$e]['j_poste']);
- $row.=td($q[$e]['j_qcode']);
- if ( $q[$e]['j_qcode'] !='') {
+ $row=''; $q=$detail->det->array[$e];
+ $view_history= sprintf('%s',
+ $q['j_poste'], $gDossier, $q['j_poste']);
+
+ $row.=td($view_history);
+ if ( $q['j_qcode'] !=''){
+ $fiche=new Fiche($cn);
+ $fiche->get_by_qcode($q['j_qcode']);
+ $view_history= sprintf('%s',
+ $fiche->id,$gDossier, $q['j_qcode']);
+ }
+ else
+ $view_history='';
+ $row.=td($view_history);
+
+ if ( $q['j_qcode'] !='') {
// nom de la fiche
$ff=new Fiche($cn);
- $ff->get_by_qcode( $q[$e]['j_qcode']);
+ $ff->get_by_qcode( $q['j_qcode']);
$row.=td($ff->strAttribut(h(ATTR_DEF_NAME)));
} else {
// libellé du compte
- $name=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($q[$e]['j_poste']));
+ $name=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($q['j_poste']));
$row.=td(h($name));
}
- $montant=td(sprintf("%.2f",$q[$e]['j_montant']),'class="num"');
- $row.=($q[$e]['j_debit']=='t')?$montant:td('');
- $row.=($q[$e]['j_debit']=='f')?$montant:td('');
+ $montant=td(sprintf("%.2f",$q['j_montant']),'class="num"');
+ $row.=($q['j_debit']=='t')?$montant:td('');
+ $row.=($q['j_debit']=='f')?$montant:td('');
echo tr($row);
}
diff --git a/release-note b/release-note
index b7662605c..8c9da22b2 100644
--- a/release-note
+++ b/release-note
@@ -1,6 +1,7 @@
1. Ajout balance par catégorie de fiche
2. DONE3. changer le code pour ajouter de la CA ou la modifier dans un DIV HTML, le fichier jrn.php devient inutile (deprecated)
3. DONE16 Détail opération dans DIV HTML
+4. Dans les détails d'opérations, on a aussi des liens vers les historiques par fiche ou par poste comptable
TODO1 réecriture de quant_* la liaison avec la jrn se fait à travers jr_id et non pas jr_internal qui n'est pas indexé.
Conséquence : réécriture de code, correction modop, ...