diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index 93745ea..6c77f6f 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -938,6 +938,7 @@ class DeclarationTVA return false; } + /* No bank entries anymore , are done manually // Create bank journal entries $bank_entries = $this->createBankJournalEntries($declaration, $ca3_lookup, $journal_config, $user); if ($bank_entries === false) { @@ -945,6 +946,7 @@ class DeclarationTVA return false; } // Note: $bank_entries can be an empty array for carry-forward cases, which is OK + */ return true; } @@ -1429,7 +1431,7 @@ class DeclarationTVA // Check if declaration is validated // TEMPORARILY DISABLED FOR TESTING - allows re-submission - if ($declaration->status !== 'validated') { + if ($this->status !== 'validated') { $this->error = 'Declaration must be validated before submission'; return false; } @@ -1913,7 +1915,7 @@ class DeclarationTVA $obj = $this->db->fetch_object($result); // Only check for documents if declaration is validated - if ($obj->status != 'validated') { + if ($obj->status != 'validated' && $obj->status != 'submitted') { return false; } @@ -1953,7 +1955,7 @@ class DeclarationTVA $obj = $this->db->fetch_object($result); // Only return path if declaration is validated - if ($obj->status != 'validated') { + if ($obj->status != 'validated' && $obj->status != 'submitted') { return false; } diff --git a/declarationtvaindex.php b/declarationtvaindex.php index 4a86a0b..1cda3b0 100644 --- a/declarationtvaindex.php +++ b/declarationtvaindex.php @@ -138,6 +138,9 @@ if (empty($declarations)) { $status_icon = ' '; } elseif ($d['status'] == 'draft') { $status_icon = ' '; + } elseif ($d['status'] == 'submitted') { + $status_icon = ' '; + $status_icon .= ' '; } print '' . $langs->trans("Status" . ucfirst($d['status'])) . $status_icon . ''; @@ -175,7 +178,7 @@ if (empty($declarations)) { // Document column print ''; - if ($d['status'] == 'validated') { + if (($d['status'] == 'validated') || ($d['status'] == 'submitted')) { // Check if document exists $has_document = $declarationtva->hasValidatedDocument($d['rowid']); @@ -192,7 +195,8 @@ if (empty($declarations)) { print ''; } } else { - print ''; + //print ''; + print 'file'; } } else { print ''; diff --git a/download_pdf.php b/download_pdf.php index 2370aa8..e860122 100644 --- a/download_pdf.php +++ b/download_pdf.php @@ -45,7 +45,7 @@ if ($result <= 0) { } // Check if declaration is validated -if ($declarationtva->status != 'validated') { +if ($declarationtva->status != 'validated' && $declarationtva->status != 'submitted') { setEventMessages("Declaration is not validated", null, 'errors'); header("Location: declarationtva_view.php?id=" . $declaration_id); exit; diff --git a/langs/fr_FR/declarationtva.lang b/langs/fr_FR/declarationtva.lang index 14d320e..62ba176 100644 --- a/langs/fr_FR/declarationtva.lang +++ b/langs/fr_FR/declarationtva.lang @@ -388,12 +388,12 @@ Submit = Soumettre View = Voir StatusDraft = Brouillon StatusValidated = Validée -StatusSubmitted = Soumise +StatusSubmitted = Transferée # Success and Error Messages DeclarationCreated = Déclaration créée avec succès DeclarationValidated = Déclaration validée avec succès -DeclarationSubmitted = Déclaration soumise avec succès +DeclarationSubmitted = Déclaration transferée avec succès ErrorCreatingDeclaration = Erreur lors de la création de la déclaration ErrorValidatingDeclaration = Erreur lors de la validation de la déclaration ErrorSubmittingDeclaration = Erreur lors de la soumission de la déclaration