feat: Implement mfr truncation fix and enhance invoice handling
Playwright Tests / test (push) Canceled after 0s

- Added a new SQL script to address the "String or binary data would be truncated" error in mfr sync by widening the Note fields in service objects and companies to NVARCHAR(MAX).
- Updated the table types and associated stored procedures to accommodate the changes, ensuring compatibility with existing data.
- Queued a re-sync for previously rejected rows due to truncation issues.
- Created application logins for fuchs_fds and fuchs_web with placeholder passwords for initial setup.
- Introduced functions for invoice backdating and invoice date retrieval to streamline invoice processing.
- Developed a password generation function with customizable parameters for length and character types.
- Added a random number generation function to support password creation.
This commit is contained in:
Stefan
2026-09-30 16:56:08 +02:00
parent 7357f60120
commit c741535aec
79 changed files with 2739 additions and 143 deletions
@@ -216,14 +216,14 @@ BEGIN
[MappingId] [nvarchar](255) NULL,
[ExternalId] [nvarchar](255) NULL,
[Name] [nvarchar](255) NULL,
[Note] [nvarchar](255) NULL,
[Note] [nvarchar](max) NULL,
[SupportTelephone] [nvarchar](255) NULL,
[SupportFax] [nvarchar](255) NULL,
[SupportMail] [nvarchar](255) NULL,
[QuickSearch] [nvarchar](255) NULL,
[DateModified] [datetime] NOT NULL,
[CustomValues] [nvarchar](max) NOT NULL,
[MainContactId] [bigint] NOT NULL,
[CustomValues] [nvarchar](max) NULL,
[MainContactId] [bigint] NULL,
[address] nvarchar(1000) null
);
INSERT INTO @company SELECT DISTINCT cy.*, [address] = [dbo].[fds__getCompanyAddress](cy.[id]) FROM [mfr__companies] as cy JOIN @SReq as s on cy.id = s.[CustomerId];
@@ -377,6 +377,7 @@ BEGIN
)
SELECT [Id] = CAST(i.[Id] as varchar(20))
,i.[DateCreated]
,[InvoiceDate] = [dbo].[fds__fn_invoiceDate](i.[DateFinalized], i.[DateCreated])
,[isFinal]
,[isSent]
,i.[DocumentName]
@@ -387,10 +388,10 @@ BEGIN
WHEN [DueDate] is null THEN 'op'
WHEN [invoiceBalance] < 0 THEN ''
WHEN @today >= [DueDate] THEN 'due'
WHEN @stage1 <> '' AND ISNULL(rem.[#],0) = 0 AND @today > [dbo].[date_addcustom](ISNULL(DueDate, i.[DateCreated]), @stage1) THEN 'ovd'
WHEN @stage1 <> '' AND ISNULL(rem.[#],0) = 0 AND @today > [dbo].[date_addcustom](ISNULL(DueDate, [dbo].[fds__fn_invoiceDate](i.[DateFinalized], i.[DateCreated])), @stage1) THEN 'ovd'
WHEN ISNULL(rem.[#],0) > 0 THEN 'rem'
END
,[order] = ROW_NUMBER() OVER ( ORDER BY inv.[isChild], inv.[baseorder], i.[isFinal] DESC, i.[datecreated] ASC )
,[order] = ROW_NUMBER() OVER ( ORDER BY inv.[isChild], inv.[baseorder], i.[isFinal] DESC, [dbo].[fds__fn_invoiceDate](i.[DateFinalized], i.[DateCreated]) ASC )
FROM [dbo].[fds__invoices] as i
JOIN inv on i.[Id] = inv.[Id]
LEFT JOIN reminder as rem on inv.id = rem.[InvId]