Revert to 3-column layout with special base+VAT columns for 08, 09, 9B
Reverted: - Main table back to 3 columns (Line, Description, Amount) - Sections A, C, D use normal 3-column layout - Only lines 08, 09, 9B have special 4-column layout (Line, Description, Base HT, VAT) - Added special header 'Base HT et TVA par taux' for these lines - Line 17 uses normal 3-column layout - Added language translations for new header
This commit is contained in:
parent
337e82b30b
commit
ae7768dd7b
@ -138,9 +138,7 @@ print '<table class="noborder centpercent">';
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>' . $langs->trans("CA3Line") . '</th>';
|
print '<th>' . $langs->trans("CA3Line") . '</th>';
|
||||||
print '<th>' . $langs->trans("Description") . '</th>';
|
print '<th>' . $langs->trans("Description") . '</th>';
|
||||||
print '<th>' . $langs->trans("BaseAmount") . '</th>';
|
print '<th>' . $langs->trans("Amount") . '</th>';
|
||||||
print '<th>' . $langs->trans("VATAmount") . '</th>';
|
|
||||||
print '<th>' . $langs->trans("TotalAmount") . '</th>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Get actual CA-3 lines from database
|
// Get actual CA-3 lines from database
|
||||||
@ -157,73 +155,93 @@ foreach ($ca3_lines as $line) {
|
|||||||
|
|
||||||
// Section A: Opérations imposables
|
// Section A: Opérations imposables
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="5"><strong>A. ' . $langs->trans("CA3SectionA") . '</strong></td>';
|
print '<td colspan="3"><strong>A. ' . $langs->trans("CA3SectionA") . '</strong></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$section_a_lines = array('A1', 'A2', 'A3', 'A4', 'A5');
|
$section_a_lines = array('A1', 'A2', 'A3', 'A4', 'A5');
|
||||||
foreach ($section_a_lines as $line) {
|
foreach ($section_a_lines as $line) {
|
||||||
$data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'base_amount' => 0, 'vat_amount' => 0, 'total_amount' => 0);
|
$data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'vat_amount' => 0);
|
||||||
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
|
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $line . '</td>';
|
print '<td>' . $line . '</td>';
|
||||||
print '<td>' . $description . '</td>';
|
print '<td>' . $description . '</td>';
|
||||||
print '<td class="right">' . price($data['base_amount']) . '</td>';
|
|
||||||
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
||||||
print '<td class="right">' . price($data['total_amount']) . '</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section B: TVA due
|
// Section B: TVA due
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="5"><strong>B. ' . $langs->trans("CA3SectionB") . '</strong></td>';
|
print '<td colspan="3"><strong>B. ' . $langs->trans("CA3SectionB") . '</strong></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$section_b_lines = array('08', '09', '9B', '17');
|
// Special header for lines 08, 09, 9B with base and VAT columns
|
||||||
foreach ($section_b_lines as $line) {
|
print '<tr class="liste_titre">';
|
||||||
$data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'base_amount' => 0, 'vat_amount' => 0, 'total_amount' => 0);
|
print '<td colspan="4"><strong>' . $langs->trans("BaseHTAndVATByRate") . '</strong></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<th>' . $langs->trans("CA3Line") . '</th>';
|
||||||
|
print '<th>' . $langs->trans("Description") . '</th>';
|
||||||
|
print '<th>' . $langs->trans("BaseAmount") . '</th>';
|
||||||
|
print '<th>' . $langs->trans("VATAmount") . '</th>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$base_vat_lines = array('08', '09', '9B');
|
||||||
|
foreach ($base_vat_lines as $line) {
|
||||||
|
$data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'base_amount' => 0, 'vat_amount' => 0);
|
||||||
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
|
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $line . '</td>';
|
print '<td>' . $line . '</td>';
|
||||||
print '<td>' . $description . '</td>';
|
print '<td>' . $description . '</td>';
|
||||||
print '<td class="right">' . price($data['base_amount']) . '</td>';
|
print '<td class="right">' . price($data['base_amount']) . '</td>';
|
||||||
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
||||||
print '<td class="right">' . price($data['total_amount']) . '</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset to normal layout for line 17
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<th>' . $langs->trans("CA3Line") . '</th>';
|
||||||
|
print '<th>' . $langs->trans("Description") . '</th>';
|
||||||
|
print '<th>' . $langs->trans("Amount") . '</th>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$data = isset($ca3_data['17']) ? $ca3_data['17'] : array('line_label' => '', 'vat_amount' => 0);
|
||||||
|
$description = isset($ca3_definitions['17']) ? $ca3_definitions['17']['label'] : $data['line_label'];
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>17</td>';
|
||||||
|
print '<td>' . $description . '</td>';
|
||||||
|
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Section C: TVA déductible
|
// Section C: TVA déductible
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="5"><strong>C. ' . $langs->trans("CA3SectionC") . '</strong></td>';
|
print '<td colspan="3"><strong>C. ' . $langs->trans("CA3SectionC") . '</strong></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$section_c_lines = array('20', '21', '22');
|
$section_c_lines = array('20', '21', '22');
|
||||||
foreach ($section_c_lines as $line) {
|
foreach ($section_c_lines as $line) {
|
||||||
$data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'base_amount' => 0, 'vat_amount' => 0, 'total_amount' => 0);
|
$data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'vat_amount' => 0);
|
||||||
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
|
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $line . '</td>';
|
print '<td>' . $line . '</td>';
|
||||||
print '<td>' . $description . '</td>';
|
print '<td>' . $description . '</td>';
|
||||||
print '<td class="right">' . price($data['base_amount']) . '</td>';
|
|
||||||
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
||||||
print '<td class="right">' . price($data['total_amount']) . '</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section D: Résultat
|
// Section D: Résultat
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="5"><strong>D. ' . $langs->trans("CA3SectionD") . '</strong></td>';
|
print '<td colspan="3"><strong>D. ' . $langs->trans("CA3SectionD") . '</strong></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$section_d_lines = array('25', '26', '28', '29');
|
$section_d_lines = array('25', '26', '28', '29');
|
||||||
foreach ($section_d_lines as $line) {
|
foreach ($section_d_lines as $line) {
|
||||||
$data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'base_amount' => 0, 'vat_amount' => 0, 'total_amount' => 0);
|
$data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'vat_amount' => 0);
|
||||||
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
|
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $line . '</td>';
|
print '<td>' . $line . '</td>';
|
||||||
print '<td>' . $description . '</td>';
|
print '<td>' . $description . '</td>';
|
||||||
print '<td class="right">' . price($data['base_amount']) . '</td>';
|
|
||||||
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
print '<td class="right">' . price($data['vat_amount']) . '</td>';
|
||||||
print '<td class="right">' . price($data['total_amount']) . '</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -440,3 +440,4 @@ CA3SectionD = Result
|
|||||||
BaseAmount = Base Amount
|
BaseAmount = Base Amount
|
||||||
VATAmount = VAT Amount
|
VATAmount = VAT Amount
|
||||||
TotalAmount = Total Amount
|
TotalAmount = Total Amount
|
||||||
|
BaseHTAndVATByRate = Base HT and VAT by Rate
|
||||||
|
|||||||
@ -429,3 +429,4 @@ CA3SectionD = Résultat
|
|||||||
BaseAmount = Montant HT
|
BaseAmount = Montant HT
|
||||||
VATAmount = Montant TVA
|
VATAmount = Montant TVA
|
||||||
TotalAmount = Montant Total
|
TotalAmount = Montant Total
|
||||||
|
BaseHTAndVATByRate = Base HT et TVA par taux
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user