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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?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) 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;
|
||||||
@ -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->dateh),'day')."</td>\n";
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'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>';
|
print '<td align="right">'.price($objp->subscription).'</td>';
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($objp->bid)
|
if ($objp->bid)
|
||||||
{
|
{
|
||||||
$accountstatic->label=$objp->label;
|
$accountstatic=new Account($db);
|
||||||
$accountstatic->id=$objp->baid;
|
|
||||||
$accountstatic->number=$objp->number;
|
$accountstatic->label=$objp->label;
|
||||||
$accountstatic->account_number=$objp->account_number;
|
$accountstatic->id=$objp->baid;
|
||||||
|
$accountstatic->number=$objp->number;
|
||||||
|
$accountstatic->account_number=$objp->account_number;
|
||||||
|
|
||||||
if (! empty($conf->accounting->enabled))
|
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.'/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';
|
||||||
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("companies");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -231,20 +233,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
|||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
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)
|
if ($object->fk_bank)
|
||||||
{
|
{
|
||||||
$bankline=new AccountLine($db);
|
$bankline=new AccountLine($db);
|
||||||
$result=$bankline->fetch($object->fk_bank);
|
$result=$bankline->fetch($object->fk_bank);
|
||||||
print $bankline->getNomUrl(1,0,'showall');
|
print $bankline->getNomUrl(1,0,'showall');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("NoneF");
|
print $langs->trans("NoneF");
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -326,27 +328,26 @@ if ($rowid && $action != 'edit')
|
|||||||
// Amount
|
// Amount
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||||
|
|
||||||
// Bank line
|
// Bank line
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
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)
|
if ($object->fk_bank)
|
||||||
{
|
{
|
||||||
$bankline=new AccountLine($db);
|
$bankline=new AccountLine($db);
|
||||||
$result=$bankline->fetch($object->fk_bank);
|
$result=$bankline->fetch($object->fk_bank);
|
||||||
print $bankline->getNomUrl(1,0,'showall');
|
print $bankline->getNomUrl(1,0,'showall');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("NoneF");
|
print $langs->trans("NoneF");
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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';
|
||||||
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");
|
$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))
|
||||||
@ -304,22 +305,24 @@ if ($result)
|
|||||||
print dol_trunc($obj->note,32);
|
print dol_trunc($obj->note,32);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Banque
|
// Banque
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
if ($obj->fk_account)
|
$accountstatic=new Account($db);
|
||||||
{
|
|
||||||
$accountstatic->id=$obj->fk_account;
|
if ($obj->fk_account)
|
||||||
$accountstatic->fetch($obj->fk_account);
|
{
|
||||||
//$accountstatic->label=$obj->label;
|
$accountstatic->id=$obj->fk_account;
|
||||||
print '<td>'.$accountstatic->getNomUrl(1).'</td>';
|
$accountstatic->fetch($obj->fk_account);
|
||||||
}
|
//$accountstatic->label=$obj->label;
|
||||||
else
|
print '<td>'.$accountstatic->getNomUrl(1).'</td>';
|
||||||
{
|
}
|
||||||
print "<td>";
|
else
|
||||||
print "</td>\n";
|
{
|
||||||
}
|
print "<td>";
|
||||||
}
|
print "</td>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user