';
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $langs->load("projects");
+ $morehtmlref.=$langs->trans('Project') . ' ';
+ if ($user->rights->tax->charges->creer)
+ {
+ if ($action != 'classify')
+ $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='
';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.='
';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+ }
+ $morehtmlref.='
';
+ $linkback = '';
+ print '
';
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
@@ -92,30 +131,22 @@ if ($object->id)
$totalsize+=$file['size'];
}
+ print '
';
- print '';
+ print '| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' |
';
+ print '| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' |
';
+ print '
';
- $linkback = ''.$langs->trans("BackToList").'';
+ print '';
- // Ref
- print '| '.$langs->trans("Ref").' | ';
- print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
- print ' |
';
+ print '';
- // Societe
- //print "| ".$langs->trans("Company")." | ".$object->client->getNomUrl(1)." |
";
-
- print '| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' |
';
- print '| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' |
';
- print '
';
-
- print '
';
-
- $modulepart = 'banque';
- $permission = $user->rights->banque->modifier;
- $param = '&id=' . $object->id;
- include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
+ dol_fiche_end();
+ $modulepart = 'banque';
+ $permission = $user->rights->banque->modifier;
+ $param = '&id=' . $object->id;
+ include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{
diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php
index 8550c0b50ef..6ebcb5fa109 100644
--- a/htdocs/compta/bank/various_payment/index.php
+++ b/htdocs/compta/bank/various_payment/index.php
@@ -17,9 +17,9 @@
*/
/**
- * \file htdocs/compta/bank/various_payment/index.php
- * \ingroup bank
- * \brief List of various payments
+ * \file htdocs/compta/bank/various_payment/index.php
+ * \ingroup bank
+ * \brief List of various payments
*/
require '../../../main.inc.php';
@@ -92,7 +92,7 @@ $form = new Form($db);
$variousstatic = new PaymentVarious($db);
$accountstatic = new Account($db);
-$sql = "SELECT v.rowid, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code,";
+$sql = "SELECT v.rowid, v.sens, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code,";
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number as bank_account_number, ba.fk_accountancy_journal as accountancy_journal, ba.label as blabel,";
$sql.= " pst.code as payment_code";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v";
@@ -102,9 +102,9 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.row
$sql.= " WHERE v.entity IN (".getEntity('payment_various').")";
// Search criteria
-if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
-if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
-if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
+if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
+if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
+if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1);
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
if ($filtre) {
diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php
index cda6b4ce137..f6c7dc063f7 100644
--- a/htdocs/compta/bank/various_payment/info.php
+++ b/htdocs/compta/bank/various_payment/info.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2017 Alexandre Spangaro