Fix: check if module bank activated
Conflicts: htdocs/adherents/subscription.php
This commit is contained in:
parent
913a5d1df2
commit
6d5c2bf7b2
@ -33,7 +33,7 @@ class Subscription extends CommonObject
|
||||
public $element='subscription';
|
||||
public $table_element='subscription';
|
||||
public $picto='payment';
|
||||
|
||||
|
||||
var $datec; // Date creation
|
||||
var $datem; // Date modification
|
||||
var $dateh; // Subscription start date (date subscription)
|
||||
@ -193,12 +193,11 @@ class Subscription extends CommonObject
|
||||
*/
|
||||
function delete($user)
|
||||
{
|
||||
$accountline=new AccountLine($this->db);
|
||||
|
||||
// It subscription is linked to a bank transaction, we get it
|
||||
if ($this->fk_bank > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
$accountline=new AccountLine($this->db);
|
||||
$result=$accountline->fetch($this->fk_bank);
|
||||
}
|
||||
|
||||
@ -288,7 +287,7 @@ class Subscription extends CommonObject
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -301,7 +300,7 @@ class Subscription extends CommonObject
|
||||
$langs->load("members");
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load information of the subscription object
|
||||
*
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -32,7 +32,10 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // TODO a lot of dependency on the bank module, but no test if this module is not activated!
|
||||
if (! empty($conf->banque->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
}
|
||||
@ -823,7 +826,6 @@ if ($rowid > 0)
|
||||
if ($result)
|
||||
{
|
||||
$subscriptionstatic=new Subscription($db);
|
||||
$accountstatic=new Account($db);
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
@ -853,15 +855,17 @@ if ($rowid > 0)
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dateh),'day')."</td>\n";
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
|
||||
print '<td align="right">'.price($objp->subscription).'</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td align="right">';
|
||||
if ($objp->bid)
|
||||
{
|
||||
$accountstatic->label=$objp->label;
|
||||
$accountstatic->id=$objp->baid;
|
||||
$accountstatic->number=$objp->number;
|
||||
$accountstatic->account_number=$objp->account_number;
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td align="right">';
|
||||
if ($objp->bid)
|
||||
{
|
||||
$accountstatic=new Account($db);
|
||||
|
||||
$accountstatic->label=$objp->label;
|
||||
$accountstatic->id=$objp->baid;
|
||||
$accountstatic->number=$objp->number;
|
||||
$accountstatic->account_number=$objp->account_number;
|
||||
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
|
||||
@ -25,7 +25,9 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
if (! empty($conf->banque->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
}
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
@ -231,20 +233,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
|
||||
if ($object->fk_bank)
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
$result=$bankline->fetch($object->fk_bank);
|
||||
$bankline=new AccountLine($db);
|
||||
$result=$bankline->fetch($object->fk_bank);
|
||||
print $bankline->getNomUrl(1,0,'showall');
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("NoneF");
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@ -326,27 +328,26 @@ if ($rowid && $action != 'edit')
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||
|
||||
// Bank line
|
||||
// Bank line
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
||||
if ($object->fk_bank)
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
$result=$bankline->fetch($object->fk_bank);
|
||||
print $bankline->getNomUrl(1,0,'showall');
|
||||
$bankline=new AccountLine($db);
|
||||
$result=$bankline->fetch($object->fk_bank);
|
||||
print $bankline->getNomUrl(1,0,'showall');
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("NoneF");
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -26,7 +26,9 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
if (! empty($conf->banque->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
}
|
||||
|
||||
$langs->load("members");
|
||||
|
||||
@ -267,7 +269,6 @@ if ($result)
|
||||
// Static objects
|
||||
$subscription=new Subscription($db);
|
||||
$adherent=new Adherent($db);
|
||||
$accountstatic=new Account($db);
|
||||
|
||||
$total=0;
|
||||
while ($i < min($num, $limit))
|
||||
@ -304,22 +305,24 @@ if ($result)
|
||||
print dol_trunc($obj->note,32);
|
||||
print '</td>';
|
||||
|
||||
// Banque
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($obj->fk_account)
|
||||
{
|
||||
$accountstatic->id=$obj->fk_account;
|
||||
$accountstatic->fetch($obj->fk_account);
|
||||
//$accountstatic->label=$obj->label;
|
||||
print '<td>'.$accountstatic->getNomUrl(1).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td>";
|
||||
print "</td>\n";
|
||||
}
|
||||
}
|
||||
// Banque
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
$accountstatic=new Account($db);
|
||||
|
||||
if ($obj->fk_account)
|
||||
{
|
||||
$accountstatic->id=$obj->fk_account;
|
||||
$accountstatic->fetch($obj->fk_account);
|
||||
//$accountstatic->label=$obj->label;
|
||||
print '<td>'.$accountstatic->getNomUrl(1).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td>";
|
||||
print "</td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Date start
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user