diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 222cc292ace..a66313e6294 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -41,7 +41,7 @@ $action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'admincompany'; // To manage different context of search
// Load translation files required by the page
-$langs->loadLangs(array('admin', 'companies'));
+$langs->loadLangs(array('admin', 'companies', 'bills'));
if (!$user->admin) accessforbidden();
@@ -689,17 +689,19 @@ print '
'.$langs-
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').' ';
print "";
-
-
-// Fiscal options
print ' ';
+
+
+// Sales taxes (VAT, IRPF, ...)
+print load_fiche_titre($langs->trans("TypeOfSaleTaxes"));
+
print '";
-/*
- * Local Taxes
- */
+// Second tax
+print ' ';
+print '';
+print '';
+print ''.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).' '.$langs->trans("Description").' ';
+print ' ';
+print " \n";
+
if ($mysoc->useLocalTax(1))
{
- // Local Tax 1
- print ' ';
- print '";
+} else {
+ if (empty($mysoc->country_code))
+ {
+ print ''.$countrynotdefined.' ';
+ } else {
+ print ''.$langs->trans("NoLocalTaxXForThisCountry" , $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax1Management")).' ';
+ }
}
+
+print "
";
+
+// Third tax system
+print ' ';
+print '';
+print '';
+print ''.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).' '.$langs->trans("Description").' ';
+print ' ';
+print " \n";
+
if ($mysoc->useLocalTax(2))
{
- // Local Tax 2
- print ' ';
- print '";
+} else {
+ if (empty($mysoc->country_code))
+ {
+ print ''.$countrynotdefined.' ';
+ } else {
+ print ''.$langs->trans("NoLocalTaxXForThisCountry" , $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax2Management")).' ';
+ }
}
+print "
";
+
+
+// Third tax system
+print ' ';
+print '';
+print '';
+print ''.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).' '.$langs->trans("Description").' ';
+print ' ';
+print " \n";
+if ($mysoc->useRevenueStamp())
+{
+ // Note: When option is not set, it must not appears as set on on, because there is no default value for this option
+ print "";
+ print $langs->trans("UseRevenueStamp");
+ print " ";
+ print '';
+ print $langs->trans("UseRevenueStampExample", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"));
+ print " \n";
+} else {
+ if (empty($mysoc->country_code))
+ {
+ print ''.$countrynotdefined.' ';
+ } else {
+ print ''.$langs->trans("NoLocalTaxXForThisCountry" , $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"), $langs->transnoentitiesnoconv("RevenueStamp")).' ';
+ }
+}
+
+print "
";
+
print '';
print ' ';
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 75fae3c7a86..b687ec02656 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -489,7 +489,7 @@ $tabhelp[19] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[20] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[21] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[22] = array('code'=>$langs->trans("EnterAnyCode"));
-$tabhelp[23] = array('revenuestamp_type'=>'FixedOfPercent');
+$tabhelp[23] = array('revenuestamp_type'=>'FixedOrPercent');
$tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 55b16368469..19a4022a9a4 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -413,7 +413,9 @@ if (empty($reshook))
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date;
$result = $object->update($user);
- if ($result < 0) dol_print_error($db, $object->error);
+ if ($result < 0) {
+ dol_print_error($db, $object->error);
+ }
}
elseif ($action == 'setdate_pointoftax' && $usercancreate)
@@ -422,7 +424,9 @@ if (empty($reshook))
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
$object->date_pointoftax = $date_pointoftax;
$result = $object->update($user);
- if ($result < 0) dol_print_error($db, $object->error);
+ if ($result < 0) {
+ dol_print_error($db, $object->error);
+ }
}
elseif ($action == 'setconditions' && $usercancreate)
@@ -438,7 +442,9 @@ if (empty($reshook))
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date;
$result = $object->update($user);
- if ($result < 0) dol_print_error($db, $object->error);
+ if ($result < 0) {
+ dol_print_error($db, $object->error);
+ }
}
elseif ($action == 'setpaymentterm' && $usercancreate)
@@ -450,8 +456,9 @@ if (empty($reshook))
setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings');
}
$result = $object->update($user);
- if ($result < 0)
+ if ($result < 0) {
dol_print_error($db, $object->error);
+ }
}
elseif ($action == 'setrevenuestamp' && $usercancreate)
@@ -460,8 +467,28 @@ if (empty($reshook))
$object->revenuestamp = GETPOST('revenuestamp');
$result = $object->update($user);
$object->update_price(1);
- if ($result < 0)
+ if ($result < 0) {
dol_print_error($db, $object->error);
+ } else {
+ // Define output language
+ if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
+ {
+ $outputlangs = $langs;
+ $newlang = '';
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
+ if (!empty($newlang)) {
+ $outputlangs = new Translate("", $conf);
+ $outputlangs->setDefaultLang($newlang);
+ $outputlangs->load('products');
+ }
+ $model = $object->modelpdf;
+ $ret = $object->fetch($id); // Reload to get new records
+
+ $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
+ }
+ }
}
// Set incoterm
@@ -4480,7 +4507,7 @@ elseif ($id > 0 || !empty($ref))
print ' ';
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
print ' → ';
- print ' ';
+ print ' ';
print '';
print "