This commit is contained in:
2024-03-21 17:47:57 +01:00
commit 9b7b684dc4
84 changed files with 6990 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_EB2B_CREATED] Script Date: 21.03.2024 16:58:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[VWCUST_EB2B_CREATED] as
SELECT
ba.dwDocID as DOC_ID,
'STANDARD' as Outputfilename,
CAST(CAST(ba.dwCreationDate as CHAR(10)) as DATE) as CreationDate
FROM
windream60.dbo.BaseAttributes ba LEFT JOIN TBCUST_PM_RPT_CREATED REF ON ba.dwDocID = REF.DocID
WHERE
DATEPART(YEAR,CAST(CAST(ba.dwCreationDate as CHAR(10)) as DATE)) > 2022 AND
--ba.dwDocID in (741833,740744) AND
ba.sztext37 = 'Eingangsrechnung' AND
ba.szText33 = 'erledigt' AND
ba.szFile_Ext = '.PDF' AND
ba.dwDate04 is not null AND
LEFT(ba.szLongName,6) = 'ERE_ER' AND
REF.DocID IS NULL
GO

View File

@@ -0,0 +1,57 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_NAVISION_COST_UNITS] Script Date: 21.03.2024 16:58:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- TSQL View für die Ausgabe von Kostenstellen
--14.07.2023 Anpassen der Views
-- Stand: MK // 23.09.2021
-- 23.09.2021 - initial
CREATE view [dbo].[VWCUST_NAVISION_COST_UNITS]
as
SELECT TOP 1000000 'SB-Abwasserbetrieb' as 'Mandant'
,[Code] as 'Kostenstelle'
,[Name]
FROM --[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Abwasserbetrieb d_ Stadt Bebra$Dimension Value]
[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Abwasserbetrieb d_ Stadt Bebra$Dimension Value$437dbf0e-84ff-417a-965d-ed2bb9650972]
UNION ----------------------------------------------------------------------
SELECT TOP 1000000 'SB-Bäderbetrieb' as 'Mandant'
,[Code] as 'Kostenstelle'
,[Name]
FROM --[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Bäderbetrieb der Stadt Bebra$Dimension Value]
[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Bäderbetrieb der Stadt Bebra$Dimension Value$437dbf0e-84ff-417a-965d-ed2bb9650972]
UNION ----------------------------------------------------------------------
SELECT TOP 1000000'SWB-Netz' as 'Mandant'
,[Code] as 'Kostenstelle'
,[Name]
FROM --[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[STW Bebra GmbH inkl Netz$Dimension Value]
[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[STW Bebra GmbH inkl Netz$Dimension Value$437dbf0e-84ff-417a-965d-ed2bb9650972]
UNION ----------------------------------------------------------------------
SELECT TOP 1000000 'SWB-Vertrieb' as 'Mandant'
,[Code] as 'Kostenstelle'
,[Name]
FROM --[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Vertrieb STW Bebra$Dimension Value]
[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Vertrieb STW Bebra$Dimension Value$437dbf0e-84ff-417a-965d-ed2bb9650972]
ORDER BY Mandant, Kostenstelle ASC
GO

View File

@@ -0,0 +1,54 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_NAVISION_IMPERSONAL_ACCOUNT] Script Date: 21.03.2024 16:59:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- TSQL View um Sachkonten aus NAV abzurufen
-- 14.07.2023 - MS - Update BC ID
-- 23.09.2021 - initial
CREATE view [dbo].[VWCUST_NAVISION_IMPERSONAL_ACCOUNT]
as
SELECT TOP 1000000
'SB-Abwasserbetrieb' as 'Mandant'
,[No_] as 'Sachkonto'
,[Name] as 'Bezeichnung'
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Abwasserbetrieb d_ Stadt Bebra$G_L Account$437dbf0e-84ff-417a-965d-ed2bb9650972]
UNION -------------------------------------------------------------------
SELECT TOP 1000000
'SB-Bäderbetrieb' as 'Mandant'
,[No_] as 'Sachkonto'
,[Name] as 'Bezeichnung'
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Bäderbetrieb der Stadt Bebra$G_L Account$437dbf0e-84ff-417a-965d-ed2bb9650972]
UNION -------------------------------------------------------------------
SELECT TOP 1000000
'SWB-Netz' as 'Mandant'
,[No_] as 'Sachkonto'
,[Name] as 'Bezeichnung'
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[STW Bebra GmbH inkl Netz$G_L Account$437dbf0e-84ff-417a-965d-ed2bb9650972]
UNION -------------------------------------------------------------------
SELECT TOP 1000000
'SWB-Vertrieb' as 'Mandant'
,[No_] as 'Sachkonto'
,[Name] as 'Bezeichnung'
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Vertrieb STW Bebra$G_L Account$437dbf0e-84ff-417a-965d-ed2bb9650972]
ORDER BY Mandant, Sachkonto ASC
GO

View File

@@ -0,0 +1,49 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_NAVISION_MANDATORS] Script Date: 21.03.2024 16:59:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- T-SQL View um NAV Mandanten standardisiert darzustellen (als Einschränkung für weitere Views benötigt)
-- Stand: MK // 22.09.2021
-- 22.09.2021 - "Stadtentwicklung Bebra GmbH" entfernt, da seit 2016 inaktiv
-- 20.09.2021 - initial
CREATE view [dbo].[VWCUST_NAVISION_MANDATORS]
as
SELECT
CASE
When [companyname] = 'Abwasserbetrieb d. Stadt Bebra' Then 'SB-Abwasserbetrieb'
When [companyname] = 'Bäderbetrieb der Stadt Bebra' Then 'SB-Bäderbetrieb'
-- When [companyname] = 'Stadtentwicklung Bebra GmbH' Then 'SB-Stadtentwicklung'
When [companyname] = 'STW Bebra GmbH inkl Netz' Then 'SWB-Netz'
When [companyname] = 'Vertrieb STW Bebra' Then 'SWB-Vertrieb'
End as 'Mandant',
[companyname] as 'NAV-Mandant',
CASE
When [companyname] = 'Abwasserbetrieb d. Stadt Bebra' Then 'Abwasserbetrieb d_ Stadt Bebra'
When [companyname] = 'Bäderbetrieb der Stadt Bebra' Then 'Bäderbetrieb der Stadt Bebra'
-- When [companyname] = 'Stadtentwicklung Bebra GmbH' Then 'Stadtentwicklung Bebra GmbH'
When [companyname] = 'STW Bebra GmbH inkl Netz' Then 'STW Bebra GmbH inkl Netz'
When [companyname] = 'Vertrieb STW Bebra' Then 'Vertrieb STW Bebra'
End as 'NAV-Tabellen-Präfix'
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[$ndo$tenantcompany]
WHERE [$companyid] > 1000 and [$companyid] <> 1012
GO

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_NAVISION_TASKNRS] Script Date: 21.03.2024 17:01:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- TSQL View um Arbeitsaufträge aus NAV abzurufen
-- 14.07.2023 - Update BC
-- 01.12.2021 - Abfrage auf "nur Aufträge in Ausführung" ([WOStateValue]) beschränkt
-- 23.09.2021 - Order by eingebaut
-- 22.09.2021 - initial
CREATE view [dbo].[VWCUST_NAVISION_TASKNRS]
as
SELECT TOP 1000000 'SB-Abwasserbetrieb' as 'Mandant'
,[No_] as 'Auftragsnummer'
,[Description] as 'Beschreibung'
,[Description 2] as 'Beschreibung 2'
,[Description 3] as 'Beschreibung 3'
FROM --[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Abwasserbetrieb d_ Stadt Bebra$Work Order Header]
[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Abwasserbetrieb d_ Stadt Bebra$Work Order Header$dd2404d3-f489-4ae2-8f51-232ea4d4f649]
WHERE [WOStateValue] = 200 -- 200 = Ausführung; 300 = Fertig; 400 = ?
UNION
SELECT TOP 1000000 'SB-Bäderbetrieb' as 'Mandant'
,[No_] as 'Auftragsnummer'
,[Description] as 'Beschreibung'
,[Description 2] as 'Beschreibung 2'
,[Description 3] as 'Beschreibung 3'
FROM --[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Bäderbetrieb der Stadt Bebra$Work Order Header]
[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Bäderbetrieb der Stadt Bebra$Work Order Header$dd2404d3-f489-4ae2-8f51-232ea4d4f649]
WHERE [WOStateValue] = 200 -- 200 = Ausführung; 300 = Fertig; 400 = ?
UNION
SELECT TOP 1000000 'SWB-Netz' as 'Mandant'
,[No_] as 'Auftragsnummer'
,[Description] as 'Beschreibung'
,[Description 2] as 'Beschreibung 2'
,[Description 3] as 'Beschreibung 3'
FROM --[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[STW Bebra GmbH inkl Netz$Work Order Header]
[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[STW Bebra GmbH inkl Netz$Work Order Header$dd2404d3-f489-4ae2-8f51-232ea4d4f649]
WHERE [WOStateValue] = 200 -- 200 = Ausführung; 300 = Fertig; 400 = ?
UNION
SELECT TOP 1000000 'SWB-Vertrieb' as 'Mandant'
,[No_] as 'Auftragsnummer'
,[Description] as 'Beschreibung'
,[Description 2] as 'Beschreibung 2'
,[Description 3] as 'Beschreibung 3'
FROM --[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Vertrieb STW Bebra$Work Order Header]
[NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Vertrieb STW Bebra$Work Order Header$dd2404d3-f489-4ae2-8f51-232ea4d4f649]
WHERE [WOStateValue] = 200 -- 200 = Ausführung; 300 = Fertig; 400 = ?
ORDER BY Mandant, Auftragsnummer ASC
GO

View File

@@ -0,0 +1,503 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_NAVISION_VENDORACCOUNTS] Script Date: 21.03.2024 17:01:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- 14.07.2023 MS Update BC ID
-- 10.01.2022 Ergänzung IBAN per join
-- 23.09.2021 Order by eingebaut
-- 22.09.2021 "Stadtentwicklung Bebra GmbH" entfernt, da seit 2016 inaktiv
-- 20.09.2021 initial
CREATE view [dbo].[VWCUST_NAVISION_VENDORACCOUNTS]
as
SELECT TOP 1000000
'SB-Abwasserbetrieb' as 'Mandant'
,[V].[No_] as 'LieferantenNr'
,[V].[Name]
,[VBA].[IBAN] as 'Pay-to IBAN'
,[V].[Search Name]
,[V].[Name 2]
,[V].[Address]
,[V].[Address 2]
,[V].[City]
,[V].[Contact]
,[V].[Phone No_]
,[V].[Telex No_]
,[V].[Our Account No_]
,[V].[Territory Code]
,[V].[Global Dimension 1 Code]
,[V].[Global Dimension 2 Code]
,[V].[Budgeted Amount]
,[V].[Vendor Posting Group]
,[V].[Currency Code]
,[V].[Language Code]
,[V].[Statistics Group]
,[V].[Payment Terms Code]
,[V].[Fin_ Charge Terms Code]
,[V].[Purchaser Code]
,[V].[Shipment Method Code]
,[V].[Shipping Agent Code]
,[V].[Invoice Disc_ Code]
,[V].[Country_Region Code]
,[V].[Blocked]
,[V].[Pay-to Vendor No_]
,[V].[Priority]
,[V].[Payment Method Code]
,[V].[Last Date Modified]
,[V].[Application Method]
,[V].[Prices Including VAT]
,[V].[Fax No_]
,[V].[Telex Answer Back]
,[V].[VAT Registration No_]
,[V].[Gen_ Bus_ Posting Group]
,[V].[GLN]
,[V].[Post Code]
,[V].[County]
,[V].[E-Mail]
,[V].[Home Page]
,[V].[No_ Series]
,[V].[Tax Area Code]
,[V].[Tax Liable]
,[V].[VAT Bus_ Posting Group]
,[V].[Block Payment Tolerance]
,[V].[IC Partner Code]
,[V].[Prepayment _]
,[V].[Partner Type]
,[V].[Privacy Blocked]
,[V].[Creditor No_]
,[V].[Preferred Bank Account Code]
,[V].[Cash Flow Payment Terms Code]
,[V].[Primary Contact No_]
,[V].[Responsibility Center]
,[V].[Location Code]
,[V].[Lead Time Calculation]
,[V].[Base Calendar Code]
,[V].[Registration No_]
,[V].[OU]
,[V].[OU Code]
,[V].[No_ Entries for Avis]
,[V].[Direction Code]
,[V].[Payment Type]
,[V].[Delivery Reminder Terms]
,[V].[VU Person No_]
,[V].[Pers_ Salutation]
,[V].[Title]
,[V].[First Name]
,[V].[Lowest Order Value]
,[V].[Industry Group]
,[V].[Quality Mgt_]
,[V].[QM Certificate valid till]
,[V].[Work Safety Mgt_]
,[V].[WS Certificate valid till]
,[V].[Ecology Mgt_]
,[V].[EC Certificate valid till]
,[V].[Energy Mgt_]
,[V].[EN Certificate valid till]
,[V].[Outside Company Training]
,[V].[OC Training valid till]
,[V].[Secrecy Aggreement]
,[V].[SE Aggreement valid till]
,[V].[Payment Terms Code (IR)]
,[V].[Exemption answer]
,[V].[Exemption answer valid to]
,[V].[Exemption answer re-submission]
,[V].[Responsibly Tax office]
,[V].[Reference to exemption answer]
,[V].[Days before expiration E_ a_]
,[V].[Safety No_]
,[V].[Concern Elimination]
,[V].[Elimination ShortcutDimCode]
,[V].[Customizing WO]
,[V].[Customizing WO valid till]
,[V].[Last Modified Date Time]
,[V].[Disable Search by Name]
,[V].[Document Sending Profile]
,[V].[Validate EU Vat Reg_ No_]
,[V].[Id]
,[V].[Currency Id]
,[V].[Payment Terms Id]
,[V].[Payment Method Id]
,[V].[Information Security]
,[V].[Information Security valid to]
,[V].[Security Clause]
,[V].[Security Clause valid to]
,[V].[ISMS]
,[V].[ISMS valid to]
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Abwasserbetrieb d_ Stadt Bebra$Vendor$437dbf0e-84ff-417a-965d-ed2bb9650972] as [V]
LEFT JOIN [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Abwasserbetrieb d_ Stadt Bebra$Vendor Bank Account$437dbf0e-84ff-417a-965d-ed2bb9650972] as [VBA] (NOLOCK) ON [V].[No_] = [VBA].[Vendor No_]
WHERE LEN([V].[Name]) > 1
UNION ------------------------------------------------------------------------------------
SELECT TOP 1000000
'SB-Bäderbetrieb' as 'Mandant'
,[V].[No_] as 'LieferantenNr'
,[V].[Name]
,[VBA].[IBAN] as 'Pay-to IBAN'
,[V].[Search Name]
,[V].[Name 2]
,[V].[Address]
,[V].[Address 2]
,[V].[City]
,[V].[Contact]
,[V].[Phone No_]
,[V].[Telex No_]
,[V].[Our Account No_]
,[V].[Territory Code]
,[V].[Global Dimension 1 Code]
,[V].[Global Dimension 2 Code]
,[V].[Budgeted Amount]
,[V].[Vendor Posting Group]
,[V].[Currency Code]
,[V].[Language Code]
,[V].[Statistics Group]
,[V].[Payment Terms Code]
,[V].[Fin_ Charge Terms Code]
,[V].[Purchaser Code]
,[V].[Shipment Method Code]
,[V].[Shipping Agent Code]
,[V].[Invoice Disc_ Code]
,[V].[Country_Region Code]
,[V].[Blocked]
,[V].[Pay-to Vendor No_]
,[V].[Priority]
,[V].[Payment Method Code]
,[V].[Last Date Modified]
,[V].[Application Method]
,[V].[Prices Including VAT]
,[V].[Fax No_]
,[V].[Telex Answer Back]
,[V].[VAT Registration No_]
,[V].[Gen_ Bus_ Posting Group]
,[V].[GLN]
,[V].[Post Code]
,[V].[County]
,[V].[E-Mail]
,[V].[Home Page]
,[V].[No_ Series]
,[V].[Tax Area Code]
,[V].[Tax Liable]
,[V].[VAT Bus_ Posting Group]
,[V].[Block Payment Tolerance]
,[V].[IC Partner Code]
,[V].[Prepayment _]
,[V].[Partner Type]
,[V].[Privacy Blocked]
,[V].[Creditor No_]
,[V].[Preferred Bank Account Code]
,[V].[Cash Flow Payment Terms Code]
,[V].[Primary Contact No_]
,[V].[Responsibility Center]
,[V].[Location Code]
,[V].[Lead Time Calculation]
,[V].[Base Calendar Code]
,[V].[Registration No_]
,[V].[OU]
,[V].[OU Code]
,[V].[No_ Entries for Avis]
,[V].[Direction Code]
,[V].[Payment Type]
,[V].[Delivery Reminder Terms]
,[V].[VU Person No_]
,[V].[Pers_ Salutation]
,[V].[Title]
,[V].[First Name]
,[V].[Lowest Order Value]
,[V].[Industry Group]
,[V].[Quality Mgt_]
,[V].[QM Certificate valid till]
,[V].[Work Safety Mgt_]
,[V].[WS Certificate valid till]
,[V].[Ecology Mgt_]
,[V].[EC Certificate valid till]
,[V].[Energy Mgt_]
,[V].[EN Certificate valid till]
,[V].[Outside Company Training]
,[V].[OC Training valid till]
,[V].[Secrecy Aggreement]
,[V].[SE Aggreement valid till]
,[V].[Payment Terms Code (IR)]
,[V].[Exemption answer]
,[V].[Exemption answer valid to]
,[V].[Exemption answer re-submission]
,[V].[Responsibly Tax office]
,[V].[Reference to exemption answer]
,[V].[Days before expiration E_ a_]
,[V].[Safety No_]
,[V].[Concern Elimination]
,[V].[Elimination ShortcutDimCode]
,[V].[Customizing WO]
,[V].[Customizing WO valid till]
,[V].[Last Modified Date Time]
,[V].[Disable Search by Name]
,[V].[Document Sending Profile]
,[V].[Validate EU Vat Reg_ No_]
,[V].[Id]
,[V].[Currency Id]
,[V].[Payment Terms Id]
,[V].[Payment Method Id]
,[V].[Information Security]
,[V].[Information Security valid to]
,[V].[Security Clause]
,[V].[Security Clause valid to]
,[V].[ISMS]
,[V].[ISMS valid to]
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Bäderbetrieb der Stadt Bebra$Vendor$437dbf0e-84ff-417a-965d-ed2bb9650972] as [V]
LEFT JOIN [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Bäderbetrieb der Stadt Bebra$Vendor Bank Account$437dbf0e-84ff-417a-965d-ed2bb9650972] as [VBA] (NOLOCK) ON [V].[No_] = [VBA].[Vendor No_]
WHERE LEN([V].[Name]) > 1
UNION ------------------------------------------------------------------------------------
SELECT TOP 1000000
'SWB-Netz' as 'Mandant'
,[V].[No_] as 'LieferantenNr'
,[V].[Name]
,[VBA].[IBAN] as 'Pay-to IBAN'
,[V].[Search Name]
,[V].[Name 2]
,[V].[Address]
,[V].[Address 2]
,[V].[City]
,[V].[Contact]
,[V].[Phone No_]
,[V].[Telex No_]
,[V].[Our Account No_]
,[V].[Territory Code]
,[V].[Global Dimension 1 Code]
,[V].[Global Dimension 2 Code]
,[V].[Budgeted Amount]
,[V].[Vendor Posting Group]
,[V].[Currency Code]
,[V].[Language Code]
,[V].[Statistics Group]
,[V].[Payment Terms Code]
,[V].[Fin_ Charge Terms Code]
,[V].[Purchaser Code]
,[V].[Shipment Method Code]
,[V].[Shipping Agent Code]
,[V].[Invoice Disc_ Code]
,[V].[Country_Region Code]
,[V].[Blocked]
,[V].[Pay-to Vendor No_]
,[V].[Priority]
,[V].[Payment Method Code]
,[V].[Last Date Modified]
,[V].[Application Method]
,[V].[Prices Including VAT]
,[V].[Fax No_]
,[V].[Telex Answer Back]
,[V].[VAT Registration No_]
,[V].[Gen_ Bus_ Posting Group]
,[V].[GLN]
,[V].[Post Code]
,[V].[County]
,[V].[E-Mail]
,[V].[Home Page]
,[V].[No_ Series]
,[V].[Tax Area Code]
,[V].[Tax Liable]
,[V].[VAT Bus_ Posting Group]
,[V].[Block Payment Tolerance]
,[V].[IC Partner Code]
,[V].[Prepayment _]
,[V].[Partner Type]
,[V].[Privacy Blocked]
,[V].[Creditor No_]
,[V].[Preferred Bank Account Code]
,[V].[Cash Flow Payment Terms Code]
,[V].[Primary Contact No_]
,[V].[Responsibility Center]
,[V].[Location Code]
,[V].[Lead Time Calculation]
,[V].[Base Calendar Code]
,[V].[Registration No_]
,[V].[OU]
,[V].[OU Code]
,[V].[No_ Entries for Avis]
,[V].[Direction Code]
,[V].[Payment Type]
,[V].[Delivery Reminder Terms]
,[V].[VU Person No_]
,[V].[Pers_ Salutation]
,[V].[Title]
,[V].[First Name]
,[V].[Lowest Order Value]
,[V].[Industry Group]
,[V].[Quality Mgt_]
,[V].[QM Certificate valid till]
,[V].[Work Safety Mgt_]
,[V].[WS Certificate valid till]
,[V].[Ecology Mgt_]
,[V].[EC Certificate valid till]
,[V].[Energy Mgt_]
,[V].[EN Certificate valid till]
,[V].[Outside Company Training]
,[V].[OC Training valid till]
,[V].[Secrecy Aggreement]
,[V].[SE Aggreement valid till]
,[V].[Payment Terms Code (IR)]
,[V].[Exemption answer]
,[V].[Exemption answer valid to]
,[V].[Exemption answer re-submission]
,[V].[Responsibly Tax office]
,[V].[Reference to exemption answer]
,[V].[Days before expiration E_ a_]
,[V].[Safety No_]
,[V].[Concern Elimination]
,[V].[Elimination ShortcutDimCode]
,[V].[Customizing WO]
,[V].[Customizing WO valid till]
,[V].[Last Modified Date Time]
,[V].[Disable Search by Name]
,[V].[Document Sending Profile]
,[V].[Validate EU Vat Reg_ No_]
,[V].[Id]
,[V].[Currency Id]
,[V].[Payment Terms Id]
,[V].[Payment Method Id]
,[V].[Information Security]
,[V].[Information Security valid to]
,[V].[Security Clause]
,[V].[Security Clause valid to]
,[V].[ISMS]
,[V].[ISMS valid to]
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[STW Bebra GmbH inkl Netz$Vendor$437dbf0e-84ff-417a-965d-ed2bb9650972] as [V]
LEFT JOIN [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[STW Bebra GmbH inkl Netz$Vendor Bank Account$437dbf0e-84ff-417a-965d-ed2bb9650972] as [VBA] (NOLOCK) ON [V].[No_] = [VBA].[Vendor No_]
WHERE LEN([V].[Name]) > 1
UNION ------------------------------------------------------------------------------------
SELECT TOP 1000000
'SWB-Vertrieb' as 'Mandant'
,[V].[No_] as 'LieferantenNr'
,[V].[Name]
,[VBA].[IBAN] as 'Pay-to IBAN'
,[V].[Search Name]
,[V].[Name 2]
,[V].[Address]
,[V].[Address 2]
,[V].[City]
,[V].[Contact]
,[V].[Phone No_]
,[V].[Telex No_]
,[V].[Our Account No_]
,[V].[Territory Code]
,[V].[Global Dimension 1 Code]
,[V].[Global Dimension 2 Code]
,[V].[Budgeted Amount]
,[V].[Vendor Posting Group]
,[V].[Currency Code]
,[V].[Language Code]
,[V].[Statistics Group]
,[V].[Payment Terms Code]
,[V].[Fin_ Charge Terms Code]
,[V].[Purchaser Code]
,[V].[Shipment Method Code]
,[V].[Shipping Agent Code]
,[V].[Invoice Disc_ Code]
,[V].[Country_Region Code]
,[V].[Blocked]
,[V].[Pay-to Vendor No_]
,[V].[Priority]
,[V].[Payment Method Code]
,[V].[Last Date Modified]
,[V].[Application Method]
,[V].[Prices Including VAT]
,[V].[Fax No_]
,[V].[Telex Answer Back]
,[V].[VAT Registration No_]
,[V].[Gen_ Bus_ Posting Group]
,[V].[GLN]
,[V].[Post Code]
,[V].[County]
,[V].[E-Mail]
,[V].[Home Page]
,[V].[No_ Series]
,[V].[Tax Area Code]
,[V].[Tax Liable]
,[V].[VAT Bus_ Posting Group]
,[V].[Block Payment Tolerance]
,[V].[IC Partner Code]
,[V].[Prepayment _]
,[V].[Partner Type]
,[V].[Privacy Blocked]
,[V].[Creditor No_]
,[V].[Preferred Bank Account Code]
,[V].[Cash Flow Payment Terms Code]
,[V].[Primary Contact No_]
,[V].[Responsibility Center]
,[V].[Location Code]
,[V].[Lead Time Calculation]
,[V].[Base Calendar Code]
,[V].[Registration No_]
,[V].[OU]
,[V].[OU Code]
,[V].[No_ Entries for Avis]
,[V].[Direction Code]
,[V].[Payment Type]
,[V].[Delivery Reminder Terms]
,[V].[VU Person No_]
,[V].[Pers_ Salutation]
,[V].[Title]
,[V].[First Name]
,[V].[Lowest Order Value]
,[V].[Industry Group]
,[V].[Quality Mgt_]
,[V].[QM Certificate valid till]
,[V].[Work Safety Mgt_]
,[V].[WS Certificate valid till]
,[V].[Ecology Mgt_]
,[V].[EC Certificate valid till]
,[V].[Energy Mgt_]
,[V].[EN Certificate valid till]
,[V].[Outside Company Training]
,[V].[OC Training valid till]
,[V].[Secrecy Aggreement]
,[V].[SE Aggreement valid till]
,[V].[Payment Terms Code (IR)]
,[V].[Exemption answer]
,[V].[Exemption answer valid to]
,[V].[Exemption answer re-submission]
,[V].[Responsibly Tax office]
,[V].[Reference to exemption answer]
,[V].[Days before expiration E_ a_]
,[V].[Safety No_]
,[V].[Concern Elimination]
,[V].[Elimination ShortcutDimCode]
,[V].[Customizing WO]
,[V].[Customizing WO valid till]
,[V].[Last Modified Date Time]
,[V].[Disable Search by Name]
,[V].[Document Sending Profile]
,[V].[Validate EU Vat Reg_ No_]
,[V].[Id]
,[V].[Currency Id]
,[V].[Payment Terms Id]
,[V].[Payment Method Id]
,[V].[Information Security]
,[V].[Information Security valid to]
,[V].[Security Clause]
,[V].[Security Clause valid to]
,[V].[ISMS]
,[V].[ISMS valid to]
FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Vertrieb STW Bebra$Vendor$437dbf0e-84ff-417a-965d-ed2bb9650972] as [V]
LEFT JOIN [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Vertrieb STW Bebra$Vendor Bank Account$437dbf0e-84ff-417a-965d-ed2bb9650972] as [VBA] (NOLOCK) ON [V].[No_] = [VBA].[Vendor No_]
WHERE LEN([V].[Name]) > 1
ORDER BY Mandant, No_ ASC
GO

View File

@@ -0,0 +1,16 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_NI_NAVISION_VENDOR] Script Date: 21.03.2024 17:02:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[VWCUST_NI_NAVISION_VENDOR] AS
SELECT DISTINCT Name,LieferantenNr
FROM [VWCUST_NAVISION_VENDORACCOUNTS]
GO

View File

@@ -0,0 +1,56 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_PM_PROFILE_TODO] Script Date: 21.03.2024 17:03:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- DIE FUNKTION "[PRCUST_CREATE_PM_REMINDER_MAILS]" UND DER VIEW [VWCUST_PM_PROFILE_TODO] WERDEN AKTUELL NICHT VERWENDET! STAND 31.10.2021
-- TSQL View provides procedure with the data/ the info which users should be informed
-- Stand: MK // 25.10.2021
CREATE VIEW [dbo].[VWCUST_PM_PROFILE_TODO]
AS
SELECT
LOWER(T5.EMAIL) as Email,
Count(T1.DOC_ID) Anzahl,
T1.PROFIL_ID AS ProfileID,
T2.TITLE,
'Aufgabe' as PType,
Case T1.PROFIL_ID
When 1 then 1
else 4
end as OSequence
FROM [TBPM_PROFILE_FILES] as [T1]
INNER JOIN [TBPM_PROFILE] as [T2] ON T1.PROFIL_ID = T2.GUID
INNER JOIN [windream60].[dbo].[BaseAttributes] as [T3] ON T1.DOC_ID = T3.dwDocID
INNER JOIN [TBPM_PROFILE_USER] as T4 ON T2.GUID = T4.PROFIL_ID
INNER JOIN [TBDD_USER] as T5 ON T4.USER_ID = T5.GUID
WHERE
T3.sztext22 = t5.USERNAME and
T1.DOC_ID not in (SELECT DOC_ID FROM TBPM_PROFILE_FILES WHERE ACTIVE = 0 or IN_WORK = 1 or EDIT = 1)
GROUP BY LOWER(T5.EMAIL),T1.PROFIL_ID, T2.TITLE
-- Tabelle gefüllt mit:
-- INSERT INTO [DD_ECM].[dbo].[TBPM_PROFILE_USER]([PROFIL_ID],[USER_ID])
-- SELECT 4 as [PROFIL_ID], [GUID] as [USER_ID]
-- FROM [TBDD_USER]
-- WHERE [name] not in ('Schellhase','') and len(email) > 2
GO

View File

@@ -0,0 +1,25 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_RPTERGEBNISBERICHT] Script Date: 21.03.2024 17:04:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[VWCUST_RPTERGEBNISBERICHT] as
SELECT
T.*,
T1.Prozessschritt,
T1.Durch,
T1.Status_Change,
T1.Wann wannPos,
T1.Kommentar
FROM
VWCUST_RPTERGEBNISBERICHT_HEAD T INNER JOIN VWCUST_RPTERGEBNISBERICHT_POS T1 ON T.DocID = T1.DocID
--WHERE
--T.DocID = 785040
GO

View File

@@ -0,0 +1,48 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_RPTERGEBNISBERICHT_HEAD] Script Date: 21.03.2024 17:04:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[VWCUST_RPTERGEBNISBERICHT_HEAD] as
SELECT DISTINCT
BA.dwDocID as DocID,
CONVERT(date,COALESCE(EML.EMAIL_DATE,CAST(CONVERT(varchar(20),ba.decCreationTime) as CHAR(8)))) [DatumIn],
CONVERT(date,CAST(ba.dwdate09 AS char(8))) AS Belegdatum,
vec_KRED.szValue as KreditorNummer,
ba.sztext08 AS KreditorName_Lang,
ba.sztext08 AS KreditorName,
ba.sztext19 as RechnungNr,
COALESCE(ba.sztext36,'NONE') as Referenz,
ba.lfFloat10 as Nettobetrag,
ba.lfFloat11 as Bruttobetrag,
'1999-12-24' Zahlungsziel,
'4711' as Mandant,
'Mandant1' as [Mandant Name],
'4711' as Kostenstelle,
'4712' as BestellNr,
COALESCE(eml.EMAIL_FROM,'') as Absender,
'' as [Finaler Freigeber]
FROM
windream60.dbo.BaseAttributes BA LEFT join
TBEMLP_HISTORY EML ON BA.szText07 = EML.EMAIL_MSGID LEFT join
(Select dwDocID, szValue From windream60.dbo.Vector where dwAttrID = 10010) vec_KRED ON BA.dwDocID = vec_KRED.dwDocID
-- WHERE
-- ba.dwDocID = 785040
GO

View File

@@ -0,0 +1,35 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_RPTERGEBNISBERICHT_POS] Script Date: 21.03.2024 17:05:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[VWCUST_RPTERGEBNISBERICHT_POS] as
SELECT
--4712 as DocID,
--'Fachliche Freigabe' as Prozessschritt,
--'CHAPPE' as Durch,
--'Ja' Status_Change,
--convert(Datetime,'2019-12-17 12:32:27',120) Wann
--,'' Kommentar
dwDocID as DocID,
(SELECT Data FROM FNDD_SPLIT_STRING(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(szValue,'SWB - ER 1.0 - ',''),'SWB - ER ',''),'3.0 - ',''),'4.0 - ',''),'5.0 - ',''),'~') WHERE SequentialOrder = 5) as Prozessschritt,
(SELECT Data FROM FNDD_SPLIT_STRING(REPLACE(REPLACE(szValue,'PMProfile loaded: [',''),']','') ,'~') where SequentialOrder = 1) as Durch,
(SELECT Data FROM FNDD_SPLIT_STRING(REPLACE(REPLACE(szValue,'PMProfile loaded: [',''),']','') ,'~') where SequentialOrder = 2) Status_Change,
(SELECT Data FROM FNDD_SPLIT_STRING(szValue,'~') where SequentialOrder = 4) Wann,
'' Kommentar
FROM
windream60.dbo.Vector
where
--dwDocID = 785040 and
dwAttrID = 10040
GO

View File

@@ -0,0 +1,30 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_RPTERGEBNISBERICHT_POS_KONTIERUNG] Script Date: 21.03.2024 17:05:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[VWCUST_RPTERGEBNISBERICHT_POS_KONTIERUNG] as
SELECT
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 1) as 'AuftragNr',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 2) as 'Kostenstelle',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 3) as 'Sachkonto',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 4) as 'Lagermaterial',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 5) as 'Nettobetrag',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 6) as 'Steuerschlüssel',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 7) as 'Bruttobetrag',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 8) as 'Geschäftsbereich',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 9) as 'S/H',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 10) as 'Option'
FROM
windream60.dbo.Vector
where
dwAttrID = 10041
--and dwDocID = 752928
GO

View File

@@ -0,0 +1,34 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_RPT_EB_POS_KONTIERUNG] Script Date: 21.03.2024 17:03:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[VWCUST_RPT_EB_POS_KONTIERUNG] as
SELECT
dwDocID as DocID,
dwRow,
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 1) as 'AuftragNr',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 2) as 'Kostenstelle',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 3) as 'Sachkonto',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 4) as 'Lagermaterial',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 5) as 'Nettobetrag',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 6) as 'Steuerschlüssel',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 7) as 'Bruttobetrag',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 8) as 'Geschäftsbereich',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 9) as 'S/H',
(SELECT Data FROM FNDD_SPLIT_STRING(szValue ,'~') where SequentialOrder = 10) as 'Option'
FROM
windream60.dbo.Vector
where
dwAttrID = 10041
GO

View File

@@ -0,0 +1,46 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_STAMP] Script Date: 21.03.2024 17:06:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[VWCUST_STAMP] AS
--SELECT 'FF' FG_TYP,4711 as DocID, 'm.schreiber@honey.de' as Email, 'Ja' as Freigabe, convert(Datetime,'2019-12-17 12:40:25',120) Wann
--UNION
--SELECT 'VA' FG_TYP,4711 as DocID, 'n.schreiber@honey.de' as Email, 'Ja' as Freigabe, convert(Datetime,'2019-12-17 12:32:40',120) Wann
--UNION
--SELECT 'VA' FG_TYP,4711 as DocID, 'v.schreiber@honey.de' as Email, 'Ja' as Freigabe, convert(Datetime,'2019-12-17 12:28:19',120) Wann
--UNION
--SELECT 'FF' FG_TYP,4712 as DocID, 'm.Kamm@dd-works.de' as Email, 'Ja' as Freigabe, convert(Datetime,'2019-12-17 12:40:25',120) Wann
--UNION
--SELECT 'VA' FG_TYP,4712 as DocID, 'v.feygin@ukraina.de' as Email, 'Ja' as Freigabe, convert(Datetime,'2019-12-16 12:11:08',120) Wann
--UNION
--SELECT 'VA' FG_TYP,4712 as DocID, 'j.hoss@karate.de' as Email, 'Ja' as Freigabe, convert(Datetime,'2019-12-14 11:28:23',120) Wann
--UNION
--SELECT 'VA' FG_TYP,4712 as DocID, 'a.treubenbach@stitching.de' as Email, 'Ja' as Freigabe, convert(Datetime,'2019-12-13 18:28:23',120) Wann
--GO
SELECT
Vec.dwDocID as DocID,
(SELECT Data FROM FNDD_SPLIT_STRING(Vec.szvalue,'~') where SequentialOrder = 1) as Email,
(SELECT Data FROM FNDD_SPLIT_STRING(Vec.szvalue,'~') where SequentialOrder = 2) as [Freigabe],
(SELECT Data FROM FNDD_SPLIT_STRING(Vec.szvalue,'~') where SequentialOrder = 5) as [FG_TYP],
(SELECT Data FROM FNDD_SPLIT_STRING(Vec.szvalue,'~') where SequentialOrder = 4) as [Wann]
FROM
windream60.dbo.Vector Vec
WHERE
--vec.dwDocID = 741833 AND
vec.dwAttrID = 10040 AND
SUBSTRING((SELECT Data FROM FNDD_SPLIT_STRING(Vec.szvalue,'~') where SequentialOrder = 5),7,6) IN ('ER 4.0','ER 2.0')
-- select * from windream60.dbo.Vector where dwDocID = 785040 and dwAttrID = 10040
GO

View File

@@ -0,0 +1,32 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_SUGGESTED_APPROVER] Script Date: 21.03.2024 17:06:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- TSQL View Zur Ermittlung des des vorschlags Prüfers für gewisse Kreditoren
-- Stand: MK // 30.09.2021
CREATE view [dbo].[VWCUST_SUGGESTED_APPROVER] as
SELECT [T].[GUID]
,[T].[CREDITOR_NR]
,[T].[USER_ID]
,[T2].[USERNAME]
,[T].[GROUP_ID]
,[T].[COMMENT]
,[T].[ADDED_WHO]
,[T].[ADDED_WHEN]
,[T].[CHANGED_WHO]
,[T].[CHANGED_WHEN]
FROM [DD_ECM].[dbo].[TBCUST_SUGGESTED_APPROVER] as [T]
INNER JOIN [TBDD_USER] as [T2] ON [T].[USER_ID] = [T2].[GUID]
GO

View File

@@ -0,0 +1,40 @@
USE [DD_ECM]
GO
/****** Object: View [dbo].[VWCUST_USER_REPRESENTATION] Script Date: 21.03.2024 17:07:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** Skript für SelectTopNRows-Befehl aus SSMS ******/
-- Stand: MK // 17.09.2021
-- 17.09.2021 - initial
CREATE view [dbo].[VWCUST_USER_REPRESENTATION]
as
SELECT
[TBDD_USER_REPRESENTATION].[GUID]
,[USER_ID]
,[TBDD_USER].[USERNAME] as [USERNAME]
,[REPR_USER]
,[REPR_GROUP]
,[REPR_GROUP].[NAME] as [REPR_GROUPNAME]
,[RIGHT_GROUP]
,[RIGHT_GROUP].[NAME] as [RIGHT_GROUPNAME]
,[TBDD_USER_REPRESENTATION].[ADDED_WHO]
,[TBDD_USER_REPRESENTATION].[ADDED_WHEN]
,[TBDD_USER_REPRESENTATION].[CHANGED_WHO]
,[TBDD_USER_REPRESENTATION].[CHANGED_WHEN]
FROM [DD_ECM].[dbo].[TBDD_USER_REPRESENTATION]
INNER JOIN [TBDD_USER] ON [TBDD_USER_REPRESENTATION].[USER_ID] = [TBDD_USER].[GUID]
LEFT JOIN [TBDD_GROUPS] as [REPR_GROUP] ON [TBDD_USER_REPRESENTATION].[REPR_GROUP] = [REPR_GROUP].[GUID]
LEFT JOIN [TBDD_GROUPS] as [RIGHT_GROUP] ON [TBDD_USER_REPRESENTATION].[RIGHT_GROUP] = [RIGHT_GROUP].[GUID]
GO