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); // Fetch declaration if ($declarationtva->fetch($id) < 0) { setEventMessages($langs->trans("DeclarationNotFound"), null, 'errors'); header("Location: declarationtvaindex.php"); exit; } // Get period information $period_info = array(); if ($declarationtva->period_id > 0) { $period->fetch($declarationtva->period_id); $period_info = array( 'name' => $period->period_name, 'start_date' => $period->start_date, 'end_date' => $period->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 '
'; print '
' . $langs->trans("DeclarationDetails") . '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
' . $langs->trans("DeclarationNumber") . '' . $declarationtva->declaration_number . '
' . $langs->trans("DeclarationName") . '' . $declarationtva->declaration_name . '
' . $langs->trans("Period") . '' . $period_info['name'] . '
' . $langs->trans("DateRange") . '' . dol_print_date($period_info['start_date'], 'day') . ' - ' . dol_print_date($period_info['end_date'], 'day') . '
' . $langs->trans("Status") . '' . $langs->trans("Status" . ucfirst($declarationtva->status)) . '
' . $langs->trans("CreatedDate") . '' . dol_print_date($declarationtva->created_date, 'dayhour') . '
'; print '
'; // Print CA-3 amounts (placeholder for now) print '
'; print '
' . $langs->trans("CA3Amounts") . '
'; print ''; print ''; print ''; print ''; print ''; print ''; // Placeholder CA-3 lines $ca3_lines = array( 'A1' => array('desc' => 'Opérations imposables (ventes/prestations)', 'amount' => 0), 'A2' => array('desc' => 'Opérations imposables spéciales', 'amount' => 0), 'A3' => array('desc' => 'Services achetés non établis', 'amount' => 0), 'A4' => array('desc' => 'Importations', 'amount' => 0), 'A5' => array('desc' => 'Sorties de régimes suspensifs', 'amount' => 0), '08' => array('desc' => 'Autres opérations imposables', 'amount' => 0), '09' => array('desc' => 'Opérations exonérées', 'amount' => 0), '9B' => array('desc' => 'Opérations non imposables', 'amount' => 0), '17' => array('desc' => 'TVA due acquisitions intracommunautaires', 'amount' => 0), '20' => array('desc' => 'TVA déductible immobilisations', 'amount' => 0), '21' => array('desc' => 'TVA déductible autres biens/services', 'amount' => 0), '22' => array('desc' => 'Crédit de TVA reportable', 'amount' => 0), '25' => array('desc' => 'TVA brute due', 'amount' => 0), '26' => array('desc' => 'TVA déductible totale', 'amount' => 0), '28' => array('desc' => 'TVA nette à payer', 'amount' => 0), '29' => array('desc' => 'Crédit de TVA', 'amount' => 0) ); foreach ($ca3_lines as $line => $data) { print ''; print ''; print ''; print ''; print ''; } print '
' . $langs->trans("CA3Line") . '' . $langs->trans("Description") . '' . $langs->trans("Amount") . '
' . $line . '' . $data['desc'] . '' . price($data['amount']) . '
'; print '
'; // Print actions print '
'; print '
' . $langs->trans("Actions") . '
'; print '
'; if ($declarationtva->status == 'draft') { print '' . $langs->trans("Validate") . ''; } elseif ($declarationtva->status == 'validated') { print '' . $langs->trans("Submit") . ''; } print '' . $langs->trans("BackToList") . ''; print '
'; print '
'; // Print footer llxFooter(); ?>