29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
36 $langs->loadLangs(array(
'admin',
'objects',
'companies',
'products'));
42 $action =
GETPOST(
'action',
'aZ09');
62 $tax_mode = empty($conf->global->TAX_MODE) ? 0 : $conf->global->TAX_MODE;
64 if ($action ==
'update') {
68 $tax_mode =
GETPOST(
'tax_mode',
'alpha');
79 $valuesellproduct =
'invoice';
80 $valuebuyproduct =
'invoice';
81 $valuesellservice =
'payment';
82 $valuebuyservice =
'payment';
85 $valuesellproduct =
'invoice';
86 $valuebuyproduct =
'invoice';
87 $valuesellservice =
'invoice';
88 $valuebuyservice =
'invoice';
91 $valuesellproduct =
'payment';
92 $valuebuyproduct =
'payment';
93 $valuesellservice =
'payment';
94 $valuebuyservice =
'payment';
98 $res =
dolibarr_set_const($db,
'TAX_MODE_SELL_PRODUCT', $valuesellproduct,
'chaine', 0,
'', $conf->entity);
102 $res =
dolibarr_set_const($db,
'TAX_MODE_BUY_PRODUCT', $valuebuyproduct,
'chaine', 0,
'', $conf->entity);
106 $res =
dolibarr_set_const($db,
'TAX_MODE_SELL_SERVICE', $valuesellservice,
'chaine', 0,
'', $conf->entity);
110 $res =
dolibarr_set_const($db,
'TAX_MODE_BUY_SERVICE', $valuebuyservice,
'chaine', 0,
'', $conf->entity);
117 dolibarr_set_const($db,
"MAIN_INFO_VAT_RETURN",
GETPOST(
"MAIN_INFO_VAT_RETURN",
'alpha'),
'chaine', 0,
'', $conf->entity);
119 dolibarr_set_const($db,
"MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION",
GETPOST(
"deadline_day_vat",
'int'),
'chaine', 0,
'', $conf->entity);
128 } elseif (preg_match(
'/^(set|del)_?([A-Z_]+)$/', $action, $reg)) {
130 if (!
dolibarr_set_const($db, $reg[2], ($reg[1] ===
'set' ?
'1' :
'0'),
'chaine', 0,
'', $conf->entity) > 0) {
140 llxHeader(
'', $langs->trans(
"TaxSetup"));
147 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
148 print
load_fiche_titre($langs->trans(
'TaxSetup'), $linkback,
'title_setup');
152 if (empty($mysoc->tva_assuj)) {
153 print $langs->trans(
"YourCompanyDoesNotUseVAT").
'<br>';
155 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
156 print
'<input type="hidden" name="token" value="'.newToken().
'">';
157 print
'<input type="hidden" name="action" value="update">';
159 print
'<table class="noborder centpercent">';
160 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"CompanyIds").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
162 print
'<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans(
"VATIntra").
'</label></td><td>';
163 print
'<input name="tva" id="intra_vat" class="minwidth200" value="'.(!empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA :
'').
'">';
166 print
'<tr class="oddeven"><td><label for="activate_MAIN_INFO_VAT_RETURN">'.$langs->trans(
"VATReturn").
'</label></td>';
167 if (!$conf->use_javascript_ajax) {
168 print
'<td class="nowrap right">';
169 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
172 print
'<td width="120">';
174 '0'=>$langs->trans(
""),
175 '1'=>$langs->trans(
"Monthly"),
176 '2'=>$langs->trans(
"Quarterly"),
177 '3'=>$langs->trans(
"Annual"),
179 print
$form->selectarray(
"MAIN_INFO_VAT_RETURN", $listval, $conf->global->MAIN_INFO_VAT_RETURN);
184 print
'<tr class="oddeven"><td><label for="deadline_day_vat">'.$langs->trans(
"DeadlineDayVATSubmission").
'</label></td><td>';
185 print
'<input placeholder="'.$langs->trans(
"Example").
':21" name="deadline_day_vat" id="deadline_day_vat" class="minwidth200" value="'.(!empty($conf->global->MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION) ? $conf->global->MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION :
'').
'">';
192 print
'<table class="noborder centpercent">';
195 print
'<tr class="liste_titre">';
196 print
'<td class="titlefield">'.$langs->trans(
'OptionVatMode').
'</td><td>'.$langs->trans(
'Description').
'</td>';
199 print
'<tr class="oddeven"><td><input type="radio" name="tax_mode" value="0"'.(empty($tax_mode) ?
' checked' :
'').
'> '.$langs->trans(
'OptionVATDefault').
'</td>';
200 print
'<td>'.nl2br($langs->trans(
'OptionVatDefaultDesc'));
201 print
"</td></tr>\n";
203 print
'<tr class="oddeven"><td><input type="radio" name="tax_mode" value="1"'.($tax_mode == 1 ?
' checked' :
'').
'> '.$langs->trans(
'OptionVATDebitOption').
'</td>';
204 print
'<td>'.nl2br($langs->trans(
'OptionVatDebitOptionDesc')).
"</td></tr>\n";
206 if ($conf->global->MAIN_FEATURES_LEVEL >= 1) {
207 print
'<tr class="oddeven"><td><input type="radio" name="tax_mode" value="2"'.($tax_mode == 2 ?
' checked' :
'').
'> '.$langs->trans(
'OptionPaymentForProductAndServices').
'</td>';
208 print
'<td>'.nl2br($langs->trans(
'OptionPaymentForProductAndServicesDesc')).
"</td></tr>\n";
213 print
load_fiche_titre(
'',
'',
'', 0, 0,
'',
'-> '.$langs->trans(
"SummaryOfVatExigibilityUsedByDefault"));
217 print
'<table class="noborder centpercent">';
218 print
'<tr class="oddeven"><td class="titlefield"> </td><td>'.$langs->trans(
"Buy").
'</td><td>'.$langs->trans(
"Sell").
'</td></tr>';
221 print
'<tr class="oddeven"><td>'.$langs->trans(
"Product").
'</td>';
223 if ($conf->global->TAX_MODE_BUY_PRODUCT ==
'payment') {
224 print $langs->trans(
"OnPayment");
225 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
227 print $langs->trans(
"OnDelivery");
228 print
' ('.$langs->trans(
"SupposedToBeInvoiceDate").
')';
232 if ($conf->global->TAX_MODE_SELL_PRODUCT ==
'payment') {
233 print $langs->trans(
"OnPayment");
234 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
236 print $langs->trans(
"OnDelivery");
237 print
' ('.$langs->trans(
"SupposedToBeInvoiceDate").
')';
242 print
'<tr class="oddeven"><td>'.$langs->trans(
"Services").
'</td>';
244 if ($conf->global->TAX_MODE_BUY_SERVICE ==
'payment') {
245 print $langs->trans(
"OnPayment");
246 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
248 print $langs->trans(
"OnInvoice");
249 print
' ('.$langs->trans(
"InvoiceDateUsed").
')';
253 if ($conf->global->TAX_MODE_SELL_SERVICE ==
'payment') {
254 print $langs->trans(
"OnPayment");
255 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
257 print $langs->trans(
"OnInvoice");
258 print
' ('.$langs->trans(
"InvoiceDateUsed").
')';
268 print
'<div class="center">';
269 print
'<input type="submit" class="button button-edit" name="Button"value="'.$langs->trans(
"Modify").
'">';
278 echo
'<table class="noborder centpercent">';
280 echo
'<tr class="liste_titre"><th>'.$langs->trans(
'Parameter').
'</th><th>'.$langs->trans(
'Value').
'</th></tr>';
284 $key =
'CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT';
285 echo
'<tr><td>', $langs->trans($key),
'</td><td>',
ajax_constantonoff($key),
'</td></tr>';
293 $langs->load(
"accountancy");
294 print
'<br><br><span class="opacitymedium">'.$langs->trans(
"AccountingAccountForSalesTaxAreDefinedInto", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup")).
'</span>';
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='')
On/off button for constant.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.