Fix: check if module bank activated
Conflicts: htdocs/adherents/subscription.php
This commit is contained in:
parent
913a5d1df2
commit
6d5c2bf7b2
@ -193,12 +193,11 @@ class Subscription extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
$accountline=new AccountLine($this->db);
|
|
||||||
|
|
||||||
// It subscription is linked to a bank transaction, we get it
|
// It subscription is linked to a bank transaction, we get it
|
||||||
if ($this->fk_bank > 0)
|
if ($this->fk_bank > 0)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
$accountline=new AccountLine($this->db);
|
||||||
$result=$accountline->fetch($this->fk_bank);
|
$result=$accountline->fetch($this->fk_bank);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* 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) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* 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>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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/adherent_type.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.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.'/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)) {
|
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
}
|
}
|
||||||
@ -823,7 +826,6 @@ if ($rowid > 0)
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$subscriptionstatic=new Subscription($db);
|
$subscriptionstatic=new Subscription($db);
|
||||||
$accountstatic=new Account($db);
|
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -858,6 +860,8 @@ if ($rowid > 0)
|
|||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($objp->bid)
|
if ($objp->bid)
|
||||||
{
|
{
|
||||||
|
$accountstatic=new Account($db);
|
||||||
|
|
||||||
$accountstatic->label=$objp->label;
|
$accountstatic->label=$objp->label;
|
||||||
$accountstatic->id=$objp->baid;
|
$accountstatic->id=$objp->baid;
|
||||||
$accountstatic->number=$objp->number;
|
$accountstatic->number=$objp->number;
|
||||||
|
|||||||
@ -25,7 +25,9 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.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/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -346,7 +348,6 @@ if ($rowid && $action != 'edit')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,9 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.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.'/adherents/class/subscription.class.php';
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
|
|
||||||
@ -267,7 +269,6 @@ if ($result)
|
|||||||
// Static objects
|
// Static objects
|
||||||
$subscription=new Subscription($db);
|
$subscription=new Subscription($db);
|
||||||
$adherent=new Adherent($db);
|
$adherent=new Adherent($db);
|
||||||
$accountstatic=new Account($db);
|
|
||||||
|
|
||||||
$total=0;
|
$total=0;
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit))
|
||||||
@ -307,6 +308,8 @@ if ($result)
|
|||||||
// Banque
|
// Banque
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
|
$accountstatic=new Account($db);
|
||||||
|
|
||||||
if ($obj->fk_account)
|
if ($obj->fk_account)
|
||||||
{
|
{
|
||||||
$accountstatic->id=$obj->fk_account;
|
$accountstatic->id=$obj->fk_account;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user