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.
26 lines
1.1 KiB
Transact-SQL
26 lines
1.1 KiB
Transact-SQL
-- =============================================
|
|
-- Author: <Author,,Name>
|
|
-- Create date: <Create Date, ,>
|
|
-- Description: <Description, ,>
|
|
-- =============================================
|
|
CREATE FUNCTION [dbo].[fds__fn_IntermediateIsAllocatedToOther]
|
|
(
|
|
@Intermediate_InvID varchar(10)
|
|
,@Target_InvID varchar(10)
|
|
|
|
)
|
|
RETURNS bit
|
|
AS
|
|
BEGIN
|
|
-- An allocation only counts while the crediting invoice is alive: once that invoice is cancelled
|
|
-- (storno) its credit line is void and the Abschlagsrechnung must be offered again (ADR 0034).
|
|
DECLARE @IsA bit = CASE WHEN EXISTS (SELECT 1 FROM [dbo].[fds__invoices] as intermediates JOIN [dbo].[fds__invoice_details] as id on intermediates.[Id] = id.[InvId] and id.[AllocatedTo_InvId] is not null
|
|
JOIN [dbo].[fds__invoices] as non_intermediates ON id.[AllocatedTo_InvId] = non_intermediates.[Id] and id.[AllocatedTo_InvId] is not null
|
|
WHERE intermediates.[Id] = @Intermediate_InvID
|
|
and ISNULL(non_intermediates.[IsCanceled], 0) = 0
|
|
and (@Target_InvID is null or non_intermediates.[Id] <> @Target_InvID))
|
|
THEN 1 ELSE 0 END;
|
|
|
|
RETURN @isA;
|
|
|
|
END |