Features: - Add validation confirmation dialog (non-JavaScript popup) - Remove recalculate button after validation - Generate and save detailed PDF to Dolibarr documents - Add document icons in declaration list - Add status icons (checkmark for validated, edit for draft) - Create documents linking table - Add validation language strings (FR/EN) Technical: - Enhanced validateDeclaration() method with user tracking - saveValidatedPDF() method for document storage - hasValidatedDocument() method for icon display - Custom confirmation dialog with CSS styling - Database migration for documents table - Status-based UI changes
27 lines
1.1 KiB
SQL
27 lines
1.1 KiB
SQL
-- Migration: Add documents table for linking validated PDFs to declarations
|
|
-- Version: 2.1.0
|
|
-- Date: 2025-01-06
|
|
|
|
-- Create table for linking documents to declarations
|
|
CREATE TABLE IF NOT EXISTS `llx_declarationtva_documents` (
|
|
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
|
`declaration_id` int(11) NOT NULL,
|
|
`document_id` int(11) NOT NULL,
|
|
`created_date` datetime NOT NULL,
|
|
`entity` int(11) NOT NULL DEFAULT 1,
|
|
PRIMARY KEY (`rowid`),
|
|
KEY `idx_declaration_id` (`declaration_id`),
|
|
KEY `idx_document_id` (`document_id`),
|
|
KEY `idx_entity` (`entity`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
-- Add validated_date and validated_by columns to declarations table if they don't exist
|
|
ALTER TABLE `llx_declarationtva_declarations`
|
|
ADD COLUMN IF NOT EXISTS `validated_date` datetime DEFAULT NULL,
|
|
ADD COLUMN IF NOT EXISTS `validated_by` int(11) DEFAULT NULL;
|
|
|
|
-- Add indexes for performance
|
|
ALTER TABLE `llx_declarationtva_declarations`
|
|
ADD INDEX IF NOT EXISTS `idx_validated_date` (`validated_date`),
|
|
ADD INDEX IF NOT EXISTS `idx_validated_by` (`validated_by`);
|