*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
/**
* \file /htdocs/admin/commissions.php
* \ingroup commissions
* \brief Page to setup advanced commissions module
*/
include("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/commissions/lib/commissions.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
$langs->load("admin");
$langs->load("commissions");
if (! $user->admin) accessforbidden();
/*
* Action
*/
if (GETPOST('commissionBase'))
{
if (dolibarr_set_const($db, 'COMMISSION_BASE', GETPOST('commissionBase'), 'string', 0, '', $conf->entity) > 0)
{
$conf->global->COMMISSION_BASE = GETPOST('commissionBase');
}
else
{
dol_print_error($db);
}
}
if (GETPOST('productCommissionRate'))
{
if (dolibarr_set_const($db, 'PRODUCT_COMMISSION_RATE', GETPOST('productCommissionRate'), 'rate', 0, '', $conf->entity) > 0)
{
}
else
{
dol_print_error($db);
}
}
if (GETPOST('serviceCommissionRate'))
{
if (dolibarr_set_const($db, 'SERVICE_COMMISSION_RATE', GETPOST('serviceCommissionRate'), 'rate', 0, '', $conf->entity) > 0)
{
}
else
{
dol_print_error($db);
}
}
/*
* View
*/
llxHeader('',$langs->trans("CommissionsSetup"));
$linkback=''.$langs->trans("BackToModuleList").'';
print_fiche_titre($langs->trans("commissionsSetup"),$linkback,'setup');
$head = commissions_admin_prepare_head();
dol_fiche_head($head, 'parameters', $langs->trans("Commissions"), 0, 'commissions');
print "
";
print_fiche_titre($langs->trans("MemberMainOptions"),'','');
print '
';
print '';
print '| '.$langs->trans("Description").' | ';
print ''.$langs->trans("Value").' | '."\n";
print ''.$langs->trans("Details").' | '."\n";
print '
';
$var=true;
$form = new Form($db);
print '
';
print '
';
print '';
llxFooter();
$db->close();
?>