Merge pull request #2503 from aspangaro/develop-ReviewAssoc
New: Add management for accounting account in admin donation & debug
This commit is contained in:
commit
f53c36cea2
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -21,7 +22,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/ligne.php
|
||||
* \ingroup compta
|
||||
* \ingroup bank
|
||||
* \brief Page to edit a bank transaction record
|
||||
*/
|
||||
|
||||
@ -33,6 +34,7 @@ $langs->load("categories");
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
if (! empty($conf->adherent->enabled)) $langs->load("members");
|
||||
if (! empty($conf->don->enabled)) $langs->load("donations");
|
||||
|
||||
|
||||
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));
|
||||
@ -350,6 +352,12 @@ if ($result)
|
||||
print img_object($langs->trans('ShowMember'),'user').' ';
|
||||
print $links[$key]['label'];
|
||||
print '</a>';
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_donation') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowDonation'),'payment').' ';
|
||||
print $langs->trans("DonationPayment");
|
||||
print '</a>';
|
||||
}
|
||||
else if ($links[$key]['type']=='banktransfert') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$links[$key]['url_id'].'">';
|
||||
|
||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
@ -128,7 +128,7 @@ if (! empty($type))
|
||||
{
|
||||
$sql.= " AND b.fk_type = '".$db->escape($type)."' ";
|
||||
}
|
||||
//Search period criteria
|
||||
// Search period criteria
|
||||
if (dol_strlen($search_dt_start)>0) {
|
||||
$sql .= " AND b.dateo >= '" . $db->idate($search_dt_start) . "'";
|
||||
}
|
||||
|
||||
@ -104,6 +104,13 @@ class modDon extends DolibarrModules
|
||||
"Message affiché sur le récépissé de versements ou dons",
|
||||
"0"
|
||||
);
|
||||
$this->const[5] = array (
|
||||
"DONATION_ACCOUNTINGACCOUNT",
|
||||
"chaine",
|
||||
"7581",
|
||||
"Compte comptable de remise des versements ou dons",
|
||||
"0"
|
||||
);
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("donations");
|
||||
$langs->load("accountancy");
|
||||
$langs->load('other');
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
@ -114,7 +115,25 @@ else if ($action == 'del')
|
||||
}
|
||||
}
|
||||
|
||||
// Option
|
||||
// Options
|
||||
if ($action == 'set_DONATION_ACCOUNTINGACCOUNT')
|
||||
{
|
||||
$account = GETPOST('DONATION_ACCOUNTINGACCOUNT'); // No alpha here, we want exact string
|
||||
|
||||
$res = dolibarr_set_const($db, "DONATION_ACCOUNTINGACCOUNT",$account,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_DONATION_MESSAGE')
|
||||
{
|
||||
$freemessage = GETPOST('DONATION_MESSAGE'); // No alpha here, we want exact string
|
||||
@ -191,24 +210,42 @@ dol_fiche_head($head, 'general', $langs->trans("Donations"), 0, 'payment');
|
||||
*/
|
||||
print_titre($langs->trans("Options"));
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
|
||||
print '<input type="hidden" name="action" value="set_DONATION_MESSAGE" />';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameters").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
|
||||
//print '<td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
$var=true;
|
||||
|
||||
$var=! $var;
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
|
||||
print '<input type="hidden" name="action" value="set_DONATION_ACCOUNTINGACCOUNT" />';
|
||||
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
$var=! $var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
print '<td width="50%">';
|
||||
$label = $langs->trans(AccountAccounting);
|
||||
print '<label for="'.$langs->trans(AccountAccounting).'">' . $label . '</label></td>';
|
||||
print '<td>';
|
||||
print '<input type="text" size="10" id="DONATION_ACCOUNTINGACCOUNT" name="DONATION_ACCOUNTINGACCOUNT" value="' . $conf->global->DONATION_ACCOUNTINGACCOUNT . '">';
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
|
||||
print '<input type="hidden" name="action" value="set_DONATION_MESSAGE" />';
|
||||
|
||||
$var=! $var;
|
||||
print '<tr '.$bc[$var].'><td colspan="2">';
|
||||
print $langs->trans("FreeTextOnDonations").'<br>';
|
||||
print '<textarea name="DONATION_MESSAGE" class="flat" cols="120">'.$conf->global->DONATION_MESSAGE.'</textarea>';
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ $langs->load('banks');
|
||||
$langs->load('companies');
|
||||
|
||||
// Security check
|
||||
$id=GETPOST("id");
|
||||
$id=GETPOST('rowid')?GETPOST('rowid','int'):GETPOST('id','int');
|
||||
$action=GETPOST("action");
|
||||
$confirm=GETPOST('confirm');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
@ -129,7 +129,7 @@ $h++;
|
||||
dol_fiche_head($head, $hselected, $langs->trans("DonationPayment"), 0, 'payment');
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression du paiement
|
||||
* Confirm deleting of the payment
|
||||
*/
|
||||
if ($action == 'delete')
|
||||
{
|
||||
@ -138,7 +138,7 @@ if ($action == 'delete')
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation de la validation du paiement
|
||||
* Confirm validation of the payment
|
||||
*/
|
||||
if ($action == 'valide')
|
||||
{
|
||||
@ -192,7 +192,7 @@ print '</table>';
|
||||
|
||||
|
||||
/*
|
||||
* List of donations payed
|
||||
* List of donations paid
|
||||
*/
|
||||
|
||||
$disable_delete = 0;
|
||||
@ -262,7 +262,7 @@ print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
* Boutons Actions
|
||||
* Actions buttons
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user