diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 1bdf4e75e5d..cc4b7719069 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -264,13 +264,13 @@ if ($id > 0)
// Local Taxes
if ($mysoc->useLocalTax(1))
{
- print '
';
- // Ref
- /*
- print ''.$langs->trans("Ref").' ';
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
- print ' ';
- print " \n";
-
- // Ref supplier
- print ''.$form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statutrights->fournisseur->facture->creer)).' ';
- print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statutrights->fournisseur->facture->creer));
- print ' ';
-
- // Third party
- print ''.$langs->trans('Supplier').' '.$societe->getNomUrl(1,'supplier');
- print ' ('.$langs->trans('OtherBills').' ) ';
- print ' ';
- */
-
// Type
print ''.$langs->trans('Type').' ';
print $object->getLibType();
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index e9896fc61af..71f2ae41536 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -1132,7 +1132,7 @@ else
}
if ($j % 2 == 1) print ' ';
- // Assujeti TVA
+ // Vat is used
print ''.fieldLabel('VATIsUsed','assujtva_value').' ';
print '';
print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation
@@ -1688,14 +1688,64 @@ else
}
if ($j % 2 == 1) print ' ';
- // VAT payers
- print ''.fieldLabel('VATIsUsed','assujtva_value').' ';
+ // VAT is used
+ print ' '.fieldLabel('VATIsUsed','assujtva_value').' ';
print $form->selectyesno('assujtva_value',$object->tva_assuj,1);
print ' ';
+ // Local Taxes
+ //TODO: Place into a function to control showing by country or study better option
+ if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
+ {
+ print ''.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').' ';
+ print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
+ if(! isOnlyOneLocalTax(1))
+ {
+ print ' '.$langs->transcountry("Type",$mysoc->country_code).': ';
+ $formcompany->select_localtax(1,$object->localtax1_value, "lt1");
+ print ' ';
+ }
+
+ print ' '.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').' ';
+ print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
+ if (! isOnlyOneLocalTax(2))
+ {
+ print ' '.$langs->transcountry("Type",$mysoc->country_code).': ';
+ $formcompany->select_localtax(2,$object->localtax2_value, "lt2");
+ print ' ';
+ }
+ print ' ';
+
+ }
+ elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
+ {
+ print ''.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').' ';
+ print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
+ if(! isOnlyOneLocalTax(1))
+ {
+ print ' '.$langs->transcountry("Type",$mysoc->country_code).': ';
+ $formcompany->select_localtax(1,$object->localtax1_value, "lt1");
+ print ' ';
+ }
+ print ' ';
+
+ }
+ elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
+ {
+ print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').' ';
+ print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
+ if(! isOnlyOneLocalTax(2))
+ {
+ print ' '.$langs->transcountry("Type",$mysoc->country_code).': ';
+ $formcompany->select_localtax(2,$object->localtax2_value, "lt2");
+ print ' ';
+ }
+ print ' ';
+ }
+
// VAT Code
print ''.fieldLabel('VATIntra','intra_vat').' ';
- print '';
+ print ' ';
$s =' ';
if (empty($conf->global->MAIN_DISABLEVATCHECK))
@@ -1723,56 +1773,6 @@ else
print ' ';
print '';
- // Local Taxes
- //TODO: Place into a function to control showing by country or study better option
- if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
- {
- print ''.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').' ';
- print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
- if(! isOnlyOneLocalTax(1))
- {
- print ' '.$langs->transcountry("Type",$mysoc->country_code).': ';
- $formcompany->select_localtax(1,$object->localtax1_value, "lt1");
- print ' ';
- }
-
- print ' '.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').' ';
- print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
- if (! isOnlyOneLocalTax(2))
- {
- print ' '.$langs->transcountry("Type",$mysoc->country_code).': ';
- $formcompany->select_localtax(2,$object->localtax2_value, "lt2");
- print ' ';
- }
- print ' ';
-
- }
- elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
- {
- print ''.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').' ';
- print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
- if(! isOnlyOneLocalTax(1))
- {
- print ' '.$langs->transcountry("Type",$mysoc->country_code).': ';
- $formcompany->select_localtax(1,$object->localtax1_value, "lt1");
- print ' ';
- }
- print ' ';
-
- }
- elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
- {
- print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').' ';
- print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
- if(! isOnlyOneLocalTax(2))
- {
- print ' '.$langs->transcountry("Type",$mysoc->country_code).': ';
- $formcompany->select_localtax(2,$object->localtax2_value, "lt2");
- print ' ';
- }
- print ' ';
- }
-
// Type - Size
print ''.fieldLabel('ThirdPartyType','typent_id').' ';
print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
@@ -2027,7 +2027,7 @@ else
}
//if ($j % 2 == 1) print ' ';
- // VAT payers
+ // VAT is used
print '';
print $langs->trans('VATIsUsed');
print ' ';
@@ -2035,6 +2035,104 @@ else
print ' ';
print ' ';
+ // Local Taxes
+ //TODO: Place into a function to control showing by country or study better option
+ if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
+ {
+ print ''.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).' ';
+ print yn($object->localtax1_assuj);
+ print ' '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).' ';
+ print yn($object->localtax2_assuj);
+ print ' ';
+
+ if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
+ {
+ print '';
+ }
+ if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
+ {
+ print '';
+ }
+ }
+ elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
+ {
+ print ''.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).' ';
+ print yn($object->localtax1_assuj);
+ print ' ';
+ if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
+ {
+ print '';
+
+ }
+ }
+ elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
+ {
+ print ''.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).' ';
+ print yn($object->localtax2_assuj);
+ print ' ';
+ if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
+ {
+
+ print '';
+
+ }
+ }
+ /*
+ if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1)
+ {
+ print ''.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).' ';
+ print yn($object->localtax2_assuj);
+ print ' ';
+ }
+ */
+
// VAT Code
print ' ';
print ''.$langs->trans('VATIntra').' ';
@@ -2074,103 +2172,6 @@ else
print ' ';
print ' ';
- // Local Taxes
- //TODO: Place into a function to control showing by country or study better option
- if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
- {
- print ''.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).' ';
- print yn($object->localtax1_assuj);
- print ' '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).' ';
- print yn($object->localtax2_assuj);
- print ' ';
-
- if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
- {
- print '';
- }
- if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
- {
- print '';
- }
- }
- elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
- {
- print ''.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).' ';
- print yn($object->localtax1_assuj);
- print ' ';
- if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
- {
- print '';
-
- }
- }
- elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
- {
- print ' '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).' ';
- print yn($object->localtax2_assuj);
- print ' ';
- if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
- {
-
- print '';
-
- }
- }
-/*
- if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1)
- {
- print ' '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).' ';
- print yn($object->localtax2_assuj);
- print ' ';
- }
-*/
// Type + Staff
$arr = $formcompany->typent_array(1);
$object->typent= $arr[$object->typent_code];
@@ -2185,6 +2186,26 @@ else
print '
';
print '';
+ // Tags / categories
+ if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
+ {
+ // Customer
+ if ($object->prospect || $object->client) {
+ print '' . $langs->trans("CustomersCategoriesShort") . ' ';
+ print '';
+ print $form->showCategories($object->id, 'customer', 1);
+ print " ";
+ }
+
+ // Supplier
+ if ($object->fournisseur) {
+ print '' . $langs->trans("SuppliersCategoriesShort") . ' ';
+ print '';
+ print $form->showCategories($object->id, 'supplier', 1);
+ print " ";
+ }
+ }
+
// Legal
print ''.$langs->trans('JuridicalStatus').' '.$object->forme_juridique.' ';
@@ -2207,26 +2228,6 @@ else
print '';
}
- // Tags / categories
- if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
- {
- // Customer
- if ($object->prospect || $object->client) {
- print '' . $langs->trans("CustomersCategoriesShort") . ' ';
- print '';
- print $form->showCategories($object->id, 'customer', 1);
- print " ";
- }
-
- // Supplier
- if ($object->fournisseur) {
- print '' . $langs->trans("SuppliersCategoriesShort") . ' ';
- print '';
- print $form->showCategories($object->id, 'supplier', 1);
- print " ";
- }
- }
-
// Incoterms
if (!empty($conf->incoterm->enabled))
{