hasRight("declarationtva", "declarationtva", "read")) { accessforbidden(); } // Load language files $langs->load("declarationtva@declarationtva"); // Get declaration ID $id = GETPOST('id', 'int'); if (empty($id)) { accessforbidden(); } // Initialize objects $declarationtva = new DeclarationTVA($db, $conf->entity); $config = new DeclarationTVA_Config($db, $conf->entity); $period = new DeclarationTVA_Period($db, $conf->entity); // Handle actions $action = GETPOST('action', 'alpha'); $token = GETPOST('token', 'alpha'); if ($action == 'recalculate' && $token) { if ($declarationtva->recalculateCA3Amounts($id)) { setEventMessages($langs->trans("DeclarationRecalculated"), null, 'mesgs'); } else { setEventMessages($langs->trans("ErrorRecalculatingDeclaration"), null, 'errors'); } } // Fetch declaration if ($declarationtva->fetch($id) < 0) { setEventMessages($langs->trans("DeclarationNotFound"), null, 'errors'); header("Location: declarationtvaindex.php"); exit; } // Use declaration's own dates $start_date = $declarationtva->start_date; $end_date = $declarationtva->end_date; // Page title $title = $langs->trans("ViewDeclaration") . ' - ' . $declarationtva->declaration_number; llxHeader('', $title); // Print page header print load_fiche_titre($title, '', 'title_accountancy'); // Print declaration details print '
| ' . $langs->trans("DeclarationNumber") . ' | '; print '' . $declarationtva->declaration_number . ' | '; print '
| ' . $langs->trans("DeclarationName") . ' | '; print '' . $declarationtva->declaration_name . ' | '; print '
| ' . $langs->trans("Period") . ' | '; print '' . dol_print_date($start_date, 'day') . ' - ' . dol_print_date($end_date, 'day') . ' | '; print '
| ' . $langs->trans("Status") . ' | '; print '' . $langs->trans("Status" . ucfirst($declarationtva->status)) . ' | '; print '
| ' . $langs->trans("CreatedDate") . ' | '; print '' . dol_print_date($declarationtva->created_date, 'dayhour') . ' | '; print '
| A. ' . $langs->trans("CA3SectionA") . ' | '; print '|||
| ' . $langs->trans("CA3Line") . ' | '; print '' . $langs->trans("Description") . ' | '; print '' . $langs->trans("Amount") . ' | '; print '|
|---|---|---|---|
| ' . $line . ' | '; print '' . $description . ' | '; print '' . formatAmountWithOriginal($data['vat_amount'], $data['line_label']) . ' | '; print '|
| B. ' . $langs->trans("CA3SectionB") . ' | '; print '|||
| ' . $langs->trans("BaseHTAndVATByRate") . ' | '; print '|||
| ' . $langs->trans("CA3Line") . ' | '; print '' . $langs->trans("Description") . ' | '; print '' . $langs->trans("BaseAmount") . ' | '; print '' . $langs->trans("VATAmount") . ' | '; print '
| ' . $line . ' | '; print '' . $description . ' | '; print '' . formatAmountWithOriginal($data['base_amount'], $data['line_label'], 'base') . ' | '; print '' . formatAmountWithOriginal($data['vat_amount'], $data['line_label']) . ' | '; print '
| 16 | '; print 'Sous-total TVA due (08 + 09 + 9B) | '; print '' . formatAmount($data['vat_amount']) . ' | '; print '|
| ' . $langs->trans("CA3Line") . ' | '; print '' . $langs->trans("Description") . ' | '; print '' . $langs->trans("Amount") . ' | '; print '|
| 17 | '; print '' . $description . ' | '; print '' . formatAmountWithOriginal($data['vat_amount'], $data['line_label']) . ' | '; print '|
| C. ' . $langs->trans("CA3SectionC") . ' | '; print '|||
| ' . $langs->trans("CA3Line") . ' | '; print '' . $langs->trans("Description") . ' | '; print '' . $langs->trans("Amount") . ' | '; print '|
| ' . $line . ' | '; print '' . $description . ' | '; print '' . formatAmountWithOriginal($data['vat_amount'], $data['line_label']) . ' | '; print '|
| 23 | '; print 'Sous-total TVA déductible (20 + 21 + 22) | '; print '' . formatAmount($data['vat_amount']) . ' | '; print '|
| D. ' . $langs->trans("CA3SectionD") . ' | '; print '|||
| ' . $langs->trans("CA3Line") . ' | '; print '' . $langs->trans("Description") . ' | '; print '' . $langs->trans("Amount") . ' | '; print '|
| ' . $line . ' | '; print '' . $description . ' | '; print '' . formatAmount($data['vat_amount']) . ' | '; print '|
| ' . $langs->trans("NoCA3Data") . ' | '; print '|||