diff --git a/html/image/documents.png b/html/image/documents.png
new file mode 100644
index 000000000..61d9f0ff9
Binary files /dev/null and b/html/image/documents.png differ
diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php
index cfef50427..8b9281d80 100644
--- a/include/class_acc_ledger.php
+++ b/include/class_acc_ledger.php
@@ -995,9 +995,7 @@ class Acc_Ledger extends jrn_def_sql
//document
if ($row['jr_pj_name'] != "")
{
- $image = '
';
- $r.="
" . sprintf('%s', $row['jrn_def_id'], $row['jr_grpt_id'], $str_dossier, $image)
- . " | ";
+ $r.=''.HtmlInput::show_receipt_document($row['jr_id']).' | ';
}
else
$r.=" | ";
diff --git a/include/class_html_input.php b/include/class_html_input.php
index a31949a2c..d3595882f 100755
--- a/include/class_html_input.php
+++ b/include/class_html_input.php
@@ -822,5 +822,25 @@ class HtmlInput
echo $hid_jrn;
echo '';
}
+ /**
+ * Returns HTML code for displaying a icon with a link to a receipt document from
+ * the ledger
+ * @global $cn database connx
+ * @param $p_jr_id jrn.jr_id
+ * @return nothing or HTML Code for a link to the document
+ */
+ static function show_receipt_document($p_jr_id)
+ {
+ global $cn;
+
+ $array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',array($p_jr_id));
+ if (count($array)==0) return "";
+ if ($array[0]['jr_pj_name'] == "") return "";
+ $str_dossier=Dossier::get();
+ $image='
';
+ $r=sprintf('%s', $array[0]['jr_def_id'], $array[0]['jr_grpt_id'], $str_dossier, $image);
+ return $r;
+
+ }
}