Migrate spain to localtax type.
This commit is contained in:
parent
b724a78cb3
commit
df3227ef7e
@ -722,7 +722,7 @@ if ($id)
|
|||||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||||
$valuetoshow=$langs->trans("Country");
|
$valuetoshow=$langs->trans("Country");
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
|
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; $align="center"; }
|
||||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||||
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
|
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
|
||||||
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
||||||
@ -834,7 +834,7 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
|
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
|
||||||
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
|
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
|
||||||
if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); }
|
if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); }
|
||||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
|
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; $align="center"; }
|
||||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||||
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
|
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
|
||||||
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
||||||
@ -861,11 +861,11 @@ if ($id)
|
|||||||
// Lines with values
|
// Lines with values
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$var = ! $var;
|
||||||
$var=!$var;
|
|
||||||
//print_r($obj);
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
|
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
//print_r($obj);
|
||||||
|
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
|
||||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||||
{
|
{
|
||||||
print '<form action="dict.php" method="post">';
|
print '<form action="dict.php" method="post">';
|
||||||
@ -885,9 +885,9 @@ if ($id)
|
|||||||
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$tmpaction = 'view';
|
$tmpaction = 'view';
|
||||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
$reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
@ -923,6 +923,7 @@ if ($id)
|
|||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') {
|
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') {
|
||||||
$valuetoshow=yn($valuetoshow);
|
$valuetoshow=yn($valuetoshow);
|
||||||
|
$align="center";
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||||
$valuetoshow=price($valuetoshow);
|
$valuetoshow=price($valuetoshow);
|
||||||
@ -1038,7 +1039,16 @@ if ($id)
|
|||||||
$valuetoshow = '';
|
$valuetoshow = '';
|
||||||
$align="right";
|
$align="right";
|
||||||
}
|
}
|
||||||
|
else if (in_array($fieldlist[$field],array('taux','localtax1','localtax2')))
|
||||||
|
{
|
||||||
|
$align="right";
|
||||||
|
}
|
||||||
|
else if (in_array($fieldlist[$field],array('recuperableonly')))
|
||||||
|
{
|
||||||
|
$align="center";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show value for field
|
||||||
if ($showfield) print '<td align="'.$align.'">'.$valuetoshow.'</td>';
|
if ($showfield) print '<td align="'.$align.'">'.$valuetoshow.'</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1217,11 +1227,10 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
|||||||
}
|
}
|
||||||
elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) {
|
elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) {
|
||||||
$align="left";
|
$align="left";
|
||||||
// Les taxes locales sont cadrées à droite
|
if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="right"; // Fields aligned on right
|
||||||
if ($fieldlist[$field] == 'localtax1' || $fieldlist[$field] == 'localtax2')
|
|
||||||
$align="right";
|
|
||||||
print '<td align="'.$align.'">';
|
print '<td align="'.$align.'">';
|
||||||
print '<input type="text" class="flat" value="'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" size="3" name="'.$fieldlist[$field].'"></td>';
|
print '<input type="text" class="flat" value="'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" size="3" name="'.$fieldlist[$field].'">';
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'libelle_facture') {
|
elseif ($fieldlist[$field] == 'libelle_facture') {
|
||||||
print '<td><textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea></td>';
|
print '<td><textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea></td>';
|
||||||
|
|||||||
@ -120,8 +120,6 @@ class HookManager
|
|||||||
*/
|
*/
|
||||||
function executeHooks($method, $parameters=false, &$object='', &$action='')
|
function executeHooks($method, $parameters=false, &$object='', &$action='')
|
||||||
{
|
{
|
||||||
global $var;
|
|
||||||
|
|
||||||
if (! is_array($this->hooks) || empty($this->hooks)) return '';
|
if (! is_array($this->hooks) || empty($this->hooks)) return '';
|
||||||
|
|
||||||
$parameters['context']=join(':',$this->contextarray);
|
$parameters['context']=join(':',$this->contextarray);
|
||||||
@ -140,8 +138,6 @@ class HookManager
|
|||||||
if (in_array($module,$modulealreadyexecuted)) continue;
|
if (in_array($module,$modulealreadyexecuted)) continue;
|
||||||
$modulealreadyexecuted[$module]=$module;
|
$modulealreadyexecuted[$module]=$module;
|
||||||
|
|
||||||
$var=!$var;
|
|
||||||
|
|
||||||
// Hooks that return int
|
// Hooks that return int
|
||||||
if (($method == 'doActions' || $method == 'formObjectOptions') && method_exists($actionclassinstance,$method))
|
if (($method == 'doActions' || $method == 'formObjectOptions') && method_exists($actionclassinstance,$method))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -238,3 +238,7 @@ create table llx_socpeople_extrafields
|
|||||||
|
|
||||||
ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_object);
|
ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_object);
|
||||||
|
|
||||||
|
-- update type of localtax for spain
|
||||||
|
UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 41 AND fk_pays = 4 AND localtax1_type = '0';
|
||||||
|
UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 42 AND fk_pays = 4 AND localtax1_type = '0';
|
||||||
|
UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 43 AND fk_pays = 4 AND localtax1_type = '0';
|
||||||
|
|||||||
@ -247,6 +247,8 @@ Quadri=Quadri
|
|||||||
MonthOfDay=Month of the day
|
MonthOfDay=Month of the day
|
||||||
HourShort=H
|
HourShort=H
|
||||||
Rate=Rate
|
Rate=Rate
|
||||||
|
UseLocalTax=Include tax
|
||||||
|
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (vat is not applied on local tax)<br>2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)<br>3 : local tax apply on products without vat (vat is not applied on local tax)<br>4 : local tax apply on products before vat (vat is calculated on amount + localtax)<br>5 : local tax apply on services without vat (vat is not applied on local tax)<br>6 : local tax apply on services before vat (vat is calculated on amount + localtax)<br>7 : local tax is a fix amount applied on global invoice
|
||||||
Bytes=Bytes
|
Bytes=Bytes
|
||||||
KiloBytes=Kilobytes
|
KiloBytes=Kilobytes
|
||||||
MegaBytes=Megabytes
|
MegaBytes=Megabytes
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user