diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index ac9fa10ff12..69fa076c584 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Alexandre Spangaro * * 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 ''; + } + else if ($links[$key]['type']=='payment_donation') { + print ''; + print img_object($langs->trans('ShowDonation'),'payment').' '; + print $langs->trans("DonationPayment"); + print ''; } else if ($links[$key]['type']=='banktransfert') { print ''; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 534a9bb0e95..a1e114430ce 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -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) . "'"; } diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 8c7425ceed2..e25bd6d3bf9 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -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(); diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index af00f2dbbcc..bd4683ec3c7 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -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 '
'; -print ''; -print ''; print ''; print ''; -print ''; -print ''; +print ''; +//print ''; print "\n"; $var=true; -$var=! $var; +print ''; +print ''; +print ''; -print ''; + +print ''; +print '\n"; +print ''; + +print ''; +print ''; +print ''; + +$var=! $var; +print '\n"; + print "
'.$langs->trans("Parameters").' '.$langs->trans("Parameters").' 
'; +$var=! $var; +print '
'; +$label = $langs->trans(AccountAccounting); +print ''; +print ''; +print ''; +print ''; +print "
'; print $langs->trans("FreeTextOnDonations").'
'; print ''; print '
'; print ''; print "
\n"; print ''; diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 4c59f566ba5..3abff69a624 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -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 ''; /* - * List of donations payed + * List of donations paid */ $disable_delete = 0; @@ -262,7 +262,7 @@ print ''; /* - * Boutons Actions + * Actions buttons */ print '
';