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') {
74 $tax_mode =
GETPOST(
'tax_mode',
'int');
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);
125 dolibarr_set_const($db,
"MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION",
GETPOST(
"deadline_day_vat",
'int'),
'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) {
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
'<table class="noborder centpercent">';
166 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"CompanyIds").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
168 print
'<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans(
"VATIntra").
'</label></td><td>';
169 print
'<input name="tva" id="intra_vat" class="minwidth200" value="'.(!empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA :
'').
'">';
172 print
'<tr class="oddeven"><td><label for="activate_MAIN_INFO_VAT_RETURN">'.$langs->trans(
"VATReturn").
'</label></td>';
173 if (!$conf->use_javascript_ajax) {
174 print
'<td class="nowrap right">';
175 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
178 print
'<td width="120">';
180 '0'=>$langs->trans(
""),
181 '1'=>$langs->trans(
"Monthly"),
182 '2'=>$langs->trans(
"Quarterly"),
183 '3'=>$langs->trans(
"Annual"),
185 print $form->selectarray(
"MAIN_INFO_VAT_RETURN", $listval, $conf->global->MAIN_INFO_VAT_RETURN);
190 print
'<tr class="oddeven"><td><label for="deadline_day_vat">'.$langs->trans(
"DeadlineDayVATSubmission").
'</label></td><td>';
191 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 :
'').
'">';
198 print
'<table class="noborder centpercent">';
201 print
'<tr class="liste_titre">';
202 print
'<td class="titlefield">'.$langs->trans(
'OptionVatMode').
'</td><td>'.$langs->trans(
'Description').
'</td>';
205 print
'<tr class="oddeven"><td><input type="radio" name="tax_mode" value="0"'.(empty($tax_mode) ?
' checked' :
'').
'> '.$langs->trans(
'OptionVATDefault').
'</td>';
206 print
'<td>'.nl2br($langs->trans(
'OptionVatDefaultDesc'));
207 print
"</td></tr>\n";
209 print
'<tr class="oddeven"><td><input type="radio" name="tax_mode" value="1"'.($tax_mode == 1 ?
' checked' :
'').
'> '.$langs->trans(
'OptionVATDebitOption').
'</td>';
210 print
'<td>'.nl2br($langs->trans(
'OptionVatDebitOptionDesc')).
"</td></tr>\n";
212 if ($conf->global->MAIN_FEATURES_LEVEL >= 1) {
213 print
'<tr class="oddeven"><td><input type="radio" name="tax_mode" value="2"'.($tax_mode == 2 ?
' checked' :
'').
'> '.$langs->trans(
'OptionPaymentForProductAndServices').
'</td>';
214 print
'<td>'.nl2br($langs->trans(
'OptionPaymentForProductAndServicesDesc')).
"</td></tr>\n";
219 print
load_fiche_titre(
'',
'',
'', 0, 0,
'',
'-> '.$langs->trans(
"SummaryOfVatExigibilityUsedByDefault"));
223 print
'<table class="noborder centpercent">';
224 print
'<tr class="oddeven"><td class="titlefield"> </td><td>'.$langs->trans(
"Buy").
'</td><td>'.$langs->trans(
"Sell").
'</td></tr>';
227 print
'<tr class="oddeven"><td>'.$langs->trans(
"Product").
'</td>';
230 print $langs->trans(
"OnPayment");
231 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
233 print $langs->trans(
"OnDelivery");
234 print
' ('.$langs->trans(
"SupposedToBeInvoiceDate").
')';
239 print $langs->trans(
"OnPayment");
240 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
242 print $langs->trans(
"OnDelivery");
243 print
' ('.$langs->trans(
"SupposedToBeInvoiceDate").
')';
248 print
'<tr class="oddeven"><td>'.$langs->trans(
"Services").
'</td>';
251 print $langs->trans(
"OnPayment");
252 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
254 print $langs->trans(
"OnInvoice");
255 print
' ('.$langs->trans(
"InvoiceDateUsed").
')';
260 print $langs->trans(
"OnPayment");
261 print
' ('.$langs->trans(
"SupposedToBePaymentDate").
')';
263 print $langs->trans(
"OnInvoice");
264 print
' ('.$langs->trans(
"InvoiceDateUsed").
')';
274print
'<div class="center">';
275print
'<input type="submit" class="button button-edit" name="Button"value="'.$langs->trans(
"Modify").
'">';
284echo
'<table class="noborder centpercent">';
286echo
'<tr class="liste_titre"><th>'.$langs->trans(
'Parameter').
'</th><th>'.$langs->trans(
'Value').
'</th></tr>';
290$key =
'CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT';
291echo
'<tr><td>', $langs->trans($key),
'</td><td>', ajax_constantonoff($key),
'</td></tr>';
298if (isModEnabled(
'accounting')) {
299 $langs->load(
"accountancy");
300 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($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...
getDolGlobalInt($key, $default=0)
Return 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.
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.