32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
34if (isModEnabled(
'accounting')) {
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
39$langs->loadLangs(array(
'admin',
'objects',
'companies',
'products'));
45$action =
GETPOST(
'action',
'aZ09');
72if ($action ==
'update') {
87 $valuesellproduct =
'invoice';
88 $valuebuyproduct =
'invoice';
89 $valuesellservice =
'payment';
90 $valuebuyservice =
'payment';
93 $valuesellproduct =
'invoice';
94 $valuebuyproduct =
'invoice';
95 $valuesellservice =
'invoice';
96 $valuebuyservice =
'invoice';
99 $valuesellproduct =
'payment';
100 $valuebuyproduct =
'payment';
101 $valuesellservice =
'payment';
102 $valuebuyservice =
'payment';
105 $valuesellproduct =
null;
106 $valuebuyproduct =
null;
107 $valuesellservice =
null;
108 $valuebuyservice =
null;
112 $res =
dolibarr_set_const($db,
'TAX_MODE_SELL_PRODUCT', $valuesellproduct,
'chaine', 0,
'', $conf->entity);
116 $res =
dolibarr_set_const($db,
'TAX_MODE_BUY_PRODUCT', $valuebuyproduct,
'chaine', 0,
'', $conf->entity);
120 $res =
dolibarr_set_const($db,
'TAX_MODE_SELL_SERVICE', $valuesellservice,
'chaine', 0,
'', $conf->entity);
124 $res =
dolibarr_set_const($db,
'TAX_MODE_BUY_SERVICE', $valuebuyservice,
'chaine', 0,
'', $conf->entity);
131 dolibarr_set_const($db,
"MAIN_INFO_VAT_RETURN",
GETPOST(
"MAIN_INFO_VAT_RETURN",
'alpha'),
'chaine', 0,
'', $conf->entity);
142} elseif (preg_match(
'/^(set|del)_?([A-Z_]+)$/', $action, $reg)) {
144 if (!
dolibarr_set_const($db, $reg[2], ($reg[1] ===
'set' ?
'1' :
'0'),
'chaine', 0,
'', $conf->entity) > 0) {
154llxHeader(
'', $langs->trans(
"TaxSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-taxes');
156$form =
new Form($db);
157if (isModEnabled(
'accounting')) {
161$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
166if (empty($mysoc->tva_assuj)) {
167 print $langs->trans(
"YourCompanyDoesNotUseVAT").
'<br>';
169 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
170 print
'<input type="hidden" name="token" value="'.newToken().
'">';
171 print
'<input type="hidden" name="action" value="update">';
173 print
'<div class="div-table-responsive-no-min">';
174 print
'<table class="noborder centpercent">';
175 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
177 print
'<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans(
"VATIntra").
'</label></td><td>';
178 print
'<input name="tva" id="intra_vat" class="minwidth200" value="'.getDolGlobalString(
'MAIN_INFO_TVAINTRA').
'">';
181 print
'<tr class="oddeven"><td><label for="activate_MAIN_INFO_VAT_RETURN">'.$langs->trans(
"VATPaymentFrequency").
'</label></td>';
182 if (!$conf->use_javascript_ajax) {
183 print
'<td class="nowrap right">';
184 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
187 print
'<td width="120">';
189 '0' => $langs->trans(
""),
190 '1' => $langs->trans(
"Monthly"),
191 '2' => $langs->trans(
"Quarterly"),
192 '3' => $langs->trans(
"Annual"),
194 print $form->selectarray(
"MAIN_INFO_VAT_RETURN", $listval,
getDolGlobalString(
'MAIN_INFO_VAT_RETURN'));
199 print
'<tr class="oddeven"><td><label for="deadline_day_vat">'.$langs->trans(
"DeadlineDayVATSubmission").
'</label></td><td>';
200 print
'<input placeholder="'.$langs->trans(
"Example").
':21" name="deadline_day_vat" id="deadline_day_vat" class="minwidth200" value="'.(
getDolGlobalString(
'MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION') ? $conf->global->MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION :
'').
'">';
203 $key =
'CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT';
204 print
'<tr><td>'.$langs->trans($key).
'</td><td>'.ajax_constantonoff($key).
'</td></tr>';
212 print
'<div class="div-table-responsive-no-min">';
213 print
'<table class="noborder centpercent">';
216 print
'<tr class="liste_titre">';
217 print
'<td class="titlefield">'.$langs->trans(
'OptionVatMode').
'</td><td>'.$langs->trans(
'Description').
'</td>';
220 print
'<tr class="oddeven"><td><input type="radio" id="tax_mode0" name="tax_mode" value="0"'.(empty($tax_mode) ?
' checked' :
'').
'> <label for="tax_mode0">'.$langs->trans(
'OptionVATDefault').
'</label></td>';
221 print
'<td>'.nl2br($langs->trans(
'OptionVatDefaultDesc'));
222 print
"</td></tr>\n";
224 print
'<tr class="oddeven"><td><input type="radio" id="tax_mode1" name="tax_mode" value="1"'.($tax_mode == 1 ?
' checked' :
'').
'> <label for="tax_mode1">'.$langs->trans(
'OptionVATDebitOption').
'</label></td>';
225 print
'<td>'.nl2br($langs->trans(
'OptionVatDebitOptionDesc')).
"</td></tr>\n";
228 print
'<tr class="oddeven"><td><input type="radio" id="tax_mode2" name="tax_mode" value="2"'.($tax_mode == 2 ?
' checked' :
'').
'> <label for="tax_mode2">'.$langs->trans(
'OptionPaymentForProductAndServices').
'</label></td>';
229 print
'<td>'.nl2br($langs->trans(
'OptionPaymentForProductAndServicesDesc')).
"</td></tr>\n";
236 print
load_fiche_titre(
'',
'',
'', 0,
'',
'',
'-> '.$langs->trans(
"SummaryOfVatExigibilityUsedByDefault"));
240 print
'<div class="div-table-responsive-no-min">';
241 print
'<table class="noborder centpercent">';
242 print
'<tr class="oddeven"><td class="titlefield"> </td><td>'.$langs->trans(
"Buy").
'</td><td>'.$langs->trans(
"Sell").
'</td></tr>';
245 print
'<tr class="oddeven"><td>'.$langs->trans(
"Product").
'</td>';
248 print $langs->trans(
"OnPayment");
249 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
251 print $langs->trans(
"OnDelivery");
252 print
' ('.$langs->trans(
"SupposedToBeInvoiceDate").
')';
257 print $langs->trans(
"OnPayment");
258 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
260 print $langs->trans(
"OnDelivery");
261 print
' ('.$langs->trans(
"SupposedToBeInvoiceDate").
')';
266 print
'<tr class="oddeven"><td>'.$langs->trans(
"Services").
'</td>';
269 print $langs->trans(
"OnPayment");
270 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
272 print $langs->trans(
"OnInvoice");
273 print
' ('.$langs->trans(
"InvoiceDateUsed").
')';
278 print $langs->trans(
"OnPayment");
279 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
281 print $langs->trans(
"OnInvoice");
282 print
' ('.$langs->trans(
"InvoiceDateUsed").
')';
293print
'<div class="center">';
294print
'<input type="submit" class="button button-edit" name="Button"value="'.$langs->trans(
"Modify").
'">';
303if (isModEnabled(
'accounting')) {
304 $langs->load(
"accountancy");
305 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).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.