feat: Implement mfr truncation fix and enhance invoice handling
Playwright Tests / test (push) Canceled after 0s
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:
@@ -40,20 +40,20 @@ BEGIN
|
||||
WITH inv as(
|
||||
SELECT
|
||||
[itmPrice] = SUM( ISNULL(itm.[value_total],0) )
|
||||
,[Dateofcreation] = CAST(_i.[DateCreated] as date)
|
||||
,[Dateofcreation] = [dbo].[fds__fn_invoiceDate](_i.[DateFinalized], _i.[DateCreated])
|
||||
,[material] = itm.[text]
|
||||
,[seq] = ROW_NUMBER() OVER (ORDER BY CAST(_i.[DateCreated] as date))
|
||||
,[seq] = ROW_NUMBER() OVER (ORDER BY [dbo].[fds__fn_invoiceDate](_i.[DateFinalized], _i.[DateCreated]))
|
||||
FROM [dbo].[fds__invoices] as _i
|
||||
JOIN [fds__invoice_items] as itm on itm.[invid] = _i.[id] AND itm.[Type] like 'Material'
|
||||
where YEAR(_i.[DateCreated]) = @year and _i.[isfinal] = 1
|
||||
GROUP BY CAST(_i.[DateCreated] as date), itm.[text]
|
||||
where YEAR([dbo].[fds__fn_invoiceDate](_i.[DateFinalized], _i.[DateCreated])) = @year and _i.[isfinal] = 1
|
||||
GROUP BY [dbo].[fds__fn_invoiceDate](_i.[DateFinalized], _i.[DateCreated]), itm.[text]
|
||||
), yr1 as (
|
||||
SELECT
|
||||
[year] = YEAR( _i.[DateCreated] )
|
||||
[year] = YEAR([dbo].[fds__fn_invoiceDate](_i.[DateFinalized], _i.[DateCreated]))
|
||||
, [total] = SUM( ISNULL(_i.[InvoiceBalance],0) )
|
||||
FROM [dbo].[fds__invoices] as _i
|
||||
WHERE _i.[isfinal] = 1
|
||||
GROUP BY YEAR( _i.[DateCreated])
|
||||
GROUP BY YEAR([dbo].[fds__fn_invoiceDate](_i.[DateFinalized], _i.[DateCreated]))
|
||||
), yr as (
|
||||
SELECT [year], [total] = SUM([total])
|
||||
from yr1 GROUP BY [year]
|
||||
|
||||
Reference in New Issue
Block a user