30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32if (isModEnabled(
'accounting')) {
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
37$langs->loadLangs(array(
'admin',
'objects',
'companies',
'products'));
43$action =
GETPOST(
'action',
'aZ09');
70if ($action ==
'update') {
85 $valuesellproduct =
'invoice';
86 $valuebuyproduct =
'invoice';
87 $valuesellservice =
'payment';
88 $valuebuyservice =
'payment';
91 $valuesellproduct =
'invoice';
92 $valuebuyproduct =
'invoice';
93 $valuesellservice =
'invoice';
94 $valuebuyservice =
'invoice';
97 $valuesellproduct =
'payment';
98 $valuebuyproduct =
'payment';
99 $valuesellservice =
'payment';
100 $valuebuyservice =
'payment';
104 $res =
dolibarr_set_const($db,
'TAX_MODE_SELL_PRODUCT', $valuesellproduct,
'chaine', 0,
'', $conf->entity);
108 $res =
dolibarr_set_const($db,
'TAX_MODE_BUY_PRODUCT', $valuebuyproduct,
'chaine', 0,
'', $conf->entity);
112 $res =
dolibarr_set_const($db,
'TAX_MODE_SELL_SERVICE', $valuesellservice,
'chaine', 0,
'', $conf->entity);
116 $res =
dolibarr_set_const($db,
'TAX_MODE_BUY_SERVICE', $valuebuyservice,
'chaine', 0,
'', $conf->entity);
123 dolibarr_set_const($db,
"MAIN_INFO_VAT_RETURN",
GETPOST(
"MAIN_INFO_VAT_RETURN",
'alpha'),
'chaine', 0,
'', $conf->entity);
134} elseif (preg_match(
'/^(set|del)_?([A-Z_]+)$/', $action, $reg)) {
136 if (!
dolibarr_set_const($db, $reg[2], ($reg[1] ===
'set' ?
'1' :
'0'),
'chaine', 0,
'', $conf->entity) > 0) {
146llxHeader(
'', $langs->trans(
"TaxSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-taxes');
148$form =
new Form($db);
149if (isModEnabled(
'accounting')) {
153$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
158if (empty($mysoc->tva_assuj)) {
159 print $langs->trans(
"YourCompanyDoesNotUseVAT").
'<br>';
161 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
162 print
'<input type="hidden" name="token" value="'.newToken().
'">';
163 print
'<input type="hidden" name="action" value="update">';
165 print
'<div class="div-table-responsive-no-min">';
166 print
'<table class="noborder centpercent">';
167 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
169 print
'<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans(
"VATIntra").
'</label></td><td>';
170 print
'<input name="tva" id="intra_vat" class="minwidth200" value="'.(getDolGlobalString(
'MAIN_INFO_TVAINTRA') ? $conf->global->MAIN_INFO_TVAINTRA :
'').
'">';
173 print
'<tr class="oddeven"><td><label for="activate_MAIN_INFO_VAT_RETURN">'.$langs->trans(
"VATPaymentFrequency").
'</label></td>';
174 if (!$conf->use_javascript_ajax) {
175 print
'<td class="nowrap right">';
176 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
179 print
'<td width="120">';
181 '0'=>$langs->trans(
""),
182 '1'=>$langs->trans(
"Monthly"),
183 '2'=>$langs->trans(
"Quarterly"),
184 '3'=>$langs->trans(
"Annual"),
186 print $form->selectarray(
"MAIN_INFO_VAT_RETURN", $listval,
getDolGlobalString(
'MAIN_INFO_VAT_RETURN'));
191 print
'<tr class="oddeven"><td><label for="deadline_day_vat">'.$langs->trans(
"DeadlineDayVATSubmission").
'</label></td><td>';
192 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 :
'').
'">';
195 $key =
'CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT';
196 print
'<tr><td>'.$langs->trans($key).
'</td><td>'.ajax_constantonoff($key).
'</td></tr>';
204 print
'<div class="div-table-responsive-no-min">';
205 print
'<table class="noborder centpercent">';
208 print
'<tr class="liste_titre">';
209 print
'<td class="titlefield">'.$langs->trans(
'OptionVatMode').
'</td><td>'.$langs->trans(
'Description').
'</td>';
212 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>';
213 print
'<td>'.nl2br($langs->trans(
'OptionVatDefaultDesc'));
214 print
"</td></tr>\n";
216 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>';
217 print
'<td>'.nl2br($langs->trans(
'OptionVatDebitOptionDesc')).
"</td></tr>\n";
220 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>';
221 print
'<td>'.nl2br($langs->trans(
'OptionPaymentForProductAndServicesDesc')).
"</td></tr>\n";
228 print
load_fiche_titre(
'',
'',
'', 0, 0,
'',
'-> '.$langs->trans(
"SummaryOfVatExigibilityUsedByDefault"));
232 print
'<div class="div-table-responsive-no-min">';
233 print
'<table class="noborder centpercent">';
234 print
'<tr class="oddeven"><td class="titlefield"> </td><td>'.$langs->trans(
"Buy").
'</td><td>'.$langs->trans(
"Sell").
'</td></tr>';
237 print
'<tr class="oddeven"><td>'.$langs->trans(
"Product").
'</td>';
240 print $langs->trans(
"OnPayment");
241 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
243 print $langs->trans(
"OnDelivery");
244 print
' ('.$langs->trans(
"SupposedToBeInvoiceDate").
')';
249 print $langs->trans(
"OnPayment");
250 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
252 print $langs->trans(
"OnDelivery");
253 print
' ('.$langs->trans(
"SupposedToBeInvoiceDate").
')';
258 print
'<tr class="oddeven"><td>'.$langs->trans(
"Services").
'</td>';
261 print $langs->trans(
"OnPayment");
262 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
264 print $langs->trans(
"OnInvoice");
265 print
' ('.$langs->trans(
"InvoiceDateUsed").
')';
270 print $langs->trans(
"OnPayment");
271 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
273 print $langs->trans(
"OnInvoice");
274 print
' ('.$langs->trans(
"InvoiceDateUsed").
')';
285print
'<div class="center">';
286print
'<input type="submit" class="button button-edit" name="Button"value="'.$langs->trans(
"Modify").
'">';
295if (isModEnabled(
'accounting')) {
296 $langs->load(
"accountancy");
297 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()
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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 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.