* * 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 ''; print ''."\n"; print ''."\n"; print ''; $var=true; $form = new Form($db); print ''; // COMMISSION BASE (TURNOVER / MARGIN) $var=!$var; print ''; print ''; print ''; print ''; print ''; // PRODUCT COMMISSION RATE $var=!$var; print ''; print ''; print ''; print ''; print ''; // SERVICE COMMISSION RATE $var=!$var; print ''; print ''; print ''; print ''; print ''; $var=!$var; print ''; print ''; print ''; print '
'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Details").'
'.$langs->trans("CommissionBase").''; print 'global->COMMISSION_BASE) && $conf->global->COMMISSION_BASE == "TURNOVER") print 'checked'; print ' />'; print $langs->trans("CommissionBasedOnTurnover"); print '
'; print 'margin->enabled)) print 'disabled'; elseif (isset($conf->global->COMMISSION_BASE) && $conf->global->COMMISSION_BASE == "MARGIN") print 'checked'; print ' />'; print $langs->trans("CommissionBasedOnMargins"); print '
'.$langs->trans('CommissionBaseDetails'); print '
'; print $langs->trans('CommissionBasedOnMarginsDetails'); print '
'.$langs->trans("ProductCommissionRate").''; print '  %'; print ''.$langs->trans('ProductCommissionRateDetails').'
'.$langs->trans("ServiceCommissionRate").''; print '  %'; print ''.$langs->trans('ServiceCommissionRateDetails').'
'; print ''; print '
'; print '
'; print ''; llxFooter(); $db->close(); ?>