[ task #1063 ] Allow edit localtaxes rate for thirds. Improve visu

This commit is contained in:
Juanjo Menent 2014-07-04 16:48:42 +02:00
parent 4063260cc8
commit 8e4e08f907
6 changed files with 22 additions and 25 deletions

View File

@ -1463,12 +1463,12 @@ if ($action == 'create') {
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>'; print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>'; print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>"; print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";
if ($mysoc->localtax1_assuj == "1") // Localtax1 if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0 ) // Localtax1
{ {
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax1) . "</td></tr>"; print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax1) . "</td></tr>";
} }
if ($mysoc->localtax2_assuj == "1") // Localtax2 if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) // Localtax2
{ {
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax2) . "</td></tr>"; print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax2) . "</td></tr>";
} }
@ -1985,13 +1985,13 @@ if ($action == 'create') {
print '<td></td></tr>'; print '<td></td></tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->localtax1_assuj == "1") // Localtax1 if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
{ {
print '<tr><td height="10">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; print '<tr><td height="10">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td align="right" class="nowrap">' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>'; print '<td align="right" class="nowrap">' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<td></td></tr>'; print '<td></td></tr>';
} }
if ($mysoc->localtax2_assuj == "1") // Localtax2 if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2
{ {
print '<tr><td height="10">' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; print '<tr><td height="10">' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td align="right" class="nowrap">' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>'; print '<td align="right" class="nowrap">' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';

View File

@ -1589,12 +1589,12 @@ if ($action == 'create' && $user->rights->commande->creer) {
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>'; print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>'; print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>"; print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";
if ($mysoc->localtax1_assuj == "1") // Localtax1 RE if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE
{ {
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax1) . "</td></tr>"; print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax1) . "</td></tr>";
} }
if ($mysoc->localtax2_assuj == "1") // Localtax2 IRPF if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) // Localtax2 IRPF
{ {
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax2) . "</td></tr>"; print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax2) . "</td></tr>";
} }
@ -1840,9 +1840,9 @@ if ($action == 'create' && $user->rights->commande->creer) {
$nbrow ++; $nbrow ++;
// Local taxes // Local taxes
if ($mysoc->localtax1_assuj == "1") if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0)
$nbrow ++; $nbrow ++;
if ($mysoc->localtax2_assuj == "1") if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0 )
$nbrow ++; $nbrow ++;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -2115,9 +2115,9 @@ if ($action == 'create' && $user->rights->commande->creer) {
} }
$rowspan = 4; $rowspan = 4;
if ($mysoc->localtax1_assuj == "1") if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0)
$rowspan ++; $rowspan ++;
if ($mysoc->localtax2_assuj == "1") if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0)
$rowspan ++; $rowspan ++;
// Total HT // Total HT
@ -2138,12 +2138,12 @@ if ($action == 'create' && $user->rights->commande->creer) {
print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td align="right">' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td align="right">' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->localtax1_assuj == "1") // Localtax1 RE if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
{ {
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td align="right">' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<td align="right">' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
} }
if ($mysoc->localtax2_assuj == "1") // Localtax2 IRPF if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2 IRPF
{ {
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td align="right">' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<td align="right">' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';

View File

@ -2302,12 +2302,12 @@ if ($action == 'create')
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>'; print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>'; print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>"; print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";
if ($mysoc->localtax1_assuj == "1") // Localtax1 RE if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1
{ {
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax1) . "</td></tr>"; print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax1) . "</td></tr>";
} }
if ($mysoc->localtax2_assuj == "1") // Localtax2 IRPF if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) // Localtax2
{ {
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax2) . "</td></tr>"; print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax2) . "</td></tr>";
} }
@ -2907,9 +2907,9 @@ if ($action == 'create')
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
$nbcols ++; $nbcols ++;
// if (! empty($soc->outstandingbill)) $nbrows++; // if (! empty($soc->outstandingbill)) $nbrows++;
if ($mysoc->localtax1_assuj == "1") if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0)
$nbrows ++; $nbrows ++;
if ($mysoc->localtax2_assuj == "1") if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0)
$nbrows ++; $nbrows ++;
if ($selleruserevenustamp) if ($selleruserevenustamp)
$nbrows ++; $nbrows ++;
@ -3173,12 +3173,12 @@ if ($action == 'create')
print '</tr>'; print '</tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) // Localtax1 (example RE) if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) // Localtax1
{ {
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td align="right" colspan="3" nowrap>' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<td align="right" colspan="3" nowrap>' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
} }
if ($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) // Localtax2 (example IRPF) if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) // Localtax2
{ {
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td align="right" colspan="3" nowrap>' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<td align="right" colspan="3" nowrap>' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';

View File

@ -1506,13 +1506,13 @@ elseif (! empty($object->id))
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->localtax1_assuj=="1") //Localtax1 if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1
{ {
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>'; print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax1).'</td>'; print '<td align="right">'.price($object->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
} }
if ($mysoc->localtax2_assuj=="1") //Localtax2 if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2
{ {
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>'; print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax2).'</td>'; print '<td align="right">'.price($object->total_localtax2).'</td>';

View File

@ -1368,12 +1368,12 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>"; print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>";
if ($mysoc->country_code=='ES') if ($mysoc->country_code=='ES')
{ {
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1
{ {
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>"; print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
} }
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2
{ {
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>"; print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
} }

View File

@ -91,9 +91,6 @@ LocalTax2IsUsedES= Sujeto a IRPF
LocalTax2IsNotUsedES= No sujeto a IRPF LocalTax2IsNotUsedES= No sujeto a IRPF
LocalTax1ES=RE LocalTax1ES=RE
LocalTax2ES=IRPF LocalTax2ES=IRPF
TypeLocaltax1ES= Tipo RE
TypeLocaltax2ES= Tipo IRPF
TypeES= Tipo
ThirdPartyEMail=%s ThirdPartyEMail=%s
WrongCustomerCode=Código cliente incorrecto WrongCustomerCode=Código cliente incorrecto
WrongSupplierCode=Código proveedor incorrecto WrongSupplierCode=Código proveedor incorrecto