Reconfigure for GIT
This commit is contained in:
+212
@@ -0,0 +1,212 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_GLAccountRowsforBookEntry] Script Date: 05/18/2012 09:18:32 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE VIEW [dbo].[vv_GLAccountRowsforBookEntry]
|
||||
AS
|
||||
SELECT 1 PartnerType,
|
||||
0 GLRowsTypeVAT,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t2.Customers Customers,
|
||||
t2.F_DateExecution DateExecution,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
t2.RegistryNumber RegistryNumber,
|
||||
CASE WHEN isnull(t1.IsReinvoice,0)=0 THEN t8.ChartOfAccounts
|
||||
ELSE t8.ChartOfAccounts2
|
||||
END DebitChartOfAccounts,
|
||||
t9.ChartOfAccountsIn CreditChartOfAccounts,
|
||||
t1.Controlling Controlling,
|
||||
t1.JobNumberObjects JobNumberObjects,
|
||||
t7.UniqueObjects UniqueObjects,
|
||||
t1.CostPlace CostPlace,
|
||||
t1.CostHolder CostHolder,
|
||||
t2.F_CurrencyRate CurrencyRate,
|
||||
t1.Amount AmountHUF,
|
||||
CASE WHEN t2.F_CurrencyRate<>0 and t6.ShortName<>'HUF' THEN ROUND(t1.Amount/t2.F_CurrencyRate,2) ELSE 0 END AmountDEV,
|
||||
t2.ShortName Note1,
|
||||
'' Note2,
|
||||
NULL VAT,
|
||||
t1.ChartofAccounts ChartOfAccounts2,
|
||||
isnull(t1.IsReinvoice,0) IsReinvoice,
|
||||
t1.ContractRows ContractRows,
|
||||
isnull(t1.F_ReadyforBookEntryRows,0) ReadyforBookEntryRows,
|
||||
t2.Oid RegistryHeader,
|
||||
Null InvoiceHeader,
|
||||
t2.CurrentWorkflowSystemSteps WorkflowSystemSteps,
|
||||
t1.WorkflowMessage WorkflowMessage
|
||||
from RegistryRowsFinancialControlling t1 join RegistryHeader t2 on
|
||||
t1.RegistryHeader=t2.Oid LEFT JOIN Controlling t3 ON
|
||||
t1.Controlling=t3.Oid LEFT JOIN Customers t4 ON
|
||||
t2.Customers=t4.Oid LEFT JOIN CustomersGLParameters t5 ON
|
||||
t4.CustomersGLParameters=t5.Oid LEFT JOIN CurrencyName t6 ON
|
||||
t2.F_CurrencyName=t6.Oid LEFT JOIN ContractRows t7 ON
|
||||
t1.ContractRows=t7.Oid left join ControllingYear t8 on
|
||||
t3.Oid=t8.Controlling and Year(t2.F_DateExecution)=t8.AccountYear left join CustomersGLParametersYear t9 on
|
||||
t5.Oid=t9.CustomersGLParameters and Year(t2.F_DateExecution)=t9.AccountYear
|
||||
WHERE t1.GCRecord IS NULL AND
|
||||
isnull(t2.IsEditable,0)=0 AND
|
||||
t2.F_GLAccounts IS NULL AND
|
||||
isnull(t1.F_ReadyforBookEntryRows,0)=0
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 1 PartnerType,
|
||||
1 GLRowsTypeVAT,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t2.Customers Customers,
|
||||
isnull(isnull(t1.DateVAT,t2.F_DateVAT),t2.F_DateExecution) DateExecution,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
t2.RegistryNumber RegistryNumber,
|
||||
t7.ChartOfAccountsIn DebitChartOfAccounts,
|
||||
case when ISNULL(t3.InversState,0)=1 then t7.ChartOfAccountsOut
|
||||
else t9.ChartOfAccountsIn end CreditChartOfAccounts,
|
||||
NULL Controlling,
|
||||
NULL JobNumberObjects,
|
||||
NULL UniqueObjects,
|
||||
NULL CostPlace,
|
||||
NULL CostHolder,
|
||||
1 CurrencyRate,
|
||||
CASE WHEN t1.VAT IS NULL THEN 0
|
||||
WHEN t1.VAT IS NOT NULL THEN
|
||||
case when t3.InversState=0 then ROUND(t1.BruttoAmount/(1+t3.KeyValue)*t3.KeyValue,0)
|
||||
else ROUND(t1.BruttoAmount/(1+t3.InversKeyValue)*t3.InversKeyValue,0) end
|
||||
END AmountHUF,
|
||||
0 AmountDEV,
|
||||
t2.ShortName Note1,
|
||||
'' Note2,
|
||||
t1.VAT VAT,
|
||||
NULL ChartOfAccounts2,
|
||||
0 IsReinvoice,
|
||||
NULL ContractRows,
|
||||
isnull(t1.F_ReadyforBookEntryRows,0) ReadyforBookEntryRows,
|
||||
t2.Oid RegistryHeader,
|
||||
NULL InvoiceHeader,
|
||||
t2.CurrentWorkflowSystemSteps WorkflowSystemSteps,
|
||||
'' WorkflowMessage
|
||||
from RegistryRowsFinancial t1 join RegistryHeader t2 on
|
||||
t1.RegistryHeader=t2.Oid LEFT JOIN VAT t3 ON
|
||||
t1.VAT=t3.oid LEFT JOIN Customers t4 ON
|
||||
t2.Customers=t4.Oid LEFT JOIN CustomersGLParameters t5 ON
|
||||
t4.CustomersGLParameters=t5.Oid LEFT JOIN CurrencyName t6 ON
|
||||
t2.F_CurrencyName=t6.Oid left join VATYear t7 on
|
||||
t3.Oid=t7.VAT and Year(t2.F_DateExecution)=t7.AccountYear left join CustomersGLParametersYear t9 on
|
||||
t5.Oid=t9.CustomersGLParameters and Year(t2.F_DateExecution)=t9.AccountYear
|
||||
WHERE t1.GCRecord IS NULL AND
|
||||
isnull(t2.IsEditable,0)=0 AND
|
||||
t2.F_GLAccounts IS NULL AND
|
||||
isnull(t1.F_ReadyforBookEntryRows,0)=0
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 0 PartnerType,
|
||||
0 GLRowsTypeVAT,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t2.Customers Customers,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
'' RegistryNumber,
|
||||
t11.ChartOfAccountsOut DebitChartOfAccounts,
|
||||
isnull(t12.ChartOfAccounts,t10.ChartOfAccounts) CreditChartOfAccounts,
|
||||
isnull(t8.Controlling,t1.Controlling) Controlling,
|
||||
isnull(t8.JobNumberObjects,t1.JobNumberObjects) JobNumberObjects,
|
||||
isnull(t8.UniqueObjects,t1.UniqueObjects) UniqueObjects,
|
||||
isnull(t8.CostPlace,t1.CostPlace) CostPlace,
|
||||
isnull(t8.CostHolder,t1.CostHolder) CostHolder,
|
||||
t2.CurrencyRate CurrencyRate,
|
||||
(t1.ListPriceHUF-t1.DiscountPriceHUF)*t1.QTT AmountHUF,
|
||||
(t1.ListPriceDEV-t1.DiscountPriceDEV)*t1.QTT AmountDEV,
|
||||
t2.Description Note1,
|
||||
'' Note2,
|
||||
NULL VAT,
|
||||
t1.ChartofAccounts ChartOfAccounts2,
|
||||
0 IsReinvoice,
|
||||
t1.ContractRows ContractRows,
|
||||
isnull(t1.ReadyforBookEntryRows,0) ReadyforBookEntryRows,
|
||||
NULL RegistryHeader,
|
||||
t2.Oid InvoiceHeader,
|
||||
t1.WorkflowSystemSteps WorkflowSystemSteps,
|
||||
'' WorkflowMessage
|
||||
FROM InvoiceRows t1 JOIN InvoiceHeader t2 ON
|
||||
t1.InvoiceHeader=t2.Oid LEFT JOIN Controlling t3 ON
|
||||
t1.Controlling=t3.Oid LEFT JOIN Customers t4 ON
|
||||
t2.Customers=t4.Oid LEFT JOIN CustomersGLParameters t5 ON
|
||||
t4.CustomersGLParameters=t5.Oid LEFT JOIN CurrencyName t6 ON
|
||||
t2.CurrencyName=t6.Oid LEFT JOIN InvoiceType t7 ON
|
||||
t2.InvoiceType=t7.Oid LEFT JOIN ContractRows t8 ON
|
||||
t1.ContractRows=t8.Oid LEFT JOIN Controlling t9 ON
|
||||
t8.Controlling=t9.Oid left join ControllingYear t10 on
|
||||
t3.Oid=t10.Controlling and Year(t2.DateExecution)=t10.AccountYear left join CustomersGLParametersYear t11 on
|
||||
t5.Oid=t11.CustomersGLParameters and Year(t2.DateExecution)=t11.AccountYear left join ControllingYear t12 on
|
||||
t9.Oid=t12.Controlling and Year(t2.DateExecution)=t12.AccountYear
|
||||
WHERE t1.GCRecord IS NULL AND
|
||||
isnull(t2.IsEditable,0)=0 AND
|
||||
t2.GLAccounts IS NULL AND
|
||||
isnull(t1.ReadyforBookEntryRows,0)=0 AND
|
||||
t7.InvoiceTypeBase in (1,2,3) and
|
||||
isnull(t2.IsProforma,0)=0
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 0 PartnerType,
|
||||
1 GLRowsTypeVAT,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t2.Customers Customers,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
'' RegistryNumber,
|
||||
t9.ChartOfAccountsOut DebitChartOfAccounts,
|
||||
t7.ChartOfAccountsOut CreditChartOfAccounts,
|
||||
NULL Controlling,
|
||||
NULL JobNumberObjects,
|
||||
NULL UniqueObjects,
|
||||
NULL CostPlace,
|
||||
NULL CostHolder,
|
||||
1 CurrencyRate,
|
||||
t1.AmountVATHUF AmountHUF,
|
||||
t1.AmountVATDEV AmountDEV,
|
||||
t2.Description Note1,
|
||||
'' Note2,
|
||||
t1.VAT VAT,
|
||||
NULL ChartOfAccounts2,
|
||||
0 IsReinvoice,
|
||||
NULL ContractRows,
|
||||
isnull(t1.ReadyforBookEntryRows,0) ReadyforBookEntryRows,
|
||||
NULL RegistryHeader,
|
||||
t2.Oid InvoiceHeader,
|
||||
Null WorkflowSystemSteps,
|
||||
'' WorkflowMessage
|
||||
from InvoiceVATRows t1 join InvoiceHeader t2 on
|
||||
t1.InvoiceHeader=t2.Oid LEFT JOIN VAT t3 ON
|
||||
t1.VAT=t3.oid LEFT JOIN Customers t4 ON
|
||||
t2.Customers=t4.Oid LEFT JOIN CustomersGLParameters t5 ON
|
||||
t4.CustomersGLParameters=t5.Oid LEFT JOIN CurrencyName t6 ON
|
||||
t2.CurrencyName=t6.Oid LEFT JOIN InvoiceType t10 ON
|
||||
t2.InvoiceType=t10.Oid left join VATYear t7 on
|
||||
t3.Oid=t7.VAT and Year(t2.DateExecution)=t7.AccountYear left join CustomersGLParametersYear t9 on
|
||||
t5.Oid=t9.CustomersGLParameters and Year(t2.DateExecution)=t9.AccountYear
|
||||
WHERE t1.GCRecord IS NULL AND
|
||||
isnull(t2.IsEditable,0)=0 AND
|
||||
t2.GLAccounts IS NULL AND
|
||||
isnull(t1.ReadyforBookEntryRows,0)=0 AND
|
||||
isnull(t2.IsProforma,0)=0 AND
|
||||
t10.InvoiceTypeBase in (1,2,3) --and
|
||||
--t2.GLAccounts is null
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_PartnerConnectionInfoAccount] Script Date: 05/18/2012 09:18:46 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE view [dbo].[vv_PartnerConnectionInfoAccount]
|
||||
as
|
||||
select '01-Account' MainType,
|
||||
t2.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t4.ConnectInfo ConnectInfo,
|
||||
t2.CurrencyName CurrencyName,
|
||||
sum(t1.AmountHUF) BallanceHUF,
|
||||
sum(t1.AmountDEV) BallanceDEV,
|
||||
t3.ShortName Currency,
|
||||
t2.DatePayment DatePayment,
|
||||
t2.DateCreated DateCreated,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.CurrencyRate CurrencyRate,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
max(t2.RegistryNumber) RegistryNumber
|
||||
from GLRows t1 join GLHeader t2 on
|
||||
t1.GLHeader=t2.Oid left join CurrencyName t3 on
|
||||
t2.CurrencyName=t3.Oid left join GlAccounts t4 on
|
||||
t1.GLHeader=t4.Oid
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=1 and
|
||||
isnull(t2.IsEditable,0)=0 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t2.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t4.ConnectInfo,t2.DocumentNumber,t2.CurrencyName,t3.ShortName,t2.DateExecution,t2.DatePayment,
|
||||
t2.DateCreated,t2.DateExecution,t2.CurrencyRate
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
0 PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t1.CurrencyName CurrencyName,
|
||||
t1.TotalBruttoHUF BallanceHUF,
|
||||
t1.TotalBruttoDEV BallanceDEV,
|
||||
t3.ShortName Currency,
|
||||
t1.DatePayment DatePayment,
|
||||
t1.DateCreated DateCreated,
|
||||
t1.DateExecution DateExecution,
|
||||
t1.CurrencyRate CurrencyRate,
|
||||
t1.DocumentNumber DocumentNumber,
|
||||
t1.DocumentNumber RegistryNumber
|
||||
from InvoiceHeader t1 left join CurrencyName t3 on
|
||||
t1.CurrencyName=t3.Oid
|
||||
where t1.GLAccounts is null and
|
||||
t1.IsEditable=0 and
|
||||
t1.GCRecord is null
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
1 PartnerType,
|
||||
t1.F_ConnectInfo ConnectInfo,
|
||||
t1.F_CurrencyName CurrencyName,
|
||||
t1.F_AmountBruttoHUF BallanceHUF,
|
||||
t1.F_AmountBruttoDEV BallanceDEV,
|
||||
t3.ShortName Currency,
|
||||
t1.F_DatePayment DatePayment,
|
||||
t1.F_DateCreated DateCreated,
|
||||
t1.F_DateExecution DateExecution,
|
||||
t1.F_CurrencyRate CurrencyRate,
|
||||
t1.DocumentNumber DocumentNumber,
|
||||
t1.RegistryNumber RegistryNumber
|
||||
from RegistryHeader t1 left join RegistryType t2 on
|
||||
t1.RegistryType=t2.Oid left join CurrencyName t3 on
|
||||
t1.F_CurrencyName=t3.Oid
|
||||
where t1.GCRecord is null and
|
||||
t1.F_GLAccounts is null and
|
||||
t1.IsEditable=0 and
|
||||
t1.IsStorno=0 and
|
||||
t2.RegistryMainType=0 and
|
||||
t1.RegistryAcceptState=0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_PartnerConnectionInfoAged] Script Date: 05/18/2012 09:19:05 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE view [dbo].[vv_PartnerConnectionInfoAged]
|
||||
as
|
||||
select t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
t2.RegistryNumber RegistryNumber,
|
||||
t1.DateExecution DateExecution,
|
||||
t1.DatePayment_Account DatePayment,
|
||||
t1.CurrencyName_Account CurrencyName_Account,
|
||||
t1.AmountHUF_Account AmountHUF,
|
||||
t1.AmountDEV_Account AmountDEV,
|
||||
t1.BallanceHUF BallanceHUF,
|
||||
t1.BallanceDEV BallanceDEV,
|
||||
t1.InvoiceHeader InvoiceHeader
|
||||
from PCIDetail t1 join
|
||||
vv_PartnerConnectionInfoAccount t2 on
|
||||
t1.CustomersFrom=t2.CustomersFrom and
|
||||
t1.Customers=t2.Customers and
|
||||
t1.PartnerType=t2.PartnerType and
|
||||
t1.ConnectInfo=t2.ConnectInfo
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_PartnerConnectionInfoConnect] Script Date: 05/18/2012 09:19:21 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE view [dbo].[vv_PartnerConnectionInfoConnect]
|
||||
as
|
||||
select
|
||||
t1.MainType MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t1.CurrencyName CurrencyName,
|
||||
t1.DebitTotalHUF DebitTotalHUF,
|
||||
t1.CreditTotalHUF CreditTotalHUF,
|
||||
t1.DebitTotalDEV DebitTotalDEV,
|
||||
t1.CreditTotalDEV CreditTotalDEV,
|
||||
t1.BallanceHUF BallanceHUF,
|
||||
t1.BallanceDEV BallanceDEV,
|
||||
t1.ShortName ShortName,
|
||||
t1.Description Description,
|
||||
t1.DateExecution DateExecution,
|
||||
t1.DateCreated DateCreated,
|
||||
t1.DatePayment DatePayment,
|
||||
t1.DelayedDay DelayedDay,
|
||||
t1.DelayedRange DelayedRange,
|
||||
t1.CurrencyName_Account CurrencyName_Account,
|
||||
t1.AmountHUF_Account AmountHUF_Account,
|
||||
t1.AmountDEV_Account AmountDEV_Account,
|
||||
t1.DateExecution_Account DateExecution_Account,
|
||||
t2.BallanceState BallanceState,
|
||||
t2.BallanceRateDiff BallanceRateDiff
|
||||
from vv_PartnerConnectionInfoDetail t1
|
||||
join vv_PartnerConnectionInfoDetailGroup t2 on
|
||||
t1.CustomersFrom=t2.CustomersFrom and
|
||||
t1.Customers=t2.Customers and
|
||||
t1.PartnerType=t2.PartnerType and
|
||||
t1.ConnectInfo=t2.ConnectInfo
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
+432
@@ -0,0 +1,432 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_PartnerConnectionInfoDetail] Script Date: 05/18/2012 09:19:35 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE view [dbo].[vv_PartnerConnectionInfoDetail]
|
||||
as
|
||||
select '01-Account' MainType,
|
||||
t2.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t2.CurrencyName CurrencyName,
|
||||
max(t3.AmountHUFBrutto) DebitTotalHUF,
|
||||
0 CreditTotalHUF,
|
||||
max(t3.AmountDEVBrutto) DebitTotalDEV,
|
||||
0 CreditTotalDEV,
|
||||
max(t3.AmountHUFBrutto) BallanceHUF,
|
||||
max(t3.AmountDEVBrutto) BallanceDEV,
|
||||
'' ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateCreated DateCreated,
|
||||
t2.DatePayment DatePayment,
|
||||
DATEDIFF(d,t2.DatePayment,getdate()) DelayedDay,
|
||||
case when DATEDIFF(d,t2.DatePayment,getdate())<=0 then 0
|
||||
when DATEDIFF(d,t2.DatePayment,getdate())>0 and DATEDIFF(d,t2.DatePayment,getdate())<=15 then 1
|
||||
when DATEDIFF(d,t2.DatePayment,getdate())>15 and DATEDIFF(d,t2.DatePayment,getdate())<=30 then 2
|
||||
when DATEDIFF(d,t2.DatePayment,getdate())>30 and DATEDIFF(d,t2.DatePayment,getdate())<=60 then 3
|
||||
when DATEDIFF(d,t2.DatePayment,getdate())>60 and DATEDIFF(d,t2.DatePayment,getdate())<=90 then 4
|
||||
when DATEDIFF(d,t2.DatePayment,getdate())>90 and DATEDIFF(d,t2.DatePayment,getdate())<=180 then 5
|
||||
when DATEDIFF(d,t2.DatePayment,getdate())>180 and DATEDIFF(d,t2.DatePayment,getdate())<=360 then 6
|
||||
when DATEDIFF(d,t2.DatePayment,getdate())>360 then 7
|
||||
end DelayedRange,
|
||||
t2.CurrencyName CurrencyName_Account,
|
||||
sum(t1.AmountHUF) AmountHUF_Account,
|
||||
sum(t1.AmountDEV) AmountDEV_Account,
|
||||
t2.DateExecution DateExecution_Account
|
||||
from GLRows t1 join GLHeader t2 on
|
||||
t1.GLHeader=t2.Oid join GLAccounts t3 on
|
||||
t1.GLHeader=t3.Oid
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=1 and
|
||||
t2.IsEditable=0 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t2.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t2.CurrencyName,t2.DateExecution,t2.DateCreated,t2.DatePayment
|
||||
|
||||
union all
|
||||
|
||||
select '02-Bank' MainType,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t3.CurrencyName CurrencyName,
|
||||
0 DebitTotalHUF,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalHUF,
|
||||
0 DebitTotalDEV,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalDEV,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end)*-1 BallanceHUF,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.InAmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.OutAmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.OutAmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.InAmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF'then sum(t1.InAmountDEV2)*-1
|
||||
else 0
|
||||
end)*-1 BallanceDEV,
|
||||
max(t3.ShortName+', '+isnull(t2.DocumentNumber,'')) ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateExecution DateCreated,
|
||||
t4.DatePayment DatePayment,
|
||||
0 DelayedDay,
|
||||
'' DelayedRange,
|
||||
t4.CurrencyName CurrencyName_Account,
|
||||
0 AmountHUF_Account,
|
||||
0 AmountDEV_Account,
|
||||
max(t4.DateExecution) DateExecution_Account
|
||||
from GLRows t1
|
||||
join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
left join GLBank t5 on t2.Oid=t5.Oid
|
||||
left join LiquidAssets t3 on t5.LiquidAssets_Main=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on t2.CustomersFrom=t4.CustomersFrom
|
||||
and t1.Customer=t4.Customers and t1.PartnerType=t4.PartnerType and t1.ConnectInfo=t4.ConnectInfo
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=2 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t1.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t3.CurrencyName,t4.Currency,t2.DateExecution,t4.DatePayment,t4.CurrencyName
|
||||
|
||||
union all
|
||||
|
||||
select '03-Cassa' MainType,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t3.CurrencyName CurrencyName,
|
||||
0 DebitTotalHUF,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalHUF,
|
||||
0 DebitTotalDEV,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalDEV,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end)*-1 BallanceHUF,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF'then sum(t1.InAmountDEV2)*-1
|
||||
end)*-1 BallanceDEV,
|
||||
max(t3.ShortName+', '+isnull(t2.DocumentNumber,'')) ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateExecution DateCreated,
|
||||
t4.DatePayment DatePayment,
|
||||
0 DelayedDay,
|
||||
'' DelayedRange,
|
||||
t4.CurrencyName CurrencyName_Account,
|
||||
0 AmountHUF_Account,
|
||||
0 AmountDEV_Account,
|
||||
max(t4.DateExecution) DateExecution_Account
|
||||
from GLRows t1
|
||||
join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
left join GLCassa t5 on t2.Oid=t5.Oid
|
||||
left join LiquidAssets t3 on t5.LiquidAssets_Cassa=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on t2.CustomersFrom=t4.CustomersFrom and
|
||||
t1.Customer=t4.Customers and t1.PartnerType=t4.PartnerType and t1.ConnectInfo=t4.ConnectInfo
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=3 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t1.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t3.CurrencyName,t4.Currency,t2.DateExecution,t4.DatePayment,t4.CurrencyName
|
||||
|
||||
union all
|
||||
|
||||
select '05-Ratediff' MainType,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t2.CurrencyName CurrencyName,
|
||||
0 DebitTotalHUF,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end CreditTotalHUF,
|
||||
0 DebitTotalDEV,
|
||||
0 CreditTotalDEV,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end)*-1 BallanceHUF,
|
||||
0 BallanceDEV,
|
||||
max(isnull(t7.ShortName,'')+', '++isnull(t8.DocumentNumber,'')+', '+isnull(t2.DocumentNumber,'')) ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateExecution DateCreated,
|
||||
Null DatePayment,
|
||||
0 DelayedDay,
|
||||
'' DelayedRange,
|
||||
t4.CurrencyName CurrencyName_Account,
|
||||
0 AmountHUF_Account,
|
||||
0 AmountDEV_Account,
|
||||
max(t4.DateExecution) DateExecution_Account
|
||||
from GLRows t1
|
||||
join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
left join LiquidAssets t3 on t1.LiquidAssets=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on t2.CustomersFrom=t4.CustomersFrom and
|
||||
t1.Customer=t4.Customers and t1.PartnerType=t4.PartnerType and t1.ConnectInfo=t4.ConnectInfo
|
||||
left join GLRows t6 on
|
||||
t1.GLRowsRateDiff=t6.Oid left join LiquidAssets t7 on
|
||||
t6.LiquidAssets=t7.oid left join GLHeader t8 on
|
||||
t6.GLHeader=t8.oid
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=5 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t1.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t2.CurrencyName,t2.DateExecution,t2.DatePayment,t4.CurrencyName
|
||||
|
||||
union all
|
||||
|
||||
select case when max(t2.GLDocumentType)=4 then '04-Compensation'
|
||||
when max(t2.GLDocumentType)=0 then '06-Mixed'
|
||||
end MainType,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t3.CurrencyName CurrencyName,
|
||||
0 DebitTotalHUF,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalHUF,
|
||||
0 DebitTotalDEV,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalDEV,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end)*-1 BallanceHUF,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV2)<>0 and
|
||||
isnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF'then sum(t1.InAmountDEV2)*-1
|
||||
else 0
|
||||
end)*-1 BallanceDEV,
|
||||
max(t3.ShortName+', '+t2.DocumentNumber) ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateExecution DateCreated,
|
||||
t2.DateExecution DatePayment,
|
||||
0 DelayedDay,
|
||||
'' DelayedRange,
|
||||
t4.CurrencyName CurrencyName_Account,
|
||||
0 AmountHUF_Account,
|
||||
0 AmountDEV_Account,
|
||||
max(t4.DateExecution) DateExecution_Account
|
||||
from GLRows t1
|
||||
join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
left join GLCompensation t5 on t2.Oid=t5.Oid left
|
||||
join LiquidAssets t3 on t5.LiquidAssets_Main=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on t2.CustomersFrom=t4.CustomersFrom and
|
||||
t1.Customer=t4.Customers and t1.PartnerType=t4.PartnerType and t1.ConnectInfo=t4.ConnectInfo
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType in (4,0) and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t1.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t3.CurrencyName,t4.Currency,t2.DateExecution,t4.DatePayment,t4.CurrencyName
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
0 PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t1.CurrencyName CurrencyName,
|
||||
t1.TotalBruttoHUF DebitTotalHUF,
|
||||
0 CreditTotalHUF,
|
||||
t1.TotalBruttoDEV DebitTotalDEV,
|
||||
0 CreditTotalDEV,
|
||||
t1.TotalBruttoHUF BallanceHUF,
|
||||
t1.TotalBruttoDEV BallanceDEV,
|
||||
'' ShortName,
|
||||
t1.Description Description,
|
||||
t1.DateExecution DateExecution,
|
||||
t1.DateCreated DateCreated,
|
||||
t1.DatePayment DatePayment,
|
||||
DATEDIFF(d,t1.DatePayment,getdate()) DelayedDay,
|
||||
case when DATEDIFF(d,t1.DatePayment,getdate())<=0 then 0
|
||||
when DATEDIFF(d,t1.DatePayment,getdate())>0 and DATEDIFF(d,t1.DatePayment,getdate())<=15 then 1
|
||||
when DATEDIFF(d,t1.DatePayment,getdate())>15 and DATEDIFF(d,t1.DatePayment,getdate())<=30 then 2
|
||||
when DATEDIFF(d,t1.DatePayment,getdate())>30 and DATEDIFF(d,t1.DatePayment,getdate())<=60 then 3
|
||||
when DATEDIFF(d,t1.DatePayment,getdate())>60 and DATEDIFF(d,t1.DatePayment,getdate())<=90 then 4
|
||||
when DATEDIFF(d,t1.DatePayment,getdate())>90 and DATEDIFF(d,t1.DatePayment,getdate())<=180 then 5
|
||||
when DATEDIFF(d,t1.DatePayment,getdate())>180 and DATEDIFF(d,t1.DatePayment,getdate())<=360 then 6
|
||||
when DATEDIFF(d,t1.DatePayment,getdate())>360 then 7
|
||||
end DelayedRange,
|
||||
t1.CurrencyName CurrencyName_Account,
|
||||
t1.TotalBruttoHUF AmountHUF_Account,
|
||||
t1.TotalBruttoDEV AmountDEV_Account,
|
||||
t1.DateExecution DateExecution_Account
|
||||
from InvoiceHeader t1
|
||||
where t1.GLAccounts is null and
|
||||
t1.IsEditable=0 and
|
||||
t1.GCRecord is null
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
1 PartnerType,
|
||||
t1.DocumentNumber ConnectInfo,
|
||||
t1.F_CurrencyName CurrencyName,
|
||||
t1.F_AmountBruttoHUF DebitTotalHUF,
|
||||
0 CreditTotalHUF,
|
||||
t1.F_AmountBruttoDEV DebitTotalDEV,
|
||||
0 CreditTotalDEV,
|
||||
t1.F_AmountBruttoHUF BallanceHUF,
|
||||
t1.F_AmountBruttoDEV BallanceDEV,
|
||||
'' ShortName,
|
||||
'' Description,
|
||||
t1.F_DateExecution DateExecution,
|
||||
t1.F_DateCreated DateCreated,
|
||||
t1.F_DatePayment DatePayment,
|
||||
DATEDIFF(d,t1.F_DatePayment,getdate()) DelayedDay,
|
||||
case when DATEDIFF(d,t1.F_DatePayment,getdate())<=0 then 0
|
||||
when DATEDIFF(d,t1.F_DatePayment,getdate())>0 and DATEDIFF(d,t1.F_DatePayment,getdate())<=15 then 1
|
||||
when DATEDIFF(d,t1.F_DatePayment,getdate())>15 and DATEDIFF(d,t1.F_DatePayment,getdate())<=30 then 2
|
||||
when DATEDIFF(d,t1.F_DatePayment,getdate())>30 and DATEDIFF(d,t1.F_DatePayment,getdate())<=60 then 3
|
||||
when DATEDIFF(d,t1.F_DatePayment,getdate())>60 and DATEDIFF(d,t1.F_DatePayment,getdate())<=90 then 4
|
||||
when DATEDIFF(d,t1.F_DatePayment,getdate())>90 and DATEDIFF(d,t1.F_DatePayment,getdate())<=180 then 5
|
||||
when DATEDIFF(d,t1.F_DatePayment,getdate())>180 and DATEDIFF(d,t1.F_DatePayment,getdate())<=360 then 6
|
||||
when DATEDIFF(d,t1.F_DatePayment,getdate())>360 then 7
|
||||
end DelayedRange,
|
||||
t1.F_CurrencyName CurrencyName_Account,
|
||||
t1.F_AmountBruttoHUF AmountHUF_Account,
|
||||
t1.F_AmountBruttoDEV AmountDEV_Account,
|
||||
t1.F_DateExecution DateExecution_Account
|
||||
from RegistryHeader t1
|
||||
left join RegistryType t2 on t1.RegistryType=t2.Oid
|
||||
where t1.GCRecord is null and
|
||||
t1.F_GLAccounts is null and
|
||||
t1.IsEditable=0 and
|
||||
t1.IsStorno=0 and
|
||||
t2.RegistryMainType=0 and
|
||||
t1.RegistryAcceptState=0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_PartnerConnectionInfoDetailGroup] Script Date: 05/18/2012 09:19:51 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
CREATE view [dbo].[vv_PartnerConnectionInfoDetailGroup]
|
||||
as
|
||||
select MAX(convert(varchar(100),t1.Oid)) Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
max(t2.ShortName) Currency,
|
||||
sum(t1.DebitTotalHUF) DebitTotalHUF,
|
||||
SUM(t1.CreditTotalHUF) CreditTotalHUF,
|
||||
sum(t1.DebitTotalDEV) DebitTotalDEV,
|
||||
SUM(t1.CreditTotalDEV) CreditTotalDEV,
|
||||
SUM(t1.BallanceHUF) BallanceHUF,
|
||||
SUM(t1.BallanceDEV) BallanceDEV,
|
||||
case when t1.PartnerType=1 then SUM(t1.BallanceHUF)*-1 else 0 end BallanceHUF_P,
|
||||
case when t1.PartnerType=1 then SUM(t1.BallanceDEV)*-1 else 0 end BallanceDEV_P,
|
||||
case when t1.PartnerType=0 then SUM(t1.BallanceHUF) else 0 end BallanceHUF_R,
|
||||
case when t1.PartnerType=0 then SUM(t1.BallanceDEV) else 0 end BallanceDEV_R,
|
||||
(case when t1.PartnerType=0 then SUM(t1.BallanceHUF) else 0 end) -
|
||||
(case when t1.PartnerType=1 then SUM(t1.BallanceHUF)*-1 else 0 end) BallanceHUF_B,
|
||||
(case when t1.PartnerType=0 then SUM(t1.BallanceDEV) else 0 end) -
|
||||
(case when t1.PartnerType=1 then SUM(t1.BallanceDEV)*-1 else 0 end) BallanceDEV_B,
|
||||
max(t3.ShortName) Currency_Account,
|
||||
sum(t1.AmountHUF_Account) AmountHUF_Account,
|
||||
sum(t1.AmountDEV_Account) AmountDEV_Account,
|
||||
case when max(t3.ShortName)='HUF' then
|
||||
case when round(SUM(t1.BallanceHUF),0)=0 then 1
|
||||
else 0
|
||||
end
|
||||
else
|
||||
case when round(SUM(t1.BallanceDEV),2)=0 then 1
|
||||
else 0
|
||||
end
|
||||
end BallanceState,
|
||||
case when max(t3.ShortName)='HUF' then -1
|
||||
when t1.CurrencyName_Account IS null then -1
|
||||
else
|
||||
case when round(SUM(t1.BallanceDEV),2)=0 and round(SUM(t1.BallanceHUF),0)<>0 then 1
|
||||
else 0
|
||||
end
|
||||
end BallanceRateDiff,
|
||||
max(t4.DateExecution) DateExecution_Account,
|
||||
MAX(t4.DateCreated) DateCreated_Account
|
||||
from vv_PartnerConnectionInfoDetail t1
|
||||
left join CurrencyName t2 on t1.CurrencyName=t2.Oid
|
||||
left join CurrencyName t3 on t1.CurrencyName_Account=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on
|
||||
t1.CustomersFrom=t4.CustomersFrom and
|
||||
t1.Customers=t4.Customers and
|
||||
t1.PartnerType=t4.PartnerType and
|
||||
t1.ConnectInfo=t4.ConnectInfo and
|
||||
t4.MainType='01-Account'
|
||||
|
||||
group by t1.CustomersFrom,t1.Customers,t1.PartnerType,t1.ConnectInfo,t1.CurrencyName_Account
|
||||
|
||||
|
||||
GO
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_ProductSelect] Script Date: 05/18/2012 09:20:03 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
CREATE view [dbo].[vv_ProductSelect]
|
||||
as
|
||||
select Oid=case when t2.Oid IS null then t1.Oid else t2.Oid end,
|
||||
Products=t1.Oid,
|
||||
StorageComputed=t2.oid
|
||||
from Products t1 left join StorageComputed t2 on
|
||||
t1.Oid=t2.Products
|
||||
where t1.GCRecord is null and t2.GCRecord is null
|
||||
|
||||
|
||||
GO
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_RegistryBankTransfer] Script Date: 05/18/2012 09:20:16 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
CREATE view [dbo].[vv_RegistryBankTransfer]
|
||||
as
|
||||
select t1.Oid Oid,
|
||||
t1.RegistryHeader RegistryHeader,
|
||||
t1.AmountHUF AmountHUF,
|
||||
t1.AmountDEV AmountDEV,
|
||||
t1.DatePayment DatePayment,
|
||||
t1.IsBlocked IsBlocked,
|
||||
t1.Note Note,
|
||||
t1.BankSavedFileName BankSavedFileName,
|
||||
isnull(t3.BallanceHUF,t2.F_AmountBruttoHUF) BallanceHUF,
|
||||
isnull(t3.BallanceDEV,t2.F_AmountBruttoDEV) BallanceDEV,
|
||||
t1.AmountHUF-isnull(t3.BallanceHUF,t2.F_AmountBruttoHUF) DifferenceHUF,
|
||||
t1.AmountDEV-isnull(t3.BallanceDEV,t2.F_AmountBruttoDEV) DifferenceDEV,
|
||||
case when round(isnull(t3.BallanceHUF,t2.F_AmountBruttoHUF),2)=0 then 0
|
||||
when isnull(t3.BallanceHUF,t2.F_AmountBruttoHUF)>=t1.AmountHUF then t1.AmountHUF
|
||||
when isnull(t3.BallanceHUF,t2.F_AmountBruttoHUF)<=t1.AmountHUF then isnull(t3.BallanceHUF,t2.F_AmountBruttoHUF)
|
||||
end OfferedHUF,
|
||||
case when round(isnull(t3.BallanceDEV,t2.F_AmountBruttoDEV),2)=0 then 0
|
||||
when isnull(t3.BallanceDEV,t2.F_AmountBruttoDEV)>=t1.AmountDEV then t1.AmountDEV
|
||||
when isnull(t3.BallanceDEV,t2.F_AmountBruttoDEV)<=t1.AmountDEV then isnull(t3.BallanceDEV,t2.F_AmountBruttoDEV)
|
||||
end OfferedDEV,
|
||||
t1.BankPrepareName BankPrepareName
|
||||
from RegistryBankTransfer t1
|
||||
join RegistryHeader t2 on t1.RegistryHeader=t2.Oid
|
||||
left join PCIGroup t3 on t2.CustomersFrom=t3.CustomersFrom
|
||||
and t2.Customers=t3.Customers and t3.PartnerType=1 and t2.DocumentNumber=t3.ConnectInfo
|
||||
where t1.GCRecord is null and t2.RegistryAcceptState=0
|
||||
|
||||
|
||||
GO
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_RegistryBankTransferPrepareName] Script Date: 05/18/2012 09:20:31 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE view [dbo].[vv_RegistryBankTransferPrepareName]
|
||||
as
|
||||
select max(convert(varchar(100),Oid)) Oid,
|
||||
BankPrepareName
|
||||
from RegistryBankTransfer
|
||||
where Isnull(BankPrepareName,'')<>''
|
||||
group by BankPrepareName
|
||||
|
||||
GO
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
USE [SISTEST]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[vv_WaitforRateDiff] Script Date: 05/18/2012 09:20:45 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE view [dbo].[vv_WaitforRateDiff]
|
||||
as
|
||||
select t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.Customer Customers,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t3.DateExecution DateExecution_Account,
|
||||
t3.CurrencyName CurrencyName_Account,
|
||||
round(t4.AmountDEV_Account,2) AmountDEV_Account,
|
||||
round(t4.AmountHUF_Account,2) AmountHUF_Account,
|
||||
round(t4.BallanceDEV,2) BallanceDEV_Account,
|
||||
case when round(t4.AmountDEV_Account,2)<>0 then round(round(t4.AmountHUF_Account,2)/round(t4.AmountDEV_Account,2),2) else 0 end CurrencyRate_Account,
|
||||
t1.LiquidAssets LiquidAssets,
|
||||
t2.DateExecution DateExecution,
|
||||
round(t1.InAmountDEV,2) InAmountDEV,
|
||||
round(t1.OutAmountDEV,2) OutAmountDEV,
|
||||
round(t1.InAmountDEV2,2) InAmountDEV2,
|
||||
round(t1.OutAmountDEV2,2) OutAmountDEV2,
|
||||
case when InAmountHUF>0 then
|
||||
case when t1.InAmountDEV <>0 then round(t1.InAmountHUF,2)/round(t1.InAmountDEV,2)
|
||||
else 0
|
||||
end
|
||||
else
|
||||
case when t1.OutAmountDEV <>0 then round(t1.OutAmountHUF,2)/round(t1.OutAmountDEV,2)
|
||||
else 0
|
||||
end
|
||||
end CurrencyRate,
|
||||
round(t1.InAmountHUF,2) InAmountHUF,
|
||||
round(t1.OutAmountHUF,2) OutAmountHUF,
|
||||
case when t3.CurrencyName=t5.CurrencyName then round(t1.InAmountDEV,2)* round(t3.CurrencyRate,2)
|
||||
else round(t1.InAmountDEV2,2)* round(t3.CurrencyRate,2)
|
||||
end InAmountHUF_Account,
|
||||
case when t3.CurrencyName=t5.CurrencyName then round(t1.OutAmountDEV,2)*round(t3.CurrencyRate,2)
|
||||
else round(t1.OutAmountDEV2,2)*round(t3.CurrencyRate,2)
|
||||
end OutAmountHUF_Account,
|
||||
case when t3.CurrencyName=t5.CurrencyName then round(t1.InAmountDEV,2)* round(t3.CurrencyRate,2)
|
||||
else round(t1.InAmountDEV2,2)* round(t3.CurrencyRate,2)
|
||||
end - round(t1.InAmountHUF,2) InAmountHUF_Diff,
|
||||
case when t3.CurrencyName=t5.CurrencyName then round(t1.OutAmountDEV,2)*round(t3.CurrencyRate,2)
|
||||
else round(t1.OutAmountDEV2,2)*round(t3.CurrencyRate,2)
|
||||
end - round(t1.OutAmountHUF,2) OutAmountHUF_Diff,
|
||||
t1.GLRowsRatediff GLRowsRatediff,
|
||||
case when t1.PartnerType = 0 Then
|
||||
case when case when t3.CurrencyName=t5.CurrencyName then round(t1.InAmountDEV,2)* round(t3.CurrencyRate,2)
|
||||
else round(t1.InAmountDEV2,2)* round(t3.CurrencyRate,2)
|
||||
end - round(t1.InAmountHUF,2) > 0 Then -1
|
||||
else 1
|
||||
end
|
||||
when t1.PartnerType = 1 Then
|
||||
case when case when t3.CurrencyName=t5.CurrencyName then round(t1.OutAmountDEV,2)*round(t3.CurrencyRate,2)
|
||||
else round(t1.OutAmountDEV2,2)*round(t3.CurrencyRate,2)
|
||||
end - round(t1.OutAmountHUF,2) > 0 Then 1
|
||||
else -1
|
||||
end
|
||||
else 0
|
||||
end RateDiffState
|
||||
from GLRows t1
|
||||
left join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
join vv_PartnerConnectionInfoAccount t3 on t2.CustomersFrom=t3.CustomersFrom
|
||||
and t1.PartnerType=t3.PartnerType and t1.Customer=t3.Customers and t1.ConnectInfo=t3.ConnectInfo
|
||||
left join PCIGroup t4 on t2.CustomersFrom=t4.CustomersFrom
|
||||
and t1.PartnerType=t4.PartnerType and t1.Customer=t4.Customers and t1.ConnectInfo=t4.ConnectInfo
|
||||
left join LiquidAssets t5 on t1.LiquidAssets=t5.Oid
|
||||
left join CurrencyName t6 on t5.CurrencyName=t6.Oid
|
||||
left join CurrencyName t7 on t3.CurrencyName=t7.Oid
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType in (2,3,4) and
|
||||
t6.ShortName <> 'HUF' and isnull(t7.ShortName,'HUF')<>'HUF' and
|
||||
((t1.PartnerType=0 and t1.InAmountHUF>0) or (t1.PartnerType=1 and t1.OutAmountHUF>0))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
CREATE VIEW vv_GLAccountRowsforBookEntry
|
||||
AS
|
||||
SELECT 1 PartnerType,
|
||||
0 GLRowsTypeVAT,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t2.Customers Customers,
|
||||
t2.F_DateExecution DateExecution,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
t2.RegistryNumber RegistryNumber,
|
||||
CASE WHEN ifnull(t1.IsReinvoice,0)=0 THEN t3.ChartOfAccounts
|
||||
ELSE t3.ChartOfAccounts2
|
||||
END DebitChartOfAccounts,
|
||||
t5.ChartOfAccountsIn CreditChartOfAccounts,
|
||||
t1.Controlling Controlling,
|
||||
t1.JobNumberObjects JobNumberObjects,
|
||||
t7.UniqueObjects UniqueObjects,
|
||||
t1.CostPlace CostPlace,
|
||||
t1.CostHolder CostHolder,
|
||||
t2.F_CurrencyRate CurrencyRate,
|
||||
t1.Amount AmountHUF,
|
||||
CASE WHEN t2.F_CurrencyRate<>0 and t6.ShortName<>'HUF' THEN ROUND(t1.Amount/t2.F_CurrencyRate,2) ELSE 0 END AmountDEV,
|
||||
t2.ShortName Note1,
|
||||
'' Note2,
|
||||
NULL VAT,
|
||||
t1.ChartOfAccounts ChartOfAccounts2,
|
||||
ifnull(t1.IsReinvoice,0) IsReinvoice,
|
||||
t1.ContractRows ContractRows,
|
||||
ifnull(t1.F_ReadyforBookEntryRows,0) ReadyforBookEntryRows,
|
||||
t2.Oid RegistryHeader,
|
||||
Null InvoiceHeader,
|
||||
t2.CurrentWorkflowSystemSteps WorkflowSystemSteps,
|
||||
t1.WorkflowMessage WorkflowMessage
|
||||
from RegistryRowsFinancialControlling t1 join RegistryHeader t2 on
|
||||
t1.RegistryHeader=t2.Oid LEFT JOIN Controlling t3 ON
|
||||
t1.Controlling=t3.Oid LEFT JOIN Customers t4 ON
|
||||
t2.Customers=t4.Oid LEFT JOIN CustomersGLParameters t5 ON
|
||||
t4.CustomersGLParameters=t5.Oid LEFT JOIN CurrencyName t6 ON
|
||||
t2.F_CurrencyName=t6.Oid LEFT JOIN ContractRows t7 ON
|
||||
t1.ContractRows=t7.Oid
|
||||
WHERE t1.GCRecord IS NULL AND
|
||||
ifnull(t2.IsEditable,0)=0 AND
|
||||
t2.F_GLAccounts IS NULL AND
|
||||
ifnull(t1.F_ReadyforBookEntryRows,0)=0
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 1 PartnerType,
|
||||
1 GLRowsTypeVAT,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t2.Customers Customers,
|
||||
ifnull(ifnull(t1.DateVAT,t2.F_DateVAT),t2.F_DateExecution) DateExecution,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
t2.RegistryNumber RegistryNumber,
|
||||
t3.ChartOfAccountsIn DebitChartOfAccounts,
|
||||
case when ifnull(t3.InversState,0)=1 then t3.ChartOfAccountsOut
|
||||
else t5.ChartOfAccountsIn end CreditChartOfAccounts,
|
||||
NULL Controlling,
|
||||
NULL JobNumberObjects,
|
||||
NULL UniqueObjects,
|
||||
NULL CostPlace,
|
||||
NULL CostHolder,
|
||||
1 CurrencyRate,
|
||||
CASE WHEN t1.VAT IS NULL THEN 0
|
||||
WHEN t1.VAT IS NOT NULL THEN
|
||||
case when t3.InversState=0 then ROUND(t1.BruttoAmount/(1+t3.KeyValue)*t3.KeyValue,0)
|
||||
else ROUND(t1.BruttoAmount*t3.InversKeyValue,0) end
|
||||
END AmountHUF,
|
||||
0 AmountDEV,
|
||||
t2.ShortName Note1,
|
||||
'' Note2,
|
||||
t1.VAT VAT,
|
||||
NULL ChartOfAccounts2,
|
||||
0 IsReinvoice,
|
||||
NULL ContractRows,
|
||||
ifnull(t1.F_ReadyforBookEntryRows,0) ReadyforBookEntryRows,
|
||||
t2.Oid RegistryHeader,
|
||||
NULL InvoiceHeader,
|
||||
t2.CurrentWorkflowSystemSteps WorkflowSystemSteps,
|
||||
'' WorkflowMessage
|
||||
from RegistryRowsFinancial t1 join RegistryHeader t2 on
|
||||
t1.RegistryHeader=t2.Oid LEFT JOIN VAT t3 ON
|
||||
t1.VAT=t3.oid LEFT JOIN Customers t4 ON
|
||||
t2.Customers=t4.Oid LEFT JOIN CustomersGLParameters t5 ON
|
||||
t4.CustomersGLParameters=t5.Oid LEFT JOIN CurrencyName t6 ON
|
||||
t2.F_CurrencyName=t6.Oid
|
||||
WHERE t1.GCRecord IS NULL AND
|
||||
ifnull(t2.IsEditable,0)=0 AND
|
||||
t2.F_GLAccounts IS NULL AND
|
||||
ifnull(t1.F_ReadyforBookEntryRows,0)=0
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 0 PartnerType,
|
||||
0 GLRowsTypeVAT,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t2.Customers Customers,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
'' RegistryNumber,
|
||||
t5.ChartOfAccountsOut DebitChartOfAccounts,
|
||||
ifnull(t9.ChartOfAccounts,t3.ChartOfAccounts) CreditChartOfAccounts,
|
||||
ifnull(t8.Controlling,t1.Controlling) Controlling,
|
||||
ifnull(t8.JobNumberObjects,t1.JobNumberObjects) JobNumberObjects,
|
||||
ifnull(t8.UniqueObjects,t1.UniqueObjects) UniqueObjects,
|
||||
ifnull(t8.CostPlace,t1.CostPlace) CostPlace,
|
||||
ifnull(t8.CostHolder,t1.CostHolder) CostHolder,
|
||||
t2.CurrencyRate CurrencyRate,
|
||||
(t1.ListPriceHUF-t1.DiscountPriceHUF)*t1.QTT AmountHUF,
|
||||
(t1.ListPriceDEV-t1.DiscountPriceDEV)*t1.QTT AmountDEV,
|
||||
t2.Description Note1,
|
||||
'' Note2,
|
||||
NULL VAT,
|
||||
t1.ChartOfAccounts ChartOfAccounts2,
|
||||
0 IsReinvoice,
|
||||
t1.ContractRows ContractRows,
|
||||
ifnull(t1.ReadyforBookEntryRows,0) ReadyforBookEntryRows,
|
||||
NULL RegistryHeader,
|
||||
t2.Oid InvoiceHeader,
|
||||
t1.WorkflowSystemSteps WorkflowSystemSteps,
|
||||
'' WorkflowMessage
|
||||
FROM InvoiceRows t1 JOIN InvoiceHeader t2 ON
|
||||
t1.InvoiceHeader=t2.Oid LEFT JOIN Controlling t3 ON
|
||||
t1.Controlling=t3.Oid LEFT JOIN Customers t4 ON
|
||||
t2.Customers=t4.Oid LEFT JOIN CustomersGLParameters t5 ON
|
||||
t4.CustomersGLParameters=t5.Oid LEFT JOIN CurrencyName t6 ON
|
||||
t2.CurrencyName=t6.Oid LEFT JOIN InvoiceType t7 ON
|
||||
t2.InvoiceType=t7.Oid LEFT JOIN ContractRows t8 ON
|
||||
t1.ContractRows=t8.Oid LEFT JOIN Controlling t9 ON
|
||||
t8.Controlling=t9.Oid
|
||||
WHERE t1.GCRecord IS NULL AND
|
||||
ifnull(t2.IsEditable,0)=0 AND
|
||||
t2.GLAccounts IS NULL AND
|
||||
ifnull(t1.ReadyforBookEntryRows,0)=0 AND
|
||||
t7.InvoiceTypeBase in (1,2,3) and
|
||||
ifnull(t2.IsProforma,0)=0
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 0 PartnerType,
|
||||
1 GLRowsTypeVAT,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t2.Customers Customers,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
'' RegistryNumber,
|
||||
t5.ChartOfAccountsOut DebitChartOfAccounts,
|
||||
t3.ChartOfAccountsOut CreditChartOfAccounts,
|
||||
NULL Controlling,
|
||||
NULL JobNumberObjects,
|
||||
NULL UniqueObjects,
|
||||
NULL CostPlace,
|
||||
NULL CostHolder,
|
||||
1 CurrencyRate,
|
||||
t1.AmountVATHUF AmountHUF,
|
||||
t1.AmountVATDEV AmountDEV,
|
||||
t2.Description Note1,
|
||||
'' Note2,
|
||||
t1.VAT VAT,
|
||||
NULL ChartOfAccounts2,
|
||||
0 IsReinvoice,
|
||||
NULL ContractRows,
|
||||
ifnull(t1.ReadyforBookEntryRows,0) ReadyforBookEntryRows,
|
||||
NULL RegistryHeader,
|
||||
t2.Oid InvoiceHeader,
|
||||
Null WorkflowSystemSteps,
|
||||
'' WorkflowMessage
|
||||
from InvoiceVATRows t1 join InvoiceHeader t2 on
|
||||
t1.InvoiceHeader=t2.Oid LEFT JOIN VAT t3 ON
|
||||
t1.VAT=t3.oid LEFT JOIN Customers t4 ON
|
||||
t2.Customers=t4.Oid LEFT JOIN CustomersGLParameters t5 ON
|
||||
t4.CustomersGLParameters=t5.Oid LEFT JOIN CurrencyName t6 ON
|
||||
t2.CurrencyName=t6.Oid LEFT JOIN InvoiceType t7 ON
|
||||
t2.InvoiceType=t7.Oid
|
||||
WHERE t1.GCRecord IS NULL AND
|
||||
ifnull(t2.IsEditable,0)=0 AND
|
||||
t2.GLAccounts IS NULL AND
|
||||
ifnull(t1.ReadyforBookEntryRows,0)=0 AND
|
||||
ifnull(t2.IsProforma,0)=0 AND
|
||||
t7.InvoiceTypeBase in (1,2,3)
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
CREATE view vv_PartnerConnectionInfoAccount
|
||||
as
|
||||
select '01-Account' MainType,
|
||||
t2.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t2.DocumentNumber ConnectInfo,
|
||||
t2.CurrencyName CurrencyName,
|
||||
sum(t1.AmountHUF) BallanceHUF,
|
||||
sum(t1.AmountDEV) BallanceDEV,
|
||||
t3.ShortName Currency,
|
||||
t2.DatePayment DatePayment,
|
||||
t2.DateCreated DateCreated,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.CurrencyRate CurrencyRate,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
max(t2.RegistryNumber) RegistryNumber
|
||||
from GLRows t1 join GLHeader t2 on
|
||||
t1.GLHeader=t2.Oid left join CurrencyName t3 on
|
||||
t2.CurrencyName=t3.Oid
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=1 and
|
||||
ifnull(t2.IsEditable,0)=0 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t2.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t2.DocumentNumber,t2.CurrencyName,t3.ShortName,t2.DateExecution,t2.DatePayment,
|
||||
t2.DateCreated,t2.DateExecution,t2.CurrencyRate
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
0 PartnerType,
|
||||
t1.DocumentNumber ConnectInfo,
|
||||
t1.CurrencyName CurrencyName,
|
||||
t1.TotalBruttoHUF BallanceHUF,
|
||||
t1.TotalBruttoDEV BallanceDEV,
|
||||
t3.ShortName Currency,
|
||||
t1.DatePayment DatePayment,
|
||||
t1.DateCreated DateCreated,
|
||||
t1.DateExecution DateExecution,
|
||||
t1.CurrencyRate CurrencyRate,
|
||||
t1.DocumentNumber DocumentNumber,
|
||||
t1.DocumentNumber RegistryNumber
|
||||
from InvoiceHeader t1 left join CurrencyName t3 on
|
||||
t1.CurrencyName=t3.Oid
|
||||
where t1.GLAccounts is null and
|
||||
t1.IsEditable=0 and
|
||||
t1.GCRecord is null
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
1 PartnerType,
|
||||
t1.DocumentNumber ConnectInfo,
|
||||
t1.F_CurrencyName CurrencyName,
|
||||
t1.F_AmountBruttoHUF BallanceHUF,
|
||||
t1.F_AmountBruttoDEV BallanceDEV,
|
||||
t3.ShortName Currency,
|
||||
t1.F_DatePayment DatePayment,
|
||||
t1.F_DateCreated DateCreated,
|
||||
t1.F_DateExecution DateExecution,
|
||||
t1.F_CurrencyRate CurrencyRate,
|
||||
t1.DocumentNumber DocumentNumber,
|
||||
t1.RegistryNumber RegistryNumber
|
||||
from RegistryHeader t1 left join RegistryType t2 on
|
||||
t1.RegistryType=t2.Oid left join CurrencyName t3 on
|
||||
t1.F_CurrencyName=t3.Oid
|
||||
where t1.GCRecord is null and
|
||||
t1.F_GLAccounts is null and
|
||||
t1.IsEditable=0 and
|
||||
t1.IsStorno=0 and
|
||||
t2.RegistryMainType=0 and
|
||||
t1.RegistryAcceptState=0
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
CREATE view vv_PartnerConnectionInfoAged
|
||||
as
|
||||
select t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t2.DocumentNumber DocumentNumber,
|
||||
t2.RegistryNumber RegistryNumber,
|
||||
t1.DateExecution_Account DateExecution,
|
||||
t1.DatePayment_Account DatePayment,
|
||||
t1.CurrencyName_Account CurrencyName_Account,
|
||||
t1.AmountHUF_Account AmountHUF,
|
||||
t1.AmountDEV_Account AmountDEV,
|
||||
t1.BallanceHUF BallanceHUF,
|
||||
t1.BallanceDEV BallanceDEV
|
||||
from PCIDetail t1 join
|
||||
vv_PartnerConnectionInfoAccount t2 on
|
||||
t1.CustomersFrom=t2.CustomersFrom and
|
||||
t1.Customers=t2.Customers and
|
||||
t1.PartnerType=t2.PartnerType and
|
||||
t1.ConnectInfo=t2.ConnectInfo
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
CREATE view vv_PartnerConnectionInfoConnect
|
||||
as
|
||||
select
|
||||
t1.MainType MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t1.CurrencyName CurrencyName,
|
||||
t1.DebitTotalHUF DebitTotalHUF,
|
||||
t1.CreditTotalHUF CreditTotalHUF,
|
||||
t1.DebitTotalDEV DebitTotalDEV,
|
||||
t1.CreditTotalDEV CreditTotalDEV,
|
||||
t1.BallanceHUF BallanceHUF,
|
||||
t1.BallanceDEV BallanceDEV,
|
||||
t1.ShortName ShortName,
|
||||
t1.Description Description,
|
||||
t1.DateExecution DateExecution,
|
||||
t1.DateCreated DateCreated,
|
||||
t1.DatePayment DatePayment,
|
||||
t1.DelayedDay DelayedDay,
|
||||
t1.DelayedRange DelayedRange,
|
||||
t1.CurrencyName_Account CurrencyName_Account,
|
||||
t1.AmountHUF_Account AmountHUF_Account,
|
||||
t1.AmountDEV_Account AmountDEV_Account,
|
||||
t1.DateExecution_Account DateExecution_Account,
|
||||
t2.BallanceState BallanceState,
|
||||
t2.BallanceRateDiff BallanceRateDiff
|
||||
from vv_PartnerConnectionInfoDetail t1
|
||||
join vv_PartnerConnectionInfoDetailGroup t2 on
|
||||
t1.CustomersFrom=t2.CustomersFrom and
|
||||
t1.Customers=t2.Customers and
|
||||
t1.PartnerType=t2.PartnerType and
|
||||
t1.ConnectInfo=t2.ConnectInfo
|
||||
|
||||
+405
@@ -0,0 +1,405 @@
|
||||
CREATE view vv_PartnerConnectionInfoDetail
|
||||
as
|
||||
select '01-Account' MainType,
|
||||
t2.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t2.CurrencyName CurrencyName,
|
||||
max(t3.AmountHUFBrutto) DebitTotalHUF,
|
||||
0 CreditTotalHUF,
|
||||
max(t3.AmountDEVBrutto) DebitTotalDEV,
|
||||
0 CreditTotalDEV,
|
||||
max(t3.AmountHUFBrutto) BallanceHUF,
|
||||
max(t3.AmountDEVBrutto) BallanceDEV,
|
||||
'' ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateCreated DateCreated,
|
||||
t2.DatePayment DatePayment,
|
||||
DATEDIFF(t2.DatePayment,curdate()) DelayedDay,
|
||||
case when DATEDIFF(t2.DatePayment,curdate())<=0 then 0
|
||||
when DATEDIFF(t2.DatePayment,curdate())>0 and DATEDIFF(t2.DatePayment,curdate())<=15 then 1
|
||||
when DATEDIFF(t2.DatePayment,curdate())>15 and DATEDIFF(t2.DatePayment,curdate())<=30 then 2
|
||||
when DATEDIFF(t2.DatePayment,curdate())>30 and DATEDIFF(t2.DatePayment,curdate())<=60 then 3
|
||||
when DATEDIFF(t2.DatePayment,curdate())>60 and DATEDIFF(t2.DatePayment,curdate())<=90 then 4
|
||||
when DATEDIFF(t2.DatePayment,curdate())>90 and DATEDIFF(t2.DatePayment,curdate())<=180 then 5
|
||||
when DATEDIFF(t2.DatePayment,curdate())>180 and DATEDIFF(t2.DatePayment,curdate())<=360 then 6
|
||||
when DATEDIFF(t2.DatePayment,curdate())>360 then 7
|
||||
end DelayedRange,
|
||||
t2.CurrencyName CurrencyName_Account,
|
||||
sum(t1.AmountHUF) AmountHUF_Account,
|
||||
sum(t1.AmountDEV) AmountDEV_Account,
|
||||
t2.DateExecution DateExecution_Account
|
||||
from GLRows t1 join GLHeader t2 on
|
||||
t1.GLHeader=t2.Oid join GLAccounts t3 on
|
||||
t1.GLHeader=t3.Oid
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=1 and
|
||||
t2.IsEditable=0 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t2.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t2.CurrencyName,t2.DateExecution,t2.DateCreated,t2.DatePayment
|
||||
|
||||
union all
|
||||
|
||||
select '02-Bank' MainType,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t3.CurrencyName CurrencyName,
|
||||
0 DebitTotalHUF,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalHUF,
|
||||
0 DebitTotalDEV,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalDEV,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end)*-1 BallanceHUF,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.InAmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.OutAmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.OutAmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.InAmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF'then sum(t1.InAmountDEV2)*-1
|
||||
else 0
|
||||
end)*-1 BallanceDEV,
|
||||
max(t3.ShortName+', '+ifnull(t2.DocumentNumber,'')) ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateExecution DateCreated,
|
||||
t4.DatePayment DatePayment,
|
||||
0 DelayedDay,
|
||||
'' DelayedRange,
|
||||
t4.CurrencyName CurrencyName_Account,
|
||||
0 AmountHUF_Account,
|
||||
0 AmountDEV_Account,
|
||||
max(t4.DateExecution) DateExecution_Account
|
||||
from GLRows t1
|
||||
join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
left join GLBank t5 on t2.Oid=t5.Oid
|
||||
left join LiquidAssets t3 on t5.LiquidAssets_Main=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on t2.CustomersFrom=t4.CustomersFrom
|
||||
and t1.Customer=t4.Customers and t1.PartnerType=t4.PartnerType and t1.ConnectInfo=t4.ConnectInfo
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=2 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t1.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t3.CurrencyName,t4.Currency,t2.DateExecution,t4.DatePayment,t4.CurrencyName
|
||||
|
||||
union all
|
||||
|
||||
select '03-Cassa' MainType,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t3.CurrencyName CurrencyName,
|
||||
0 DebitTotalHUF,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalHUF,
|
||||
0 DebitTotalDEV,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalDEV,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end)*-1 BallanceHUF,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF'then sum(t1.InAmountDEV2)*-1
|
||||
end)*-1 BallanceDEV,
|
||||
max(t3.ShortName+', '+ifnull(t2.DocumentNumber,'')) ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateExecution DateCreated,
|
||||
t4.DatePayment DatePayment,
|
||||
0 DelayedDay,
|
||||
'' DelayedRange,
|
||||
t4.CurrencyName CurrencyName_Account,
|
||||
0 AmountHUF_Account,
|
||||
0 AmountDEV_Account,
|
||||
max(t4.DateExecution) DateExecution_Account
|
||||
from GLRows t1
|
||||
join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
left join GLCassa t5 on t2.Oid=t5.Oid
|
||||
left join LiquidAssets t3 on t5.LiquidAssets_Cassa=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on t2.CustomersFrom=t4.CustomersFrom and
|
||||
t1.Customer=t4.Customers and t1.PartnerType=t4.PartnerType and t1.ConnectInfo=t4.ConnectInfo
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=3 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t1.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t3.CurrencyName,t4.Currency,t2.DateExecution,t4.DatePayment,t4.CurrencyName
|
||||
|
||||
union all
|
||||
|
||||
select '05-Ratediff' MainType,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t2.CurrencyName CurrencyName,
|
||||
0 DebitTotalHUF,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end CreditTotalHUF,
|
||||
0 DebitTotalDEV,
|
||||
0 CreditTotalDEV,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end)*-1 BallanceHUF,
|
||||
0 BallanceDEV,
|
||||
max(ifnull(t7.ShortName,'')+', '++ifnull(t8.DocumentNumber,'')+', '+ifnull(t2.DocumentNumber,'')) ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateExecution DateCreated,
|
||||
Null DatePayment,
|
||||
0 DelayedDay,
|
||||
'' DelayedRange,
|
||||
t4.CurrencyName CurrencyName_Account,
|
||||
0 AmountHUF_Account,
|
||||
0 AmountDEV_Account,
|
||||
max(t4.DateExecution) DateExecution_Account
|
||||
from GLRows t1
|
||||
join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
left join LiquidAssets t3 on t1.LiquidAssets=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on t2.CustomersFrom=t4.CustomersFrom and
|
||||
t1.Customer=t4.Customers and t1.PartnerType=t4.PartnerType and t1.ConnectInfo=t4.ConnectInfo
|
||||
left join GLRows t6 on
|
||||
t1.GLRowsRateDiff=t6.Oid left join LiquidAssets t7 on
|
||||
t6.LiquidAssets=t7.oid left join GLHeader t8 on
|
||||
t6.GLHeader=t8.oid
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType=5 and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t1.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t2.CurrencyName,t2.DateExecution,t2.DatePayment,t4.CurrencyName
|
||||
|
||||
union all
|
||||
|
||||
select case when max(t2.GLDocumentType)=4 then '04-Compensation'
|
||||
when max(t2.GLDocumentType)=0 then '06-Mixed'
|
||||
end MainType,
|
||||
t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.Customer Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t3.CurrencyName CurrencyName,
|
||||
0 DebitTotalHUF,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalHUF,
|
||||
0 DebitTotalDEV,
|
||||
case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName then sum(t1.InAmountDEV2)*-1
|
||||
end CreditTotalDEV,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountHUF)<>0 then sum(t1.AmountHUF)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountHUF)<>0 then sum(t1.AmountHUF)*-1
|
||||
end)*-1 BallanceHUF,
|
||||
(case when t1.PartnerType=0 and sum(t1.InAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)=t3.CurrencyName then sum(t1.AmountDEV)*-1
|
||||
when t1.PartnerType=0 and sum(t1.InAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.InAmountDEV2)
|
||||
when t1.PartnerType=0 and sum(t1.OutAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)*-1
|
||||
when t1.PartnerType=1 and sum(t1.OutAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF' then sum(t1.OutAmountDEV2)
|
||||
when t1.PartnerType=1 and sum(t1.InAmountDEV2)<>0 and
|
||||
ifnull(t4.CurrencyName,t3.CurrencyName)<>t3.CurrencyName and t4.Currency<>'HUF'then sum(t1.InAmountDEV2)*-1
|
||||
else 0
|
||||
end)*-1 BallanceDEV,
|
||||
max(t3.ShortName+', '+t2.DocumentNumber) ShortName,
|
||||
'' Description,
|
||||
t2.DateExecution DateExecution,
|
||||
t2.DateExecution DateCreated,
|
||||
t2.DateExecution DatePayment,
|
||||
0 DelayedDay,
|
||||
'' DelayedRange,
|
||||
t4.CurrencyName CurrencyName_Account,
|
||||
0 AmountHUF_Account,
|
||||
0 AmountDEV_Account,
|
||||
max(t4.DateExecution) DateExecution_Account
|
||||
from GLRows t1
|
||||
join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
left join GLCompensation t5 on t2.Oid=t5.Oid left
|
||||
join LiquidAssets t3 on t5.LiquidAssets_Main=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on t2.CustomersFrom=t4.CustomersFrom and
|
||||
t1.Customer=t4.Customers and t1.PartnerType=t4.PartnerType and t1.ConnectInfo=t4.ConnectInfo
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType in (4,0) and
|
||||
t1.PartnerType in (0,1) and
|
||||
t1.GCRecord is null
|
||||
group by t1.Oid,t2.CustomersFrom,t1.Customer,t1.PartnerType,
|
||||
t1.ConnectInfo,t3.CurrencyName,t4.Currency,t2.DateExecution,t4.DatePayment,t4.CurrencyName
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
0 PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t1.CurrencyName CurrencyName,
|
||||
t1.TotalBruttoHUF DebitTotalHUF,
|
||||
0 CreditTotalHUF,
|
||||
t1.TotalBruttoDEV DebitTotalDEV,
|
||||
0 CreditTotalDEV,
|
||||
t1.TotalBruttoHUF BallanceHUF,
|
||||
t1.TotalBruttoDEV BallanceDEV,
|
||||
'' ShortName,
|
||||
t1.Description Description,
|
||||
t1.DateExecution DateExecution,
|
||||
t1.DateCreated DateCreated,
|
||||
t1.DatePayment DatePayment,
|
||||
DATEDIFF(t1.DatePayment,curdate()) DelayedDay,
|
||||
case when DATEDIFF(t1.DatePayment,curdate())<=0 then 0
|
||||
when DATEDIFF(t1.DatePayment,curdate())>0 and DATEDIFF(t1.DatePayment,curdate())<=15 then 1
|
||||
when DATEDIFF(t1.DatePayment,curdate())>15 and DATEDIFF(t1.DatePayment,curdate())<=30 then 2
|
||||
when DATEDIFF(t1.DatePayment,curdate())>30 and DATEDIFF(t1.DatePayment,curdate())<=60 then 3
|
||||
when DATEDIFF(t1.DatePayment,curdate())>60 and DATEDIFF(t1.DatePayment,curdate())<=90 then 4
|
||||
when DATEDIFF(t1.DatePayment,curdate())>90 and DATEDIFF(t1.DatePayment,curdate())<=180 then 5
|
||||
when DATEDIFF(t1.DatePayment,curdate())>180 and DATEDIFF(t1.DatePayment,curdate())<=360 then 6
|
||||
when DATEDIFF(t1.DatePayment,curdate())>360 then 7
|
||||
end DelayedRange,
|
||||
t1.CurrencyName CurrencyName_Account,
|
||||
t1.TotalBruttoHUF AmountHUF_Account,
|
||||
t1.TotalBruttoDEV AmountDEV_Account,
|
||||
t1.DateExecution DateExecution_Account
|
||||
from InvoiceHeader t1
|
||||
where t1.GLAccounts is null and
|
||||
t1.IsEditable=0 and
|
||||
t1.GCRecord is null
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' MainType,
|
||||
t1.Oid Oid,
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
1 PartnerType,
|
||||
t1.DocumentNumber ConnectInfo,
|
||||
t1.F_CurrencyName CurrencyName,
|
||||
t1.F_AmountBruttoHUF DebitTotalHUF,
|
||||
0 CreditTotalHUF,
|
||||
t1.F_AmountBruttoDEV DebitTotalDEV,
|
||||
0 CreditTotalDEV,
|
||||
t1.F_AmountBruttoHUF BallanceHUF,
|
||||
t1.F_AmountBruttoDEV BallanceDEV,
|
||||
'' ShortName,
|
||||
'' Description,
|
||||
t1.F_DateExecution DateExecution,
|
||||
t1.F_DateCreated DateCreated,
|
||||
t1.F_DatePayment DatePayment,
|
||||
DATEDIFF(t1.F_DatePayment,curdate()) DelayedDay,
|
||||
case when DATEDIFF(t1.F_DatePayment,curdate())<=0 then 0
|
||||
when DATEDIFF(t1.F_DatePayment,curdate())>0 and DATEDIFF(t1.F_DatePayment,curdate())<=15 then 1
|
||||
when DATEDIFF(t1.F_DatePayment,curdate())>15 and DATEDIFF(t1.F_DatePayment,curdate())<=30 then 2
|
||||
when DATEDIFF(t1.F_DatePayment,curdate())>30 and DATEDIFF(t1.F_DatePayment,curdate())<=60 then 3
|
||||
when DATEDIFF(t1.F_DatePayment,curdate())>60 and DATEDIFF(t1.F_DatePayment,curdate())<=90 then 4
|
||||
when DATEDIFF(t1.F_DatePayment,curdate())>90 and DATEDIFF(t1.F_DatePayment,curdate())<=180 then 5
|
||||
when DATEDIFF(t1.F_DatePayment,curdate())>180 and DATEDIFF(t1.F_DatePayment,curdate())<=360 then 6
|
||||
when DATEDIFF(t1.F_DatePayment,curdate())>360 then 7
|
||||
end DelayedRange,
|
||||
t1.F_CurrencyName CurrencyName_Account,
|
||||
t1.F_AmountBruttoHUF AmountHUF_Account,
|
||||
t1.F_AmountBruttoDEV AmountDEV_Account,
|
||||
t1.F_DateExecution DateExecution_Account
|
||||
from RegistryHeader t1
|
||||
left join RegistryType t2 on t1.RegistryType=t2.Oid
|
||||
where t1.GCRecord is null and
|
||||
t1.F_GLAccounts is null and
|
||||
t1.IsEditable=0 and
|
||||
t1.IsStorno=0 and
|
||||
t2.RegistryMainType=0 and
|
||||
t1.RegistryAcceptState=0
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
CREATE view vv_PartnerConnectionInfoDetailGroup
|
||||
as
|
||||
SELECT MAX(CAST(t1.Oid AS CHAR(100))) Oid, /*varchart nem ismeri???*/
|
||||
t1.CustomersFrom CustomersFrom,
|
||||
t1.Customers Customers,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
max(t2.ShortName) Currency,
|
||||
sum(t1.DebitTotalHUF) DebitTotalHUF,
|
||||
SUM(t1.CreditTotalHUF) CreditTotalHUF,
|
||||
sum(t1.DebitTotalDEV) DebitTotalDEV,
|
||||
SUM(t1.CreditTotalDEV) CreditTotalDEV,
|
||||
SUM(t1.BallanceHUF) BallanceHUF,
|
||||
SUM(t1.BallanceDEV) BallanceDEV,
|
||||
case when t1.PartnerType=1 then SUM(t1.BallanceHUF)*-1 else 0 end BallanceHUF_P,
|
||||
case when t1.PartnerType=1 then SUM(t1.BallanceDEV)*-1 else 0 end BallanceDEV_P,
|
||||
case when t1.PartnerType=0 then SUM(t1.BallanceHUF) else 0 end BallanceHUF_R,
|
||||
case when t1.PartnerType=0 then SUM(t1.BallanceDEV) else 0 end BallanceDEV_R,
|
||||
(case when t1.PartnerType=0 then SUM(t1.BallanceHUF) else 0 end) -
|
||||
(case when t1.PartnerType=1 then SUM(t1.BallanceHUF)*-1 else 0 end) BallanceHUF_B,
|
||||
(case when t1.PartnerType=0 then SUM(t1.BallanceDEV) else 0 end) -
|
||||
(case when t1.PartnerType=1 then SUM(t1.BallanceDEV)*-1 else 0 end) BallanceDEV_B,
|
||||
max(t3.ShortName) Currency_Account,
|
||||
sum(t1.AmountHUF_Account) AmountHUF_Account,
|
||||
sum(t1.AmountDEV_Account) AmountDEV_Account,
|
||||
case when max(t3.ShortName)='HUF' then
|
||||
case when round(SUM(t1.BallanceHUF),0)=0 then 1
|
||||
else 0
|
||||
end
|
||||
else
|
||||
case when round(SUM(t1.BallanceDEV),2)=0 then 1
|
||||
else 0
|
||||
end
|
||||
end BallanceState,
|
||||
case when max(t3.ShortName)='HUF' then -1
|
||||
when t1.CurrencyName_Account IS null then -1
|
||||
else
|
||||
case when round(SUM(t1.BallanceDEV),2)=0 and round(SUM(t1.BallanceHUF),0)<>0 then 1
|
||||
else 0
|
||||
end
|
||||
end BallanceRateDiff,
|
||||
max(t4.DateExecution) DateExecution_Account,
|
||||
MAX(t4.DateCreated) DateCreated_Account
|
||||
from vv_PartnerConnectionInfoDetail t1
|
||||
left join CurrencyName t2 on t1.CurrencyName=t2.Oid
|
||||
left join CurrencyName t3 on t1.CurrencyName_Account=t3.Oid
|
||||
left join vv_PartnerConnectionInfoAccount t4 on
|
||||
t1.CustomersFrom=t4.CustomersFrom and
|
||||
t1.Customers=t4.Customers and
|
||||
t1.PartnerType=t4.PartnerType and
|
||||
t1.ConnectInfo=t4.ConnectInfo and
|
||||
t4.MainType='01-Account'
|
||||
|
||||
group by t1.CustomersFrom,t1.Customers,t1.PartnerType,t1.ConnectInfo,t1.CurrencyName_Account
|
||||
@@ -0,0 +1,8 @@
|
||||
CREATE view vv_ProductSelect
|
||||
as
|
||||
select case when t2.Oid IS null then t1.Oid else t2.Oid end Oid,
|
||||
t1.Oid Products,
|
||||
t2.oid StorageComputed
|
||||
from Products t1 left join StorageComputed t2 on
|
||||
t1.Oid=t2.Products
|
||||
where t1.GCRecord is null and t2.GCRecord is null
|
||||
@@ -0,0 +1,28 @@
|
||||
CREATE view vv_RegistryBankTransfer
|
||||
as
|
||||
select t1.Oid Oid,
|
||||
t1.RegistryHeader RegistryHeader,
|
||||
t1.AmountHUF AmountHUF,
|
||||
t1.AmountDEV AmountDEV,
|
||||
t1.DatePayment DatePayment,
|
||||
t1.IsBlocked IsBlocked,
|
||||
t1.Note Note,
|
||||
t1.BankSavedFileName BankSavedFileName,
|
||||
ifnull(t3.BallanceHUF,t2.F_AmountBruttoHUF) BallanceHUF,
|
||||
ifnull(t3.BallanceDEV,t2.F_AmountBruttoDEV) BallanceDEV,
|
||||
t1.AmountHUF-ifnull(t3.BallanceHUF,t2.F_AmountBruttoHUF) DifferenceHUF,
|
||||
t1.AmountDEV-ifnull(t3.BallanceDEV,t2.F_AmountBruttoDEV) DifferenceDEV,
|
||||
case when round(ifnull(t3.BallanceHUF,t2.F_AmountBruttoHUF),2)=0 then 0
|
||||
when ifnull(t3.BallanceHUF,t2.F_AmountBruttoHUF)>=t1.AmountHUF then t1.AmountHUF
|
||||
when ifnull(t3.BallanceHUF,t2.F_AmountBruttoHUF)<=t1.AmountHUF then ifnull(t3.BallanceHUF,t2.F_AmountBruttoHUF)
|
||||
end OfferedHUF,
|
||||
case when round(ifnull(t3.BallanceDEV,t2.F_AmountBruttoDEV),2)=0 then 0
|
||||
when ifnull(t3.BallanceDEV,t2.F_AmountBruttoDEV)>=t1.AmountDEV then t1.AmountDEV
|
||||
when ifnull(t3.BallanceDEV,t2.F_AmountBruttoDEV)<=t1.AmountDEV then ifnull(t3.BallanceDEV,t2.F_AmountBruttoDEV)
|
||||
end OfferedDEV,
|
||||
t1.BankPrepareName BankPrepareName
|
||||
from RegistryBankTransfer t1
|
||||
join RegistryHeader t2 on t1.RegistryHeader=t2.Oid
|
||||
left join PCIGroup t3 on t2.CustomersFrom=t3.CustomersFrom
|
||||
and t2.Customers=t3.Customers and t3.PartnerType=1 and t2.DocumentNumber=t3.ConnectInfo
|
||||
where t1.GCRecord is null and t2.RegistryAcceptState=0
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
CREATE view vv_RegistryBankTransferPrepareName
|
||||
as
|
||||
select MAX(CAST(Oid AS CHAR(100))) Oid,
|
||||
BankPrepareName
|
||||
from RegistryBankTransfer
|
||||
where Ifnull(BankPrepareName,'')<>''
|
||||
group by BankPrepareName
|
||||
@@ -0,0 +1,70 @@
|
||||
CREATE view vv_WaitforRateDiff
|
||||
as
|
||||
select t1.Oid Oid,
|
||||
t2.CustomersFrom CustomersFrom,
|
||||
t1.PartnerType PartnerType,
|
||||
t1.Customer Customers,
|
||||
t1.ConnectInfo ConnectInfo,
|
||||
t3.DateExecution DateExecution_Account,
|
||||
t3.CurrencyName CurrencyName_Account,
|
||||
round(t4.AmountDEV_Account,2) AmountDEV_Account,
|
||||
round(t4.AmountHUF_Account,2) AmountHUF_Account,
|
||||
round(t4.BallanceDEV,2) BallanceDEV_Account,
|
||||
case when round(t4.AmountDEV_Account,2)<>0 then round(round(t4.AmountHUF_Account,2)/round(t4.AmountDEV_Account,2),2) else 0 end CurrencyRate_Account,
|
||||
t1.LiquidAssets LiquidAssets,
|
||||
t2.DateExecution DateExecution,
|
||||
round(t1.InAmountDEV,2) InAmountDEV,
|
||||
round(t1.OutAmountDEV,2) OutAmountDEV,
|
||||
round(t1.InAmountDEV2,2) InAmountDEV2,
|
||||
round(t1.OutAmountDEV2,2) OutAmountDEV2,
|
||||
case when InAmountHUF>0 then
|
||||
case when t1.InAmountDEV <>0 then round(t1.InAmountHUF,2)/round(t1.InAmountDEV,2)
|
||||
else 0
|
||||
end
|
||||
else
|
||||
case when t1.OutAmountDEV <>0 then round(t1.OutAmountHUF,2)/round(t1.OutAmountDEV,2)
|
||||
else 0
|
||||
end
|
||||
end CurrencyRate,
|
||||
round(t1.InAmountHUF,2) InAmountHUF,
|
||||
round(t1.OutAmountHUF,2) OutAmountHUF,
|
||||
case when t3.CurrencyName=t5.CurrencyName then round(t1.InAmountDEV,2)* round(t3.CurrencyRate,2)
|
||||
else round(t1.InAmountDEV2,2)* round(t3.CurrencyRate,2)
|
||||
end InAmountHUF_Account,
|
||||
case when t3.CurrencyName=t5.CurrencyName then round(t1.OutAmountDEV,2)*round(t3.CurrencyRate,2)
|
||||
else round(t1.OutAmountDEV2,2)*round(t3.CurrencyRate,2)
|
||||
end OutAmountHUF_Account,
|
||||
case when t3.CurrencyName=t5.CurrencyName then round(t1.InAmountDEV,2)* round(t3.CurrencyRate,2)
|
||||
else round(t1.InAmountDEV2,2)* round(t3.CurrencyRate,2)
|
||||
end - round(t1.InAmountHUF,2) InAmountHUF_Diff,
|
||||
case when t3.CurrencyName=t5.CurrencyName then round(t1.OutAmountDEV,2)*round(t3.CurrencyRate,2)
|
||||
else round(t1.OutAmountDEV2,2)*round(t3.CurrencyRate,2)
|
||||
end - round(t1.OutAmountHUF,2) OutAmountHUF_Diff,
|
||||
t1.GLRowsRatediff GLRowsRatediff,
|
||||
case when t1.PartnerType = 0 Then
|
||||
case when case when t3.CurrencyName=t5.CurrencyName then round(t1.InAmountDEV,2)* round(t3.CurrencyRate,2)
|
||||
else round(t1.InAmountDEV2,2)* round(t3.CurrencyRate,2)
|
||||
end - round(t1.InAmountHUF,2) > 0 Then -1
|
||||
else 1
|
||||
end
|
||||
when t1.PartnerType = 1 Then
|
||||
case when case when t3.CurrencyName=t5.CurrencyName then round(t1.OutAmountDEV,2)*round(t3.CurrencyRate,2)
|
||||
else round(t1.OutAmountDEV2,2)*round(t3.CurrencyRate,2)
|
||||
end - round(t1.OutAmountHUF,2) > 0 Then 1
|
||||
else -1
|
||||
end
|
||||
else 0
|
||||
end RateDiffState
|
||||
from GLRows t1
|
||||
left join GLHeader t2 on t1.GLHeader=t2.Oid
|
||||
join vv_PartnerConnectionInfoAccount t3 on t2.CustomersFrom=t3.CustomersFrom
|
||||
and t1.PartnerType=t3.PartnerType and t1.Customer=t3.Customers and t1.ConnectInfo=t3.ConnectInfo
|
||||
left join PCIGroup t4 on t2.CustomersFrom=t4.CustomersFrom
|
||||
and t1.PartnerType=t4.PartnerType and t1.Customer=t4.Customers and t1.ConnectInfo=t4.ConnectInfo
|
||||
left join LiquidAssets t5 on t1.LiquidAssets=t5.Oid
|
||||
left join CurrencyName t6 on t5.CurrencyName=t6.Oid
|
||||
left join CurrencyName t7 on t3.CurrencyName=t7.Oid
|
||||
where t2.GCRecord is null and
|
||||
t2.GLDocumentType in (2,3,4) and
|
||||
t6.ShortName <> 'HUF' and ifnull(t7.ShortName,'HUF')<>'HUF' and
|
||||
((t1.PartnerType=0 and t1.InAmountHUF>0) or (t1.PartnerType=1 and t1.OutAmountHUF>0))
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
|
||||
|
||||
SELECT 1 As "PartnerType",
|
||||
0 As "GLRowsTypeVAT",
|
||||
t1."Oid" As "Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t2."Customers" As "Customers",
|
||||
t2."F_DateExecution" As "DateExecution",
|
||||
t2."DocumentNumber" As "DocumentNumber",
|
||||
t2."RegistryNumber" As "RegistryNumber",
|
||||
CASE WHEN coalesce(t1."IsReInvoice",false)=false THEN t3."ChartOfAccounts"
|
||||
ELSE t8."ChartOfAccounts2"
|
||||
END As "DebitChartOfAccounts",
|
||||
t9."ChartOfAccountsIn" As "CreditChartOfAccounts",
|
||||
t1."Controlling" As "Controlling",
|
||||
t1."JobNumberObjects" As "JobNumberObjects",
|
||||
t7."UniqueObjects" As "UniqueObjects",
|
||||
t1."CostPlace" As "CostPlace",
|
||||
t1."CostHolder" As "CostHolder",
|
||||
t2."F_CurrencyRate" As "CurrencyRate",
|
||||
t1."Amount" As "AmountHUF",
|
||||
CASE WHEN t2."F_CurrencyRate"<>0 AND t6."ShortName"<>'HUF' THEN ROUND(cast(t1."Amount"/t2."F_CurrencyRate" AS numeric),2) ELSE 0 END As "AmountDEV",
|
||||
t2."ShortName" As "Note1",
|
||||
'' As "Note2",
|
||||
NULL As "VAT",
|
||||
t1."ChartOfAccounts" As "ChartOfAccounts2",
|
||||
coalesce(t1."IsReInvoice",false) As "IsReinvoice",
|
||||
t1."ContractRows" As "ContractRows",
|
||||
coalesce(t1."F_ReadyforBookEntryRows",false) As "ReadyforBookEntryRows",
|
||||
t2."Oid" As "RegistryHeader",
|
||||
NULL As "InvoiceHeader",
|
||||
t2."CurrentWorkflowSystemSteps" As "WorkflowSystemSteps",
|
||||
t1."WorkflowMessage" "WorkflowMessage"
|
||||
from "RegistryRowsFinancialControlling" t1 join "RegistryHeader" t2 on
|
||||
t1."RegistryHeader"=t2."Oid" LEFT JOIN "Controlling" t3 ON
|
||||
t1."Controlling"=t3."Oid" LEFT JOIN "Customers" t4 ON
|
||||
t2."Customers"=t4."Oid" LEFT JOIN "CustomersGLParameters" t5 ON
|
||||
t4."CustomersGLParameters"=t5."Oid" LEFT JOIN "CurrencyName" t6 ON
|
||||
t2."F_CurrencyName"=t6."Oid" LEFT JOIN "ContractRows" t7 ON
|
||||
t1."ContractRows"=t7."Oid" left join "ControllingYear" t8 on
|
||||
t3."Oid"=t8."Controlling" and extract(year from cast(t2."F_DateExecution" as timestamp))=t8."AccountYear" left join "CustomersGLParametersYear" t9 on
|
||||
t5."Oid"=t9."CustomersGLParameters" and extract(year from cast(t2."F_DateExecution"as timestamp))=t9."AccountYear"
|
||||
WHERE t1."GCRecord" IS NULL AND
|
||||
coalesce(t2."IsEditable",false)=false AND
|
||||
t2."F_GLAccounts" IS NULL AND
|
||||
coalesce(t1."F_ReadyforBookEntryRows",false)=false
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 1 As "PartnerType",
|
||||
1 As "GLRowsTypeVAT",
|
||||
t1."Oid"As " Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t2."Customers" As "Customers",
|
||||
coalesce(coalesce(t1."DateVAT",t2."F_DateVAT"),t2."F_DateExecution") As "DateExecution",
|
||||
t2."DocumentNumber" As "DocumentNumber",
|
||||
t2."RegistryNumber" As "RegistryNumber",
|
||||
t3."ChartOfAccountsIn" As "DebitChartOfAccounts",
|
||||
case when coalesce(t3."InversState",false)=true then t7."ChartOfAccountsOut"
|
||||
else t9."ChartOfAccountsIn" end "CreditChartOfAccounts",
|
||||
NULL As "Controlling",
|
||||
NULL As "JobNumberObjects",
|
||||
NULL As "UniqueObjects",
|
||||
NULL As "CostPlace",
|
||||
NULL As "CostHolder",
|
||||
1 As "CurrencyRate",
|
||||
CASE WHEN t1."VAT" IS NULL THEN 0
|
||||
WHEN t1."VAT" IS NOT NULL THEN
|
||||
case when t3."InversState"=false then ROUND(cast(t1."BruttoAmount"/(1+t3."KeyValue")*t3."KeyValue" as numeric),0)
|
||||
else ROUND(cast(t1."BruttoAmount"/(1+t3."InversKeyValue")*t3."InversKeyValue" as numeric),0) end
|
||||
END "AmountHUF",
|
||||
0 As "AmountDEV",
|
||||
t2."ShortName" As "Note1",
|
||||
'' As "Note2",
|
||||
t1."VAT" As "VAT",
|
||||
NULL As "ChartOfAccounts2",
|
||||
false As "IsReinvoice",
|
||||
NULL As "ContractRows",
|
||||
coalesce(t1."F_ReadyforBookEntryRows",false) As "ReadyforBookEntryRows",
|
||||
t2."Oid" As "RegistryHeader",
|
||||
NULL As "InvoiceHeader",
|
||||
t2."CurrentWorkflowSystemSteps" As "WorkflowSystemSteps",
|
||||
'' "WorkflowMessage"
|
||||
from "RegistryRowsFinancial" t1 join "RegistryHeader" t2 on
|
||||
t1."RegistryHeader"=t2."Oid" LEFT JOIN "VAT" t3 ON
|
||||
t1."VAT"=t3."Oid" LEFT JOIN "Customers" t4 ON
|
||||
t2."Customers"=t4."Oid" LEFT JOIN "CustomersGLParameters" t5 ON
|
||||
t4."CustomersGLParameters"=t5."Oid" LEFT JOIN "CurrencyName" t6 ON
|
||||
t2."F_CurrencyName"=t6."Oid" left join "VATYear" t7 on
|
||||
t3."Oid"=t7."VAT" and extract(year from cast(t2."F_DateExecution" as timestamp))=t7."AccountYear" left join "CustomersGLParametersYear" t9 on
|
||||
t5."Oid"=t9."CustomersGLParameters" and extract(year from cast(t2."F_DateExecution" as timestamp))=t9."AccountYear"
|
||||
WHERE t1."GCRecord" IS NULL AND
|
||||
coalesce(t2."IsEditable",false)=false AND
|
||||
t2."F_GLAccounts" IS NULL AND
|
||||
coalesce(t1."F_ReadyforBookEntryRows",false)=false
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 0 As "PartnerType",
|
||||
0 As "GLRowsTypeVAT",
|
||||
t1."Oid" As "Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t2."Customers" As "Customers",
|
||||
t2."DateExecution" As "DateExecution",
|
||||
t2."DocumentNumber" As "DocumentNumber",
|
||||
'' As "RegistryNumber",
|
||||
t11."ChartOfAccountsOut" As "DebitChartOfAccounts",
|
||||
coalesce(t12."ChartOfAccounts",t10."ChartOfAccounts") As "CreditChartOfAccounts",
|
||||
coalesce(t8."Controlling",t1."Controlling") As "Controlling",
|
||||
coalesce(t8."JobNumberObjects",t1."JobNumberObjects") As "JobNumberObjects",
|
||||
coalesce(t8."UniqueObjects",t1."UniqueObjects") As "UniqueObjects",
|
||||
coalesce(t8."CostPlace",t1."CostPlace") As "CostPlace",
|
||||
coalesce(t8."CostHolder",t1."CostHolder") As "CostHolder",
|
||||
t2."CurrencyRate" As "CurrencyRate",
|
||||
(t1."ListPriceHUF"-t1."DiscountPriceHUF")*t1."QTT" As "AmountHUF",
|
||||
(t1."ListPriceDEV"-t1."DiscountPriceDEV")*t1."QTT" As "AmountDEV",
|
||||
t2."Description" As "Note1",
|
||||
'' As "Note2",
|
||||
NULL As "VAT",
|
||||
t1."ChartOfAccounts" As "ChartOfAccounts2",
|
||||
false As "IsReinvoice",
|
||||
t1."ContractRows" As "ContractRows",
|
||||
coalesce(t1."ReadyforBookEntryRows",false) As "ReadyforBookEntryRows",
|
||||
NULL As "RegistryHeader",
|
||||
t2."Oid" As "InvoiceHeader",
|
||||
t1."WorkflowSystemSteps" As "WorkflowSystemSteps",
|
||||
'' "WorkflowMessage"
|
||||
FROM "InvoiceRows" t1 JOIN "InvoiceHeader" t2 ON
|
||||
t1."InvoiceHeader"=t2."Oid" LEFT JOIN "Controlling" t3 ON
|
||||
t1."Controlling"=t3."Oid" LEFT JOIN "Customers" t4 ON
|
||||
t2."Customers"=t4."Oid" LEFT JOIN "CustomersGLParameters" t5 ON
|
||||
t4."CustomersGLParameters"=t5."Oid" LEFT JOIN "CurrencyName" t6 ON
|
||||
t2."CurrencyName"=t6."Oid" LEFT JOIN "InvoiceType" t7 ON
|
||||
t2."InvoiceType"=t7."Oid" LEFT JOIN "ContractRows" t8 ON
|
||||
t1."ContractRows"=t8."Oid" LEFT JOIN "Controlling" t9 ON
|
||||
t8."Controlling"=t9."Oid" left join "ControllingYear" t10 on
|
||||
t3."Oid"=t10."Controlling" and extract(year from cast(t2."DateExecution" as timestamp))=t10."AccountYear" left join "CustomersGLParametersYear" t11 on
|
||||
t5."Oid"=t11."CustomersGLParameters" and extract(year from cast(t2."DateExecution" as timestamp))=t11."AccountYear" left join "ControllingYear" t12 on
|
||||
t9."Oid"=t12."Controlling" and extract(year from cast(t2."DateExecution" as timestamp))=t12."AccountYear"
|
||||
WHERE t1."GCRecord" IS NULL AND
|
||||
coalesce(t2."IsEditable",false)=false AND
|
||||
t2."GLAccounts" IS NULL AND
|
||||
coalesce(t1."ReadyforBookEntryRows",false)=false AND
|
||||
t7."InvoiceTypeBase" IN (1,2,3) AND
|
||||
coalesce(t2."IsProforma",false)=false
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 0 As "PartnerType",
|
||||
1 As "GLRowsTypeVAT",
|
||||
t1."Oid" As "Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t2."Customers" As "Customers",
|
||||
t2."DateExecution" As "DateExecution",
|
||||
t2."DocumentNumber" As "DocumentNumber",
|
||||
'' As "RegistryNumber",
|
||||
t9."ChartOfAccountsOut" As "DebitChartOfAccounts",
|
||||
t7."ChartOfAccountsOut" As "CreditChartOfAccounts",
|
||||
NULL As "Controlling",
|
||||
NULL As "JobNumberObjects",
|
||||
NULL As "UniqueObjects",
|
||||
NULL As "CostPlace",
|
||||
NULL As "CostHolder",
|
||||
1 As "CurrencyRate2",
|
||||
t1."AmountVATHUF" As "AmountHUF",
|
||||
t1."AmountVATDEV" As "AmountDEV",
|
||||
t2."Description" As "Note1",
|
||||
'' As "Note2",
|
||||
t1."VAT" As "VAT",
|
||||
NULL As "ChartOfAccounts2",
|
||||
false As "IsReinvoice",
|
||||
NULL As "ContractRows",
|
||||
coalesce(t1."ReadyforBookEntryRows",false) As "ReadyforBookEntryRows",
|
||||
NULL As "RegistryHeader",
|
||||
t2."Oid" As "InvoiceHeader",
|
||||
Null As "WorkflowSystemSteps",
|
||||
'' "WorkflowMessage"
|
||||
from "InvoiceVATRows" t1 join "InvoiceHeader" t2 on
|
||||
t1."InvoiceHeader"=t2."Oid" LEFT JOIN "VAT" t3 ON
|
||||
t1."VAT"=t3."Oid" LEFT JOIN "Customers" t4 ON
|
||||
t2."Customers"=t4."Oid" LEFT JOIN "CustomersGLParameters" t5 ON
|
||||
t4."CustomersGLParameters"=t5."Oid" LEFT JOIN "CurrencyName" t6 ON
|
||||
t2."CurrencyName"=t6."Oid" LEFT JOIN "InvoiceType" t10 ON
|
||||
t2."InvoiceType"=t10."Oid" left join "VATYear" t7 on
|
||||
t3."Oid"=t7."VAT" and extract(year from cast(t2."DateExecution" as timestamp))=t7."AccountYear" left join "CustomersGLParametersYear" t9 on
|
||||
t5."Oid"=t9."CustomersGLParameters" and extract(year from cast(t2."DateExecution" as timestamp))=t9."AccountYear"
|
||||
WHERE t1."GCRecord" IS NULL AND
|
||||
coalesce(t2."IsEditable",false)=false AND
|
||||
t2."GLAccounts" IS NULL AND
|
||||
coalesce(t1."ReadyforBookEntryRows",false)=false AND
|
||||
coalesce(t2."IsProforma",false)=false AND
|
||||
t10."InvoiceTypeBase" IN (1,2,3)
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
|
||||
|
||||
SELECT '01-Account' AS "MainType",
|
||||
t2."Oid" AS "Oid",
|
||||
t2."CustomersFrom" AS "CustomersFrom",
|
||||
t1."Customer" AS "Customers",
|
||||
t1."PartnerType" AS "PartnerType",
|
||||
t2."DocumentNumber" AS "ConnectInfo",
|
||||
t2."CurrencyName" AS "CurrencyName",
|
||||
sum(t1."AmountHUF") AS "BallanceHuf",
|
||||
sum(t1."AmountDEV") AS "BallanceDev",
|
||||
t3."ShortName" AS "Currency",
|
||||
t2."DatePayment" AS "DatePayment",
|
||||
t2."DateCreated" AS "DateCreated",
|
||||
t2."DateExecution" AS "DateExecution",
|
||||
t2."CurrencyRate" AS "CurrencyRate",
|
||||
t2."DocumentNumber" AS "DocumentNumber",
|
||||
max(t2."RegistryNumber") AS "RegistryNumber"
|
||||
from "GLRows" t1
|
||||
join "GLHeader" t2 on t1."GLHeader"=t2."Oid"
|
||||
left join "CurrencyName" t3 on t2."CurrencyName"=t3."Oid"
|
||||
where t2."GCRecord" is null and
|
||||
t2."GLDocumentType"=1 and
|
||||
coalesce(t2."IsEditable", false) = false and
|
||||
t1."PartnerType" in (0,1) and
|
||||
t1."GCRecord" is null
|
||||
group by t2."Oid",t2."CustomersFrom",t1."Customer",t1."PartnerType",
|
||||
t2."DocumentNumber",t2."CurrencyName",t3."ShortName",t2."DateExecution",t2."DatePayment",
|
||||
t2."DateCreated",t2."DateExecution",t2."CurrencyRate"
|
||||
|
||||
union all
|
||||
|
||||
SELECT '01-Account' AS "MainType",
|
||||
t1."Oid" AS "Oid",
|
||||
t1."CustomersFrom" AS "CustomersFrom",
|
||||
t1."Customers" AS "Customers",
|
||||
0 AS "PartnerType",
|
||||
t1."DocumentNumber" AS "ConnectInfo",
|
||||
t1."CurrencyName" AS currencyname,
|
||||
t1."TotalBruttoHUF" AS "BallanceHuf",
|
||||
t1."TotalBruttoDEV" AS "BallanceDev",
|
||||
t3."ShortName" AS "Currency",
|
||||
t1."DatePayment" AS "DatePayment",
|
||||
t1."DateCreated" AS "DateCreated",
|
||||
t1."DateExecution" AS "DateExecution",
|
||||
t1."CurrencyRate" AS "CurrencyRate",
|
||||
t1."DocumentNumber" AS "DocumentNumber",
|
||||
t1."DocumentNumber" AS "RegistryNumber"
|
||||
from "InvoiceHeader" t1
|
||||
left join "CurrencyName" t3 on t1."CurrencyName"=t3."Oid"
|
||||
where t1."GLAccounts" is null and
|
||||
t1."IsEditable"= false and
|
||||
t1."GCRecord" is null
|
||||
|
||||
union all
|
||||
|
||||
SELECT '01-Account' AS "MainType",
|
||||
t1."Oid" AS "Oid",
|
||||
t1."CustomersFrom" AS "CustomersFrom",
|
||||
t1."Customers" AS "Customers",
|
||||
1 AS "PartnerType",
|
||||
t1."DocumentNumber" AS "ConnectInfo",
|
||||
t1."F_CurrencyName" AS currencyname,
|
||||
t1."F_AmountBruttoHUF" AS "BallanceHuf",
|
||||
t1."F_AmountBruttoDEV" AS "BallanceDev",
|
||||
t3."ShortName" AS "Currency",
|
||||
t1."F_DatePayment" AS "DatePayment",
|
||||
t1."F_DateCreated" AS "DateCreated",
|
||||
t1."F_DateExecution" AS "DateExecution",
|
||||
t1."F_CurrencyRate" AS "CurrencyRate",
|
||||
t1."DocumentNumber" AS "DocumentNumber",
|
||||
t1."RegistryNumber" AS "RegistryNumber"
|
||||
from "RegistryHeader" t1
|
||||
left join "RegistryType" t2 on t1."RegistryType"=t2."Oid"
|
||||
left join "CurrencyName" t3 on t1."F_CurrencyName"=t3."Oid"
|
||||
where t1."GCRecord" is null and
|
||||
t1."F_GLAccounts" is null and
|
||||
t1."IsEditable"= false and
|
||||
t1."IsStorno"= false and
|
||||
t2."RegistryMainType"=0 and
|
||||
t1."RegistryAcceptState"=0
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
select t1."Oid" AS "Oid",
|
||||
t1."CustomersFrom" AS "CustomersFrom",
|
||||
t1."Customers" AS "Customers",
|
||||
t1."PartnerType" AS "PartnerType",
|
||||
t1."ConnectInfo" AS "ConnectInfo",
|
||||
t2."DocumentNumber" AS "DocumentNumber",
|
||||
t2."RegistryNumber" AS "RegistryNumber",
|
||||
t1."DateExecution" AS "DateExecution",
|
||||
t1."DatePayment_Account"AS "DatePayment",
|
||||
t1."CurrencyName_Account" AS "CurrencyName_Account",
|
||||
t1."AmountHUF_Account" AS "AmountHUF",
|
||||
t1."AmountDEV_Account" AS "AmountDEV",
|
||||
t1."BallanceHUF" AS "BallanceHUF",
|
||||
t1."BallanceDEV" AS "BallanceDEV",
|
||||
t1."InvoiceHeader" AS "InvoiceHeader"
|
||||
from "PCIDetail" t1 join
|
||||
"vv_PartnerConnectionInfoAccount" t2 on
|
||||
t1."CustomersFrom"=t2."CustomersFrom" and
|
||||
t1."Customers"=t2."Customers" and
|
||||
t1."PartnerType"=t2."PartnerType" and
|
||||
t1."ConnectInfo"=t2."ConnectInfo"
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
|
||||
select
|
||||
t1."MainType" AS "MainType",
|
||||
t1."Oid" AS "Oid",
|
||||
t1."CustomersFrom" AS "CustomersFrom",
|
||||
t1."Customers" AS "Customers",
|
||||
t1."PartnerType" AS "PartnerType",
|
||||
t1."ConnectInfo" AS "ConnectInfo",
|
||||
t1."CurrencyName" AS "CurrencyName",
|
||||
t1."DebitTotalHUF" AS "DebitTotalHUF",
|
||||
t1."CreditTotalHUF" AS "CreditTotalHUF",
|
||||
t1."DebitTotalDEV" AS "DebitTotalDEV",
|
||||
t1."CreditTotalDEV" AS "CreditTotalDEV",
|
||||
t1."BallanceHUF" AS "BallanceHUF",
|
||||
t1."BallanceDEV" AS "BallanceDEV",
|
||||
t1."ShortName" AS "ShortName",
|
||||
t1."Description" AS "Description",
|
||||
t1."DateExecution" AS "DateExecution",
|
||||
t1."DateCreated" AS "DateCreated",
|
||||
t1."DatePayment" AS "DatePayment",
|
||||
t1."DelayedDay" AS "DelayedDay",
|
||||
t1."DelayedRange" AS "DelayedRange",
|
||||
t1."CurrencyName_Account" AS "CurrencyName_Account",
|
||||
t1."AmountHUF_Account" AS "AmountHUF_Account",
|
||||
t1."AmountDEV_Account" AS "AmountDEV_Account",
|
||||
t1."DateExecution_Account" AS "DateExecution_Account",
|
||||
t2."BallanceState" AS "BallanceState",
|
||||
t2."BallanceRateDiff" AS "BallanceRateDiff"
|
||||
from "vv_PartnerConnectionInfoDetail" t1
|
||||
join "vv_PartnerConnectionInfoDetailGroup" t2 on
|
||||
t1."CustomersFrom"=t2."CustomersFrom" and
|
||||
t1."Customers"=t2."Customers" and
|
||||
t1."PartnerType"=t2."PartnerType" and
|
||||
t1."ConnectInfo"=t2."ConnectInfo"
|
||||
|
||||
+405
@@ -0,0 +1,405 @@
|
||||
|
||||
|
||||
SELECT '01-Account' As "MainType",
|
||||
t2."Oid" As "Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t1."Customer" As "Customers",
|
||||
t1."PartnerType" As "PartnerType",
|
||||
t1."ConnectInfo" As "ConnectInfo",
|
||||
t2."CurrencyName" As "CurrencyName",
|
||||
max(t3."AmountHUFBrutto") As "DebitTotalHUF",
|
||||
0 As "CreditTotalHUF",
|
||||
max(t3."AmountDEVBrutto") As "DebitTotalDEV",
|
||||
0 As "CreditTotalDEV",
|
||||
max(t3."AmountHUFBrutto") As "BallanceHUF",
|
||||
max(t3."AmountDEVBrutto") As "BallanceDEV",
|
||||
'' As "ShortName",
|
||||
'' As "Description",
|
||||
t2."DateExecution" As "DateExecution",
|
||||
t2."DateCreated" As "DateCreated",
|
||||
t2."DatePayment" As "DatePayment",
|
||||
CURRENT_DATE-Cast(t2."DatePayment" AS Date) As "DelayedDay",
|
||||
CASE WHEN CURRENT_DATE-Cast(t2."DatePayment" AS date)<=0 THEN 0
|
||||
WHEN CURRENT_DATE-Cast(t2."DatePayment" AS date)>0 AND CURRENT_DATE-Cast(t2."DatePayment" AS date)<=15 then 1
|
||||
WHEN CURRENT_DATE-Cast(t2."DatePayment" AS date)>15 and CURRENT_DATE-Cast(t2."DatePayment" AS date)<=30 then 2
|
||||
WHEN CURRENT_DATE-Cast(t2."DatePayment" AS date)>30 and CURRENT_DATE-Cast(t2."DatePayment" AS date)<=60 then 3
|
||||
WHEN CURRENT_DATE-Cast(t2."DatePayment" AS date)>60 and CURRENT_DATE-Cast(t2."DatePayment" AS date)<=90 then 4
|
||||
WHEN CURRENT_DATE-Cast(t2."DatePayment" AS date)>90 and CURRENT_DATE-Cast(t2."DatePayment" AS date)<=180 then 5
|
||||
WHEN CURRENT_DATE-Cast(t2."DatePayment" AS date)>180 and CURRENT_DATE-Cast(t2."DatePayment" AS date)<=360 then 6
|
||||
WHEN CURRENT_DATE-Cast(t2."DatePayment" AS date)>360 then 7
|
||||
END As "DelayedRange",
|
||||
t2."CurrencyName" As "CurrencyName_Account",
|
||||
SUM(t1."AmountHUF") As "AmountHUF_Account",
|
||||
SUM(t1."AmountDEV") As "AmountDEV_Account",
|
||||
t2."DateExecution" As "DateExecution_Account"
|
||||
from "GLRows" t1 join "GLHeader" t2 on
|
||||
t1."GLHeader"=t2."Oid" join "GLAccounts" t3 on
|
||||
t1."GLHeader"=t3."Oid"
|
||||
WHERE t2."GCRecord" IS NULL AND
|
||||
t2."GLDocumentType"=1 AND
|
||||
t2."IsEditable"=false AND
|
||||
t1."PartnerType" IN (0,1) AND
|
||||
t1."GCRecord" IS NULL
|
||||
GROUP BY t2."Oid",t2."CustomersFrom",t1."Customer",t1."PartnerType",
|
||||
t1."ConnectInfo",t2."CurrencyName",t2."DateExecution",t2."DateCreated",t2."DatePayment"
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT '02-Bank' As "MainType",
|
||||
t1."Oid" As "Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t1."Customer" As "Customers",
|
||||
t1."PartnerType" As "PartnerType",
|
||||
t1."ConnectInfo" As "ConnectInfo",
|
||||
t3."CurrencyName" As "CurrencyName",
|
||||
0 As "DebitTotalHUF",
|
||||
case WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")*-1
|
||||
end AS "CreditTotalHUF",
|
||||
0 AS "DebitTotalDEV",
|
||||
case WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")*-1
|
||||
end AS "CreditTotalDEV",
|
||||
(case WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
end)*-1 AS "BallanceHUF",
|
||||
(case WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."InAmountDEV")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."OutAmountDEV")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."OutAmountDEV")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."InAmountDEV")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF'then sum(t1."InAmountDEV2")*-1
|
||||
else 0
|
||||
end)*-1 AS "BallanceDEV",
|
||||
max(t3."ShortName"||', '||coalesce(t2."DocumentNumber",'')) AS "ShortName",
|
||||
'' AS "Description",
|
||||
t2."DateExecution" AS "DateExecution",
|
||||
t2."DateExecution" AS "DateCreated",
|
||||
t4."DatePayment" AS "DatePayment",
|
||||
0 AS "DelayedDay",
|
||||
0 AS "DelayedRange",
|
||||
t4."CurrencyName" AS "CurrencyName_Account",
|
||||
0 AS "AmountHUF_Account",
|
||||
0 AS "AmountDEV_Account",
|
||||
max(t4."DateExecution") AS "DateExecution_Account"
|
||||
from "GLRows" t1
|
||||
join "GLHeader" t2 on t1."GLHeader"=t2."Oid"
|
||||
left join "GLBank" t5 on t2."Oid"=t5."Oid"
|
||||
left join "LiquidAssets" t3 on t5."LiquidAssets_Main"=t3."Oid"
|
||||
left join "vv_PartnerConnectionInfoAccount" t4 on t2."CustomersFrom"=t4."CustomersFrom"
|
||||
and t1."Customer"=t4."Customers" and t1."PartnerType"=t4."PartnerType" and t1."ConnectInfo"=t4."ConnectInfo"
|
||||
where t2."GCRecord" is null and
|
||||
t2."GLDocumentType"=2 and
|
||||
t1."PartnerType" in (0,1) and
|
||||
t1."GCRecord" is null
|
||||
group by t1."Oid",t2."CustomersFrom",t1."Customer",t1."PartnerType",
|
||||
t1."ConnectInfo",t3."CurrencyName",t4."Currency",t2."DateExecution",t4."DatePayment",t4."CurrencyName"
|
||||
|
||||
union all
|
||||
|
||||
SELECT '03-Cassa' As "MainType",
|
||||
t1."Oid" As "Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t1."Customer" As "Customers",
|
||||
t1."PartnerType" As "PartnerType",
|
||||
t1."ConnectInfo" As "ConnectInfo",
|
||||
t3."CurrencyName" As "CurrencyName",
|
||||
0 As "DebitTotalHUF",
|
||||
CASE WHEN t1."PartnerType"=0 AND SUM(t1."InAmountHUF")<>0 AND coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" THEN SUM(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")*-1
|
||||
end As "CreditTotalHUF",
|
||||
0 As "DebitTotalDEV",
|
||||
case WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")*-1
|
||||
end As "CreditTotalDEV",
|
||||
(case WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
end)*-1 As "BallanceHUF",
|
||||
(case WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF'then sum(t1."InAmountDEV2")*-1
|
||||
end)*-1 As "BallanceDEV",
|
||||
MAX(t3."ShortName"||', '||coalesce(t2."DocumentNumber",'')) As "ShortName",
|
||||
'' As "Description",
|
||||
t2."DateExecution" As "DateExecution",
|
||||
t2."DateExecution" As "DateCreated",
|
||||
t4."DatePayment" As "DatePayment",
|
||||
0 As "DelayedDay",
|
||||
0 As "DelayedRange",
|
||||
t4."CurrencyName" As "CurrencyName_Account",
|
||||
0 As "AmountHUF_Account",
|
||||
0 As "AmountDEV_Account",
|
||||
max(t4."DateExecution") As "DateExecution_Account"
|
||||
FROM "GLRows" t1
|
||||
join "GLHeader" t2 on t1."GLHeader"=t2."Oid"
|
||||
left join "GLCassa" t5 on t2."Oid"=t5."Oid"
|
||||
left join "LiquidAssets" t3 on t5."LiquidAssets_Cassa"=t3."Oid"
|
||||
left join "vv_PartnerConnectionInfoAccount" t4 on t2."CustomersFrom"=t4."CustomersFrom" and
|
||||
t1."Customer"=t4."Customers" and t1."PartnerType"=t4."PartnerType" and t1."ConnectInfo"=t4."ConnectInfo"
|
||||
where t2."GCRecord" is null and
|
||||
t2."GLDocumentType"=3 and
|
||||
t1."PartnerType" in (0,1) and
|
||||
t1."GCRecord" is null
|
||||
group by t1."Oid",t2."CustomersFrom",t1."Customer",t1."PartnerType",
|
||||
t1."ConnectInfo",t3."CurrencyName",t4."Currency",t2."DateExecution",t4."DatePayment",t4."CurrencyName"
|
||||
|
||||
union all
|
||||
|
||||
select '05-Ratediff' As "MainType",
|
||||
t1."Oid" As "Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t1."Customer" As "Customers",
|
||||
t1."PartnerType" As "PartnerType",
|
||||
t1."ConnectInfo" As "ConnectInfo",
|
||||
t2."CurrencyName" As "CurrencyName",
|
||||
0 As "DebitTotalHUF",
|
||||
case WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
end As "CreditTotalHUF",
|
||||
0 As "DebitTotalDEV",
|
||||
0 As "CreditTotalDEV",
|
||||
(case WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
end)*-1 As "BallanceHUF",
|
||||
0 As "BallanceDEV",
|
||||
max(t7."ShortName"||', '||coalesce(t8."DocumentNumber",'')||', '||coalesce(t2."DocumentNumber",''))As "ShortName",
|
||||
'' As "Description",
|
||||
t2."DateExecution" As "DateExecution",
|
||||
t2."DateExecution" As "DateCreated",
|
||||
null As "DatePayment",
|
||||
0 As "DelayedDay",
|
||||
0 As "DelayedRange",
|
||||
t4."CurrencyName" As "CurrencyName_Account",
|
||||
0 As "AmountHUF_Account",
|
||||
0 As "AmountDEV_Account",
|
||||
max(t4."DateExecution") As "DateExecution_Account"
|
||||
from "GLRows" t1
|
||||
join "GLHeader" t2 on t1."GLHeader"=t2."Oid"
|
||||
left join "LiquidAssets" t3 on t1."LiquidAssets"=t3."Oid"
|
||||
left join "vv_PartnerConnectionInfoAccount" t4 on t2."CustomersFrom"=t4."CustomersFrom" and
|
||||
t1."Customer"=t4."Customers" and t1."PartnerType"=t4."PartnerType" and t1."ConnectInfo"=t4."ConnectInfo"
|
||||
left join "GLRows" t6 on
|
||||
t1."GLRowsRateDiff"=t6."Oid" left join "LiquidAssets" t7 on
|
||||
t6."LiquidAssets"=t7."Oid" left join "GLHeader" t8 on
|
||||
t6."GLHeader"=t8."Oid"
|
||||
where t2."GCRecord" is null and
|
||||
t2."GLDocumentType"=5 and
|
||||
t1."PartnerType" in (0,1) and
|
||||
t1."GCRecord" is null
|
||||
group by t1."Oid",t2."CustomersFrom",t1."Customer",t1."PartnerType",
|
||||
t1."ConnectInfo",t2."CurrencyName",t2."DateExecution",t2."DatePayment",t4."CurrencyName"
|
||||
|
||||
union all
|
||||
|
||||
select case when max(t2."GLDocumentType")=4 then '04-Compensation'
|
||||
when max(t2."GLDocumentType")=0 then '06-Mixed'
|
||||
end "MainType",
|
||||
t1."Oid" As "Oid",
|
||||
t2."CustomersFrom" As "CustomersFrom",
|
||||
t1."Customer" As "Customers",
|
||||
t1."PartnerType" As "PartnerType",
|
||||
t1."ConnectInfo" As "ConnectInfo",
|
||||
t3."CurrencyName" As "CurrencyName",
|
||||
0 As "DebitTotalHUF",
|
||||
case WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")*-1
|
||||
end As "CreditTotalHUF",
|
||||
0 As "DebitTotalDEV",
|
||||
case WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" then sum(t1."InAmountDEV2")*-1
|
||||
end As "CreditTotalDEV",
|
||||
(case WHEN t1."PartnerType"=0 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountHUF")<>0 then sum(t1."AmountHUF")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountHUF")<>0 then sum(t1."AmountHUF")*-1
|
||||
end)*-1 As "BallanceHUF",
|
||||
(case WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")=t3."CurrencyName" then sum(t1."AmountDEV")*-1
|
||||
WHEN t1."PartnerType"=0 and sum(t1."InAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."InAmountDEV2")
|
||||
WHEN t1."PartnerType"=0 and sum(t1."OutAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."OutAmountDEV2")*-1
|
||||
WHEN t1."PartnerType"=1 and sum(t1."OutAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF' then sum(t1."OutAmountDEV2")
|
||||
WHEN t1."PartnerType"=1 and sum(t1."InAmountDEV2")<>0 and
|
||||
coalesce(t4."CurrencyName",t3."CurrencyName")<>t3."CurrencyName" and t4."Currency"<>'HUF'then sum(t1."InAmountDEV2")*-1
|
||||
else 0
|
||||
end)*-1 As "BallanceDEV",
|
||||
max(t3."ShortName"||', '||t2."DocumentNumber") As "ShortName",
|
||||
'' As "Description",
|
||||
t2."DateExecution" As "DateExecution",
|
||||
t2."DateExecution" As "DateCreated",
|
||||
t2."DateExecution" As "DatePayment",
|
||||
0 As "DelayedDay",
|
||||
0 As "DelayedRange",
|
||||
t4."CurrencyName" As "CurrencyName_Account",
|
||||
0 As "AmountHUF_Account",
|
||||
0 As "AmountDEV_Account",
|
||||
max(t4."DateExecution") As "DateExecution_Account"
|
||||
from "GLRows" t1
|
||||
join "GLHeader" t2 on t1."GLHeader"=t2."Oid"
|
||||
left join "GLCompensation" t5 on t2."Oid"=t5."Oid"
|
||||
left join "LiquidAssets" t3 on t5."LiquidAssets_Main"=t3."Oid"
|
||||
left join "vv_PartnerConnectionInfoAccount" t4 on t2."CustomersFrom"=t4."CustomersFrom" and
|
||||
t1."Customer"=t4."Customers" and t1."PartnerType"=t4."PartnerType" and t1."ConnectInfo"=t4."ConnectInfo"
|
||||
where t2."GCRecord" is null and
|
||||
t2."GLDocumentType" in (4,0) and
|
||||
t1."PartnerType" in (0,1) and
|
||||
t1."GCRecord" is null
|
||||
group by t1."Oid",t2."CustomersFrom",t1."Customer",t1."PartnerType",
|
||||
t1."ConnectInfo",t3."CurrencyName",t4."Currency",t2."DateExecution",t4."DatePayment",t4."CurrencyName"
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' AS "MainType",
|
||||
t1."Oid" AS "Oid",
|
||||
t1."CustomersFrom" AS "CustomersFrom",
|
||||
t1."Customers" AS "Customers",
|
||||
0 AS "PartnerType",
|
||||
t1."ConnectInfo" AS "ConnectInfo",
|
||||
t1."CurrencyName" AS "CurrencyName",
|
||||
t1."TotalBruttoHUF" AS "DebitTotalHUF",
|
||||
0 AS "CreditTotalHUF",
|
||||
t1."TotalBruttoDEV" AS "DebitTotalDEV",
|
||||
0 AS "CreditTotalDEV",
|
||||
t1."TotalBruttoHUF" AS "BallanceHUF",
|
||||
t1."TotalBruttoDEV" AS "BallanceDEV",
|
||||
'' AS "ShortName",
|
||||
t1."Description" AS "Description",
|
||||
t1."DateExecution" AS "DateExecution",
|
||||
t1."DateCreated" AS "DateCreated",
|
||||
t1."DatePayment" AS "DatePayment",
|
||||
CURRENT_DATE-Cast(t1."DatePayment" AS date) AS "DelayedDay",
|
||||
case WHEN CURRENT_DATE-Cast(t1."DatePayment" AS date)<=0 then 0
|
||||
WHEN CURRENT_DATE-Cast(t1."DatePayment" AS date)>0 and CURRENT_DATE-Cast(t1."DatePayment" AS date)<=15 then 1
|
||||
WHEN CURRENT_DATE-Cast(t1."DatePayment" AS date)>15 and CURRENT_DATE-Cast(t1."DatePayment" AS date)<=30 then 2
|
||||
WHEN CURRENT_DATE-Cast(t1."DatePayment" AS date)>30 and CURRENT_DATE-Cast(t1."DatePayment" AS date)<=60 then 3
|
||||
WHEN CURRENT_DATE-Cast(t1."DatePayment" AS date)>60 and CURRENT_DATE-Cast(t1."DatePayment" AS date)<=90 then 4
|
||||
WHEN CURRENT_DATE-Cast(t1."DatePayment" AS date)>90 and CURRENT_DATE-Cast(t1."DatePayment" AS date)<=180 then 5
|
||||
WHEN CURRENT_DATE-Cast(t1."DatePayment" AS date)>180 and CURRENT_DATE-Cast(t1."DatePayment" AS date)<=360 then 6
|
||||
WHEN CURRENT_DATE-Cast(t1."DatePayment" AS date)>360 then 7
|
||||
end AS "DelayedRange",
|
||||
t1."CurrencyName" AS "CurrencyName_Account",
|
||||
t1."TotalBruttoHUF" AS "AmountHUF_Account",
|
||||
t1."TotalBruttoDEV" AS "AmountDEV_Account",
|
||||
t1."DateExecution" AS "DateExecution_Account"
|
||||
from "InvoiceHeader" t1
|
||||
where t1."GLAccounts" is null and
|
||||
t1."IsEditable"=false and
|
||||
t1."GCRecord" is null
|
||||
|
||||
union all
|
||||
|
||||
select '01-Account' AS "MainType",
|
||||
t1."Oid" AS "Oid",
|
||||
t1."CustomersFrom" AS "CustomersFrom",
|
||||
t1."Customers" AS "Customers",
|
||||
1 AS "PartnerType",
|
||||
t1."DocumentNumber" AS "ConnectInfo",
|
||||
t1."F_CurrencyName" AS "CurrencyName",
|
||||
t1."F_AmountBruttoHUF" AS "DebitTotalHUF",
|
||||
0 AS "CreditTotalHUF",
|
||||
t1."F_AmountBruttoDEV" AS "DebitTotalDEV",
|
||||
0 AS "CreditTotalDEV",
|
||||
t1."F_AmountBruttoHUF" AS "BallanceHUF",
|
||||
t1."F_AmountBruttoDEV" AS "BallanceDEV",
|
||||
'' AS "ShortName",
|
||||
'' AS "Description",
|
||||
t1."F_DateExecution" AS "DateExecution",
|
||||
t1."F_DateCreated" AS "DateCreated",
|
||||
t1."F_DatePayment" AS "DatePayment",
|
||||
CURRENT_DATE-Cast(t1."F_DatePayment" AS date) AS "DelayedDay",
|
||||
case WHEN CURRENT_DATE-Cast(t1."F_DatePayment" AS date)<=0 then 0
|
||||
WHEN CURRENT_DATE-Cast(t1."F_DatePayment" AS date)>0 and CURRENT_DATE-Cast(t1."F_DatePayment" AS date)<=15 then 1
|
||||
WHEN CURRENT_DATE-Cast(t1."F_DatePayment" AS date)>15 and CURRENT_DATE-Cast(t1."F_DatePayment" AS date)<=30 then 2
|
||||
WHEN CURRENT_DATE-Cast(t1."F_DatePayment" AS date)>30 and CURRENT_DATE-Cast(t1."F_DatePayment" AS date)<=60 then 3
|
||||
WHEN CURRENT_DATE-Cast(t1."F_DatePayment" AS date)>60 and CURRENT_DATE-Cast(t1."F_DatePayment" AS date)<=90 then 4
|
||||
WHEN CURRENT_DATE-Cast(t1."F_DatePayment" AS date)>90 and CURRENT_DATE-Cast(t1."F_DatePayment" AS date)<=180 then 5
|
||||
WHEN CURRENT_DATE-Cast(t1."F_DatePayment" AS date)>180 and CURRENT_DATE-Cast(t1."F_DatePayment" AS date)<=360 then 6
|
||||
WHEN CURRENT_DATE-Cast(t1."F_DatePayment" AS date)>360 then 7
|
||||
end As "DelayedRange",
|
||||
t1."F_CurrencyName" AS "CurrencyName_Account",
|
||||
t1."F_AmountBruttoHUF" AS "AmountHUF_Account",
|
||||
t1."F_AmountBruttoDEV" AS "AmountDEV_Account",
|
||||
t1."F_DateExecution" AS "DateExecution_Account"
|
||||
from "RegistryHeader" t1
|
||||
left join "RegistryType" t2 on t1."RegistryType"=t2."Oid"
|
||||
where t1."GCRecord" is null and
|
||||
t1."F_GLAccounts" is null and
|
||||
t1."IsEditable"=false and
|
||||
t1."IsStorno"=false and
|
||||
t2."RegistryMainType"=0 and
|
||||
t1."RegistryAcceptState"=0
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
|
||||
|
||||
SELECT MAX(CAST(t1."Oid" AS CHAR(100))) As "Oid",
|
||||
t1."CustomersFrom" AS "CustomersFrom",
|
||||
t1."Customers" AS "Customers",
|
||||
t1."PartnerType" AS "PartnerType",
|
||||
t1."ConnectInfo" AS "ConnectInfo",
|
||||
max(t2."ShortName") AS "Currency",
|
||||
sum(t1."DebitTotalHUF") AS "DebitTotalHUF",
|
||||
SUM(t1."CreditTotalHUF") AS "CreditTotalHUF",
|
||||
sum(t1."DebitTotalDEV") AS "DebitTotalDEV",
|
||||
SUM(t1."CreditTotalDEV") AS "CreditTotalDEV",
|
||||
SUM(t1."BallanceHUF") AS "BallanceHUF",
|
||||
SUM(t1."BallanceDEV") AS "BallanceDEV",
|
||||
case when t1."PartnerType"=1 then SUM(t1."BallanceHUF")*-1 else 0 end AS "BallanceHUF_P",
|
||||
case when t1."PartnerType"=1 then SUM(t1."BallanceDEV")*-1 else 0 end AS "BallanceDEV_P",
|
||||
case when t1."PartnerType"=0 then SUM(t1."BallanceHUF") else 0 end AS "BallanceHUF_R",
|
||||
case when t1."PartnerType"=0 then SUM(t1."BallanceDEV") else 0 end AS "BallanceDEV_R",
|
||||
(case when t1."PartnerType"=0 then SUM(t1."BallanceHUF") else 0 end) -
|
||||
(case when t1."PartnerType"=1 then SUM(t1."BallanceHUF")*-1 else 0 end) AS "BallanceHUF_B",
|
||||
(case when t1."PartnerType"=0 then SUM(t1."BallanceDEV") else 0 end) -
|
||||
(case when t1."PartnerType"=1 then SUM(t1."BallanceDEV")*-1 else 0 end) AS "BallanceDEV_B",
|
||||
max(t3."ShortName") AS "Currency_Account",
|
||||
sum(t1."AmountHUF_Account") AS "AmountHUF_Account",
|
||||
sum(t1."AmountDEV_Account") AS "AmountDEV_Account",
|
||||
case when max(t3."ShortName")='HUF' then
|
||||
case when round(cast(SUM(t1."BallanceHUF") as numeric),0)=0 then 1
|
||||
else 0
|
||||
end
|
||||
else
|
||||
case when round(cast(SUM(t1."BallanceDEV") as numeric),2)=0 then 1
|
||||
else 0
|
||||
end
|
||||
end AS "BallanceState",
|
||||
case when max(t3."ShortName")='HUF' then -1
|
||||
when t1."CurrencyName_Account" IS null then -1
|
||||
else
|
||||
case when round(cast(SUM(t1."BallanceDEV")as numeric),2)=0 and round(cast(SUM(t1."BallanceHUF")as numeric),0)<>0 then 1
|
||||
else 0
|
||||
end
|
||||
end "BallanceRateDiff",
|
||||
max(t4."DateExecution") DateExecution_Account,
|
||||
MAX(t4."DateCreated") DateCreated_Account
|
||||
from "vv_PartnerConnectionInfoDetail" t1
|
||||
left join "CurrencyName" t2 on t1."CurrencyName"=t2."Oid"
|
||||
left join "CurrencyName" t3 on t1."CurrencyName_Account"=t3."Oid"
|
||||
left join "vv_PartnerConnectionInfoAccount" t4 on
|
||||
t1."CustomersFrom"=t4."CustomersFrom" and
|
||||
t1."Customers"=t4."Customers" and
|
||||
t1."PartnerType"=t4."PartnerType" and
|
||||
t1."ConnectInfo"=t4."ConnectInfo" and
|
||||
t4."MainType"='01-Account'
|
||||
|
||||
group by t1."CustomersFrom",t1."Customers",t1."PartnerType",t1."ConnectInfo",t1."CurrencyName_Account"
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
select case when t2."Oid" IS null then t1."Oid" else t2."Oid" end Oid,
|
||||
t1."Oid" Products,
|
||||
t2."Oid" StorageComputed
|
||||
from "Products" t1 left join "StorageComputed" t2 on
|
||||
t1."Oid"=t2."Products"
|
||||
where t1."GCRecord" is null and t2."GCRecord" is null
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
select t1."Oid" AS "Oid",
|
||||
t1."RegistryHeader" AS "RegistryHeader",
|
||||
t1."AmountHUF" AS "AmountHUF",
|
||||
t1."AmountDEV" AS "AmountDEV",
|
||||
t1."DatePayment" AS "DatePayment",
|
||||
t1."IsBlocked" AS "IsBlocked",
|
||||
t1."Note" AS "Note",
|
||||
t1."BankSavedFileName" AS "BankSavedFileName",
|
||||
coalesce(t3."BallanceHUF",t2."F_AmountBruttoHUF") AS "BallanceHUF",
|
||||
coalesce(t3."BallanceDEV",t2."F_AmountBruttoDEV") AS "BallanceDEV",
|
||||
t1."AmountHUF"-coalesce(t3."BallanceHUF",t2."F_AmountBruttoHUF") AS "DifferenceHUF",
|
||||
t1."AmountDEV"-coalesce(t3."BallanceDEV",t2."F_AmountBruttoDEV") AS "DifferenceDEV",
|
||||
case when round(cast(coalesce(t3."BallanceHUF",t2."F_AmountBruttoHUF") as numeric),2)=0 then 0
|
||||
when coalesce(t3."BallanceHUF",t2."F_AmountBruttoHUF")>=t1."AmountHUF" then t1."AmountHUF"
|
||||
when coalesce(t3."BallanceHUF",t2."F_AmountBruttoHUF")<=t1."AmountHUF" then coalesce(t3."BallanceHUF",t2."F_AmountBruttoHUF")
|
||||
end AS "OfferedHUF",
|
||||
case when round(cast(coalesce(t3."BallanceDEV",t2."F_AmountBruttoDEV") as numeric),2)=0 then 0
|
||||
when coalesce(t3."BallanceDEV",t2."F_AmountBruttoDEV")>=t1."AmountDEV" then t1."AmountDEV"
|
||||
when coalesce(t3."BallanceDEV",t2."F_AmountBruttoDEV")<=t1."AmountDEV" then coalesce(t3."BallanceDEV",t2."F_AmountBruttoDEV")
|
||||
end AS "OfferedDEV",
|
||||
t1."BankPrepareName" AS "BankPrepareName"
|
||||
from "RegistryBankTransfer" t1
|
||||
join "RegistryHeader" t2 on t1."RegistryHeader"=t2."Oid"
|
||||
left join "PCIGroup" t3 on t2."CustomersFrom"=t3."CustomersFrom"
|
||||
and t2."Customers"=t3."Customers" and t3."PartnerType"=1 and t2."DocumentNumber"=t3."ConnectInfo"
|
||||
where t1."GCRecord" is null and t2."RegistryAcceptState"=0
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
select MAX(CAST("Oid" AS CHAR(100))) As "Oid",
|
||||
"BankPrepareName"
|
||||
from "RegistryBankTransfer"
|
||||
where Rtrim(Ltrim(coalesce("BankPrepareName",'')))<>''
|
||||
group by "BankPrepareName"
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
|
||||
|
||||
select t1."Oid" Oid,
|
||||
t2."CustomersFrom" CustomersFrom,
|
||||
t1."PartnerType" PartnerType,
|
||||
t1."Customer" Customers,
|
||||
t1."ConnectInfo" ConnectInfo,
|
||||
t3."DateExecution" DateExecution_Account,
|
||||
t3."CurrencyName" CurrencyName_Account,
|
||||
round(cast(t4."AmountDEV_Account" as numeric),2) AmountDEV_Account,
|
||||
round(cast(t4."AmountHUF_Account" as numeric),2) AmountHUF_Account,
|
||||
round(cast(t4."BallanceDEV" as numeric),2) BallanceDEV_Account,
|
||||
case when round(cast(t4."AmountDEV_Account" as numeric),2)<>0 then round(cast(round(cast(t4."AmountHUF_Account" as numeric),2)/round(cast(t4."AmountDEV_Account" as numeric),2) as numeric),2) else 0 end CurrencyRate_Account,
|
||||
t1."LiquidAssets" LiquidAssets,
|
||||
t2."DateExecution" DateExecution,
|
||||
round(cast(t1."InAmountDEV" as numeric),2) InAmountDEV,
|
||||
round(cast(t1."OutAmountDEV" as numeric),2) OutAmountDEV,
|
||||
round(cast(t1."InAmountDEV2" as numeric),2) InAmountDEV2,
|
||||
round(cast(t1."OutAmountDEV2" as numeric),2) OutAmountDEV2,
|
||||
case when "InAmountHUF">0 then
|
||||
case when t1."InAmountDEV" <>0 then round(cast(t1."InAmountHUF" as numeric),2)/round(cast(t1."InAmountDEV" as numeric),2)
|
||||
else 0
|
||||
end
|
||||
else
|
||||
case when t1."OutAmountDEV" <>0 then round(cast(t1."OutAmountHUF" as numeric),2)/round(cast(t1."OutAmountDEV" as numeric),2)
|
||||
else 0
|
||||
end
|
||||
end CurrencyRate,
|
||||
round(cast(t1."InAmountHUF" as numeric),2) InAmountHUF,
|
||||
round(cast(t1."OutAmountHUF" as numeric),2) OutAmountHUF,
|
||||
case when t3."CurrencyName"=t5."CurrencyName" then round(cast(t1."InAmountDEV" as numeric),2)* round(cast(t3."CurrencyRate" as numeric),2)
|
||||
else round(cast(t1."InAmountDEV2" as numeric),2)* round(cast(t3."CurrencyRate" as numeric),2)
|
||||
end InAmountHUF_Account,
|
||||
case when t3."CurrencyName"=t5."CurrencyName" then round(cast(t1."OutAmountDEV" as numeric),2)*round(cast(t3."CurrencyRate" as numeric),2)
|
||||
else round(cast(t1."OutAmountDEV2" as numeric),2)*round(cast(t3."CurrencyRate" as numeric),2)
|
||||
end OutAmountHUF_Account,
|
||||
case when t3."CurrencyName"=t5."CurrencyName" then round(cast(t1."InAmountDEV" as numeric),2)* round(cast(t3."CurrencyRate" as numeric),2)
|
||||
else round(cast(t1."InAmountDEV2" as numeric),2)* round(cast(t3."CurrencyRate" as numeric),2)
|
||||
end - round(cast(t1."InAmountHUF" as numeric),2) InAmountHUF_Diff,
|
||||
case when t3."CurrencyName"=t5."CurrencyName" then round(cast(t1."OutAmountDEV" as numeric),2)*round(cast(t3."CurrencyRate" as numeric),2)
|
||||
else round(cast(t1."OutAmountDEV2" as numeric),2)*round(cast(t3."CurrencyRate" as numeric),2)
|
||||
end - round(cast(t1."OutAmountHUF" as numeric),2) OutAmountHUF_Diff,
|
||||
t1."GLRowsRateDiff" GLRowsRateDiff,
|
||||
case when t1."PartnerType" = 0 Then
|
||||
case when case when t3."CurrencyName"=t5."CurrencyName" then round(cast(t1."InAmountDEV" as numeric),2)* round(cast(t3."CurrencyRate" as numeric),2)
|
||||
else round(cast(t1."InAmountDEV2" as numeric),2)* round(cast(t3."CurrencyRate" as numeric),2)
|
||||
end - round(cast(t1."InAmountHUF" as numeric),2) > 0 Then -1
|
||||
else 1
|
||||
end
|
||||
when t1."PartnerType" = 1 Then
|
||||
case when case when t3."CurrencyName"=t5."CurrencyName" then round(cast(t1."OutAmountDEV" as numeric),2)*round(cast(t3."CurrencyRate" as numeric),2)
|
||||
else round(cast(t1."OutAmountDEV2" as numeric),2)*round(cast(t3."CurrencyRate" as numeric),2)
|
||||
end - round(cast(t1."OutAmountHUF" as numeric),2) > 0 Then 1
|
||||
else -1
|
||||
end
|
||||
else 0
|
||||
end RateDiffState
|
||||
from "GLRows" t1
|
||||
left join "GLHeader" t2 on t1."GLHeader"=t2."Oid"
|
||||
join "vv_PartnerConnectionInfoAccount" t3 on t2."CustomersFrom"=t3."CustomersFrom"
|
||||
and t1."PartnerType"=t3."PartnerType" and t1."Customer"=t3."Customers" and t1."ConnectInfo"=t3."ConnectInfo"
|
||||
left join "PCIGroup" t4 on t2."CustomersFrom"=t4."CustomersFrom"
|
||||
and t1."PartnerType"=t4."PartnerType" and t1."Customer"=t4."Customers" and t1."ConnectInfo"=t4."ConnectInfo"
|
||||
left join "LiquidAssets" t5 on t1."LiquidAssets"=t5."Oid"
|
||||
left join "CurrencyName" t6 on t5."CurrencyName"=t6."Oid"
|
||||
left join "CurrencyName" t7 on t3."CurrencyName"=t7."Oid"
|
||||
where t2."GCRecord" is null and
|
||||
t2."GLDocumentType" in (2,3,4) and
|
||||
t6."ShortName" <> 'HUF' and coalesce(t7."ShortName",'HUF')<>'HUF' and
|
||||
((t1."PartnerType"=0 and t1."InAmountHUF">0) or (t1."PartnerType"=1 and t1."OutAmountHUF">0))
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Persistent.Validation
|
||||
|
||||
<DefaultClassOptions()> _
|
||||
<NonPersistent()> _
|
||||
<NavigationItem(False)> _
|
||||
<CreatableItem(False)> _
|
||||
Public Class CopyChartOfAccounts_PopUp
|
||||
Inherits BaseObject
|
||||
|
||||
Private _ChartOfAccountsYear_From As Long
|
||||
Private _ChartOfAccountsYear_To As Long
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
End Sub
|
||||
|
||||
Property ChartOfAccountsYear_From As Long
|
||||
Get
|
||||
Return _ChartOfAccountsYear_From
|
||||
End Get
|
||||
Set(value As Long)
|
||||
SetPropertyValue("ChartOfAccountsYear_From", _ChartOfAccountsYear_From, value)
|
||||
End Set
|
||||
End Property
|
||||
Property ChartOfAccountsYear_To As Long
|
||||
Get
|
||||
Return _ChartOfAccountsYear_To
|
||||
End Get
|
||||
Set(value As Long)
|
||||
SetPropertyValue("ChartOfAccountsYear_To", _ChartOfAccountsYear_To, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Persistent.Validation
|
||||
|
||||
<DefaultClassOptions()> _
|
||||
<NonPersistent> _
|
||||
<CreatableItem(False)> _
|
||||
<NavigationItem(False)> _
|
||||
Public Class CopyWorkflowSystem_PopUp
|
||||
Inherits BaseObject
|
||||
|
||||
Private _NeedToCopy As Boolean
|
||||
Private _WorkflowSystem As WorkflowSystem
|
||||
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
End Sub
|
||||
|
||||
Property NeedToCopy As Boolean
|
||||
Get
|
||||
Return _NeedToCopy
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
SetPropertyValue("NeedToCopy", _NeedToCopy, value)
|
||||
End Set
|
||||
End Property
|
||||
Property WorkflowSystem As WorkflowSystem
|
||||
Get
|
||||
Return _WorkflowSystem
|
||||
End Get
|
||||
Set(value As WorkflowSystem)
|
||||
SetPropertyValue("WorkflowSystem", _WorkflowSystem, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Persistent.Validation
|
||||
|
||||
Public Enum eExportOidClass
|
||||
Controlling = 0
|
||||
CostHolder = 1
|
||||
VAT = 2
|
||||
End Enum
|
||||
<DefaultClassOptions()> _
|
||||
<NonPersistent> _
|
||||
<CreatableItem(False)> _
|
||||
<NavigationItem(False)> _
|
||||
Public Class ExportOids_PopUp
|
||||
Inherits BaseObject
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
OpenFileAfterExport = True
|
||||
End Sub
|
||||
|
||||
Private _ExportOidClass As eExportOidClass
|
||||
Private _OpenFileAfterExport As Boolean
|
||||
|
||||
Property ExportOidClass As eExportOidClass
|
||||
Get
|
||||
Return _ExportOidClass
|
||||
End Get
|
||||
Set(value As eExportOidClass)
|
||||
SetPropertyValue("ExportOidClass", _ExportOidClass, value)
|
||||
End Set
|
||||
End Property
|
||||
Property OpenFileAfterExport As Boolean
|
||||
Get
|
||||
Return _OpenFileAfterExport
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
SetPropertyValue("OpenFileAfterExport", _OpenFileAfterExport, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
@@ -0,0 +1,148 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Persistent.Validation
|
||||
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem(False)> _
|
||||
<CreatableItem(False)> _
|
||||
Public Class SystemTool
|
||||
Inherits BaseObject
|
||||
|
||||
Private _SQLType_From As eSQLType
|
||||
Private _SQLServer_From As String
|
||||
Private _SQLUser_From As String
|
||||
Private _SQLPassword_From As String
|
||||
Private _SQLDatabase_From As String
|
||||
|
||||
Private _SQLType_To As eSQLType
|
||||
Private _SQLServer_To As String
|
||||
Private _SQLUser_To As String
|
||||
Private _SQLPassword_To As String
|
||||
Private _SQLDatabase_To As String
|
||||
|
||||
Private _UserCreated As User
|
||||
Private _ObjectCreated As Date
|
||||
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
SQLType_From = eSQLType.MSSQL
|
||||
SQLType_To = eSQLType.MSSQL
|
||||
End Sub
|
||||
Protected Overrides Sub OnSaving()
|
||||
MyBase.OnSaving()
|
||||
If Session.IsNewObject(Me) Then
|
||||
ObjectCreated = GetSQLTime(Session)
|
||||
UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Property SQLType_From As eSQLType
|
||||
Get
|
||||
Return _SQLType_From
|
||||
End Get
|
||||
Set(value As eSQLType)
|
||||
SetPropertyValue("SQLType_From", _SQLType_From, value)
|
||||
End Set
|
||||
End Property
|
||||
Property SQLServer_From As String
|
||||
Get
|
||||
Return _SQLServer_From
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("SQLServer_From", _SQLServer_From, value)
|
||||
End Set
|
||||
End Property
|
||||
Property SQLUser_From As String
|
||||
Get
|
||||
Return _SQLUser_From
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("SQLUser_From", _SQLUser_From, value)
|
||||
End Set
|
||||
End Property
|
||||
Property SQLPassword_From As String
|
||||
Get
|
||||
Return _SQLPassword_From
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("SQLPassword_From", _SQLPassword_From, value)
|
||||
End Set
|
||||
End Property
|
||||
Property SQLDatabase_From As String
|
||||
Get
|
||||
Return _SQLDatabase_From
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("SQLDatabase_From", _SQLDatabase_From, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property SQLType_To As eSQLType
|
||||
Get
|
||||
Return _SQLType_To
|
||||
End Get
|
||||
Set(value As eSQLType)
|
||||
SetPropertyValue("SQLType_To", _SQLType_To, value)
|
||||
End Set
|
||||
End Property
|
||||
Property SQLServer_To As String
|
||||
Get
|
||||
Return _SQLServer_To
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("SQLServer_To", _SQLServer_To, value)
|
||||
End Set
|
||||
End Property
|
||||
Property SQLUser_To As String
|
||||
Get
|
||||
Return _SQLUser_To
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("SQLUser_To", _SQLUser_To, value)
|
||||
End Set
|
||||
End Property
|
||||
Property SQLPassword_To As String
|
||||
Get
|
||||
Return _SQLPassword_To
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("SQLPassword_To", _SQLPassword_To, value)
|
||||
End Set
|
||||
End Property
|
||||
Property SQLDatabase_To As String
|
||||
Get
|
||||
Return _SQLDatabase_To
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("SQLDatabase_To", _SQLDatabase_To, value)
|
||||
End Set
|
||||
End Property
|
||||
<NonCloneable> _
|
||||
Property UserCreated As User
|
||||
Get
|
||||
Return _UserCreated
|
||||
End Get
|
||||
Set(value As User)
|
||||
SetPropertyValue("UserCreated", _UserCreated, value)
|
||||
End Set
|
||||
End Property
|
||||
<NonCloneable> _
|
||||
Property ObjectCreated As Date
|
||||
Get
|
||||
Return _ObjectCreated
|
||||
End Get
|
||||
Set(value As Date)
|
||||
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
+198
@@ -0,0 +1,198 @@
|
||||
Partial Class SystemTool_VC
|
||||
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
|
||||
MyClass.New()
|
||||
|
||||
'Required for Windows.Forms Class Composition Designer support
|
||||
Container.Add(Me)
|
||||
|
||||
End Sub
|
||||
|
||||
'Component overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Component Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Component Designer
|
||||
'It can be modified using the Component Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.aSystemTool_CopyVAT = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aSystemTool_CopyCostHolder = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aSystemTool_CopyControlling = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aSystemTool_ExportOids = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
|
||||
Me.aSystemTool_CopyCustomersGLParameters = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aSystemTool_ConnectionValidator = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aSystemTool_CopyChartOfAccounts = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
|
||||
Me.aSystemTool_CopyUnits = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aSystemTool_CopyWorkflowSystem = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
|
||||
'
|
||||
'aSystemTool_CopyVAT
|
||||
'
|
||||
Me.aSystemTool_CopyVAT.Caption = "aSystemTool_CopyVAT"
|
||||
Me.aSystemTool_CopyVAT.Category = "aSystemTool_CopyVAT"
|
||||
Me.aSystemTool_CopyVAT.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_CopyVAT.Id = "aSystemTool_CopyVAT"
|
||||
Me.aSystemTool_CopyVAT.ImageName = Nothing
|
||||
Me.aSystemTool_CopyVAT.Shortcut = Nothing
|
||||
Me.aSystemTool_CopyVAT.Tag = Nothing
|
||||
Me.aSystemTool_CopyVAT.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_CopyVAT.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_CopyVAT.TargetViewId = Nothing
|
||||
Me.aSystemTool_CopyVAT.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aSystemTool_CopyVAT.ToolTip = Nothing
|
||||
Me.aSystemTool_CopyVAT.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aSystemTool_CopyCostHolder
|
||||
'
|
||||
Me.aSystemTool_CopyCostHolder.Caption = "aSystemTool_CopyCostHolder"
|
||||
Me.aSystemTool_CopyCostHolder.Category = "aSystemTool_CopyCostHolder"
|
||||
Me.aSystemTool_CopyCostHolder.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_CopyCostHolder.Id = "aSystemTool_CopyCostHolder"
|
||||
Me.aSystemTool_CopyCostHolder.ImageName = Nothing
|
||||
Me.aSystemTool_CopyCostHolder.Shortcut = Nothing
|
||||
Me.aSystemTool_CopyCostHolder.Tag = Nothing
|
||||
Me.aSystemTool_CopyCostHolder.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_CopyCostHolder.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_CopyCostHolder.TargetViewId = Nothing
|
||||
Me.aSystemTool_CopyCostHolder.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aSystemTool_CopyCostHolder.ToolTip = Nothing
|
||||
Me.aSystemTool_CopyCostHolder.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aSystemTool_CopyControlling
|
||||
'
|
||||
Me.aSystemTool_CopyControlling.Caption = "aSystemTool_CopyControlling"
|
||||
Me.aSystemTool_CopyControlling.Category = "aSystemTool_CopyControlling"
|
||||
Me.aSystemTool_CopyControlling.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_CopyControlling.Id = "aSystemTool_CopyControlling"
|
||||
Me.aSystemTool_CopyControlling.ImageName = Nothing
|
||||
Me.aSystemTool_CopyControlling.Shortcut = Nothing
|
||||
Me.aSystemTool_CopyControlling.Tag = Nothing
|
||||
Me.aSystemTool_CopyControlling.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_CopyControlling.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_CopyControlling.TargetViewId = Nothing
|
||||
Me.aSystemTool_CopyControlling.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aSystemTool_CopyControlling.ToolTip = Nothing
|
||||
Me.aSystemTool_CopyControlling.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aSystemTool_ExportOids
|
||||
'
|
||||
Me.aSystemTool_ExportOids.AcceptButtonCaption = Nothing
|
||||
Me.aSystemTool_ExportOids.CancelButtonCaption = Nothing
|
||||
Me.aSystemTool_ExportOids.Caption = "aSystemTool_ExportOids"
|
||||
Me.aSystemTool_ExportOids.Category = "aSystemTool_ExportOids"
|
||||
Me.aSystemTool_ExportOids.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_ExportOids.Id = "aSystemTool_ExportOids"
|
||||
Me.aSystemTool_ExportOids.ImageName = Nothing
|
||||
Me.aSystemTool_ExportOids.Shortcut = Nothing
|
||||
Me.aSystemTool_ExportOids.Tag = Nothing
|
||||
Me.aSystemTool_ExportOids.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_ExportOids.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_ExportOids.TargetViewId = Nothing
|
||||
Me.aSystemTool_ExportOids.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aSystemTool_ExportOids.ToolTip = Nothing
|
||||
Me.aSystemTool_ExportOids.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aSystemTool_CopyCustomersGLParameters
|
||||
'
|
||||
Me.aSystemTool_CopyCustomersGLParameters.Caption = "aSystemTool_CopyCustomersGLParameters"
|
||||
Me.aSystemTool_CopyCustomersGLParameters.Category = "aSystemTool_CopyCustomersGLParameters"
|
||||
Me.aSystemTool_CopyCustomersGLParameters.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_CopyCustomersGLParameters.Id = "aSystemTool_CopyCustomersGLParameters"
|
||||
Me.aSystemTool_CopyCustomersGLParameters.ImageName = Nothing
|
||||
Me.aSystemTool_CopyCustomersGLParameters.Shortcut = Nothing
|
||||
Me.aSystemTool_CopyCustomersGLParameters.Tag = Nothing
|
||||
Me.aSystemTool_CopyCustomersGLParameters.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_CopyCustomersGLParameters.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_CopyCustomersGLParameters.TargetViewId = Nothing
|
||||
Me.aSystemTool_CopyCustomersGLParameters.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aSystemTool_CopyCustomersGLParameters.ToolTip = Nothing
|
||||
Me.aSystemTool_CopyCustomersGLParameters.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aSystemTool_ConnectionValidator
|
||||
'
|
||||
Me.aSystemTool_ConnectionValidator.Caption = "aSystemTool_ConnectionValidator"
|
||||
Me.aSystemTool_ConnectionValidator.Category = "aSystemTool_ConnectionValidator"
|
||||
Me.aSystemTool_ConnectionValidator.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_ConnectionValidator.Id = "aSystemTool_ConnectionValidator"
|
||||
Me.aSystemTool_ConnectionValidator.ImageName = Nothing
|
||||
Me.aSystemTool_ConnectionValidator.Shortcut = Nothing
|
||||
Me.aSystemTool_ConnectionValidator.Tag = Nothing
|
||||
Me.aSystemTool_ConnectionValidator.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_ConnectionValidator.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_ConnectionValidator.TargetViewId = Nothing
|
||||
Me.aSystemTool_ConnectionValidator.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aSystemTool_ConnectionValidator.ToolTip = Nothing
|
||||
Me.aSystemTool_ConnectionValidator.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aSystemTool_CopyChartOfAccounts
|
||||
'
|
||||
Me.aSystemTool_CopyChartOfAccounts.AcceptButtonCaption = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.CancelButtonCaption = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.Caption = "aSystemTool_CopyChartOfAccounts"
|
||||
Me.aSystemTool_CopyChartOfAccounts.Category = "aSystemTool_CopyChartOfAccounts"
|
||||
Me.aSystemTool_CopyChartOfAccounts.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.Id = "aSystemTool_CopyChartOfAccounts"
|
||||
Me.aSystemTool_CopyChartOfAccounts.ImageName = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.Shortcut = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.Tag = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_CopyChartOfAccounts.TargetViewId = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aSystemTool_CopyChartOfAccounts.ToolTip = Nothing
|
||||
Me.aSystemTool_CopyChartOfAccounts.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aSystemTool_CopyUnits
|
||||
'
|
||||
Me.aSystemTool_CopyUnits.Caption = "aSystemTool_CopyUnits"
|
||||
Me.aSystemTool_CopyUnits.Category = "aSystemTool_CopyUnits"
|
||||
Me.aSystemTool_CopyUnits.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_CopyUnits.Id = "aSystemTool_CopyUnits"
|
||||
Me.aSystemTool_CopyUnits.ImageName = Nothing
|
||||
Me.aSystemTool_CopyUnits.Shortcut = Nothing
|
||||
Me.aSystemTool_CopyUnits.Tag = Nothing
|
||||
Me.aSystemTool_CopyUnits.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_CopyUnits.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_CopyUnits.TargetViewId = Nothing
|
||||
Me.aSystemTool_CopyUnits.ToolTip = Nothing
|
||||
Me.aSystemTool_CopyUnits.TypeOfView = Nothing
|
||||
'
|
||||
'aSystemTool_CopyWorkflowSystem
|
||||
'
|
||||
Me.aSystemTool_CopyWorkflowSystem.AcceptButtonCaption = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.CancelButtonCaption = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.Caption = "aSystemTool_CopyWorkflowSystem"
|
||||
Me.aSystemTool_CopyWorkflowSystem.ConfirmationMessage = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.Id = "aSystemTool_CopyWorkflowSystem"
|
||||
Me.aSystemTool_CopyWorkflowSystem.ImageName = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.Shortcut = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.Tag = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.TargetObjectsCriteria = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.TargetObjectType = GetType(SISBusiness.[Module].SystemTool)
|
||||
Me.aSystemTool_CopyWorkflowSystem.TargetViewId = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.ToolTip = Nothing
|
||||
Me.aSystemTool_CopyWorkflowSystem.TypeOfView = Nothing
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aSystemTool_ConnectionValidator As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aSystemTool_CopyChartOfAccounts As DevExpress.ExpressApp.Actions.PopupWindowShowAction
|
||||
Friend WithEvents aSystemTool_CopyVAT As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aSystemTool_CopyCostHolder As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aSystemTool_CopyControlling As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aSystemTool_ExportOids As DevExpress.ExpressApp.Actions.PopupWindowShowAction
|
||||
Friend WithEvents aSystemTool_CopyCustomersGLParameters As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aSystemTool_CopyUnits As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aSystemTool_CopyWorkflowSystem As DevExpress.ExpressApp.Actions.PopupWindowShowAction
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="aSystemTool_CopyVAT.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>763, 134</value>
|
||||
</metadata>
|
||||
<metadata name="aSystemTool_CopyCostHolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>548, 134</value>
|
||||
</metadata>
|
||||
<metadata name="aSystemTool_CopyControlling.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>333, 134</value>
|
||||
</metadata>
|
||||
<metadata name="aSystemTool_ExportOids.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 134</value>
|
||||
</metadata>
|
||||
<metadata name="aSystemTool_CopyCustomersGLParameters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aSystemTool_ConnectionValidator.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 56</value>
|
||||
</metadata>
|
||||
<metadata name="aSystemTool_CopyChartOfAccounts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aSystemTool_CopyUnits.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>268, 278</value>
|
||||
</metadata>
|
||||
<metadata name="aSystemTool_CopyWorkflowSystem.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>450, 278</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,663 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Diagnostics
|
||||
Imports System.Text
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.ExpressApp.Actions
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Public Class SystemTool_VC
|
||||
Inherits DevExpress.ExpressApp.ViewController
|
||||
Public Event InitWork(ByVal _Minimum As Long, ByVal _Step As Long, ByVal _Maximum As Long)
|
||||
Public Event DoWork()
|
||||
Public Event FinalWork
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
End Sub
|
||||
Private Sub aSystemTool_ConnectionValidator_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aSystemTool_ConnectionValidator.Execute
|
||||
'Beep()
|
||||
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyChartOfAccounts_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aSystemTool_CopyChartOfAccounts.CustomizePopupWindowParams
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _CopyChartOfAccounts_PopUp As New CopyChartOfAccounts_PopUp(_onew.Session)
|
||||
|
||||
e.View = Application.CreateDetailView(_onew, "CopyChartOfAccounts_PopUp_DetailView", False, _CopyChartOfAccounts_PopUp)
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyChartOfAccounts_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aSystemTool_CopyChartOfAccounts.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _SystemTool As SystemTool = TryCast(View.SelectedObjects(0), SystemTool)
|
||||
Dim _CopyChartOfAccounts_PopUp As CopyChartOfAccounts_PopUp = _ocur.GetObject(e.PopupWindow.View.SelectedObjects(0))
|
||||
Dim _Session_From As New Session
|
||||
Dim _Session_To As New Session
|
||||
|
||||
_Session_From.ConnectionString = GetConnectionString(0, _SystemTool)
|
||||
_Session_To.ConnectionString = GetConnectionString(1, _SystemTool)
|
||||
Try
|
||||
_Session_From.Connect()
|
||||
If _Session_From.IsConnected Then
|
||||
_Session_To.Connect()
|
||||
If _Session_To.IsConnected Then
|
||||
Dim _uow_From As New UnitOfWork(_Session_From.DataLayer)
|
||||
Dim _uow_To As New UnitOfWork(_Session_To.DataLayer)
|
||||
Dim _ChartOfAccounts_Collection_From As New XPCollection(Of ChartOfAccounts)(_uow_From, CriteriaOperator.Parse("AccountYear=?", _CopyChartOfAccounts_PopUp.ChartOfAccountsYear_From))
|
||||
Dim _ChartOfAccountsYear_From As ChartOfAccountsYear = _uow_From.FindObject(Of ChartOfAccountsYear)(CriteriaOperator.Parse("AccountYear=?", _CopyChartOfAccounts_PopUp.ChartOfAccountsYear_From))
|
||||
|
||||
Dim _ChartOfAccountsYear_To As ChartOfAccountsYear = _uow_To.FindObject(Of ChartOfAccountsYear)(CriteriaOperator.Parse("AccountYear=?", _CopyChartOfAccounts_PopUp.ChartOfAccountsYear_To))
|
||||
If _ChartOfAccountsYear_To Is Nothing Then
|
||||
_ChartOfAccountsYear_To = New ChartOfAccountsYear(_uow_To)
|
||||
With _ChartOfAccountsYear_To
|
||||
.AccountYear = _CopyChartOfAccounts_PopUp.ChartOfAccountsYear_To
|
||||
End With
|
||||
_uow_To.CommitChanges()
|
||||
End If
|
||||
|
||||
Dim _ChartOfAccounts_Collection_To As New XPCollection(Of ChartOfAccounts)(_uow_To, CriteriaOperator.Parse("AccountYear=?", _ChartOfAccountsYear_To.AccountYear))
|
||||
'ChartOfAccounts.AccountNumber-re kell vizsgálni, ha van nem szabad bántani
|
||||
|
||||
RaiseEvent InitWork(1, 1, _ChartOfAccounts_Collection_From.Count)
|
||||
|
||||
If _ChartOfAccounts_Collection_To.Count = 0 Then
|
||||
'Új év nem kell vizsgálgatni a létezõket
|
||||
For Each _ChartOfAccounts As ChartOfAccounts In _ChartOfAccounts_Collection_From
|
||||
Dim _ChartOfAccounts_New_To As New ChartOfAccounts(_uow_To)
|
||||
With _ChartOfAccounts_New_To
|
||||
.Name = _ChartOfAccounts.Name
|
||||
.Parent = Nothing
|
||||
.AccountNumber = _ChartOfAccounts.AccountNumber
|
||||
.AccountYear = _ChartOfAccountsYear_To.AccountYear
|
||||
End With
|
||||
RaiseEvent DoWork()
|
||||
Next
|
||||
Else
|
||||
'Szívás, meglévõ évhez kell beszúrni dolgokat, vizsgálgatni kell az AccountNumber-eket
|
||||
For Each _ChartOfAccounts As ChartOfAccounts In _ChartOfAccounts_Collection_From
|
||||
If Not IsExistChartOfAccounts(_ChartOfAccounts.AccountNumber, _ChartOfAccounts_Collection_To) Then
|
||||
Dim _ChartOfAccounts_New_To As New ChartOfAccounts(_uow_To)
|
||||
With _ChartOfAccounts_New_To
|
||||
.Name = _ChartOfAccounts.Name
|
||||
.Parent = Nothing
|
||||
.AccountNumber = _ChartOfAccounts.AccountNumber
|
||||
.AccountYear = _ChartOfAccountsYear_To.AccountYear
|
||||
End With
|
||||
End If
|
||||
RaiseEvent DoWork()
|
||||
Next
|
||||
End If
|
||||
|
||||
_uow_To.CommitChanges()
|
||||
|
||||
RaiseEvent FinalWork
|
||||
|
||||
_ChartOfAccounts_Collection_To = New XPCollection(Of ChartOfAccounts)(_uow_To, CriteriaOperator.Parse("AccountYear=?", _ChartOfAccountsYear_To.AccountYear))
|
||||
|
||||
RaiseEvent InitWork(1, 1, _ChartOfAccounts_Collection_To.Count)
|
||||
For Each _ChartOfAccounts As ChartOfAccounts In _ChartOfAccounts_Collection_To
|
||||
RecursiveSetParent(_uow_To, _ChartOfAccountsYear_To.AccountYear, _ChartOfAccounts.AccountNumber, _ChartOfAccounts)
|
||||
RaiseEvent DoWork()
|
||||
Next
|
||||
_uow_To.CommitChanges()
|
||||
RaiseEvent FinalWork
|
||||
|
||||
|
||||
'Select Case _SystemTool.SQLType_To
|
||||
' Case eSQLType.MSSQL
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE ChartOfAccountsYear NOCHECK CONSTRAINT ALL")
|
||||
' _uow_To.ExecuteNonQuery("UPDATE ChartOfAccountsYear SET Oid='" + _ChartOfAccountsYear_From.Oid.ToString + "' WHERE Oid='" + _ChartOfAccountsYear_New.Oid.ToString + "'")
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE ChartOfAccountsYear CHECK CONSTRAINT ALL")
|
||||
' Case eSQLType.MySQL
|
||||
' '--==Oid regenerálás==--
|
||||
' _uow_To.ExecuteNonQuery("UPDATE ChartOfAccountsYear SET Oid='" + _ChartOfAccountsYear_From.Oid.ToString + "' WHERE Oid='" + _ChartOfAccountsYear_New.Oid.ToString + "'")
|
||||
' '--===================--
|
||||
' Case eSQLType.PostgreSQL
|
||||
' _uow_To.ExecuteNonQuery("UPDATE ""ChartOfAccountsYear"" SET ""Oid""='" + _ChartOfAccountsYear_From.Oid.ToString + "' WHERE ""Oid""='" + _ChartOfAccountsYear_New.Oid.ToString + "'")
|
||||
'End Select
|
||||
|
||||
|
||||
'RaiseEvent InitWork(1, 1, _ChartOfAccounts_Collection.Count)
|
||||
'For Each _ChartOfAccounts As ChartOfAccounts In _ChartOfAccounts_Collection
|
||||
' Dim _ChartOfAccounts_New As New ChartOfAccounts(_uow_To)
|
||||
' With _ChartOfAccounts_New
|
||||
' .Name = _ChartOfAccounts.Name
|
||||
' .Parent = Nothing
|
||||
' .AccountNumber = _ChartOfAccounts.AccountNumber
|
||||
' .AccountYear = _CopyChartOfAccounts_PopUp.TargetAccountYear
|
||||
|
||||
' End With
|
||||
' _uow_To.CommitChanges()
|
||||
|
||||
' Select _SystemTool.SQLType_To
|
||||
' Case eSQLType.MSSQL
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE HCategory NOCHECK CONSTRAINT ALL")
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE ChartOfAccounts NOCHECK CONSTRAINT ALL")
|
||||
' _uow_To.ExecuteNonQuery("UPDATE HCategory SET Oid='" + _ChartOfAccounts.Oid.ToString + "' WHERE Oid='" + _ChartOfAccounts_New.Oid.ToString + "'")
|
||||
' _uow_To.ExecuteNonQuery("UPDATE ChartOfAccounts SET Oid='" + _ChartOfAccounts.Oid.ToString + "' WHERE Oid='" + _ChartOfAccounts_New.Oid.ToString + "'")
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE HCategory CHECK CONSTRAINT ALL")
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE ChartOfAccounts CHECK CONSTRAINT ALL")
|
||||
' Case eSQLType.MySQL
|
||||
' '--==Oid regenerálás==--
|
||||
' _uow_To.ExecuteNonQuery("SET foreign_key_checks = 0")
|
||||
' _uow_To.ExecuteNonQuery("UPDATE HCategory SET Oid='" + _ChartOfAccounts.Oid.ToString + "' WHERE Oid='" + _ChartOfAccounts_New.Oid.ToString + "'")
|
||||
' _uow_To.ExecuteNonQuery("UPDATE ChartOfAccounts SET Oid='" + _ChartOfAccounts.Oid.ToString + "' WHERE Oid='" + _ChartOfAccounts_New.Oid.ToString + "'")
|
||||
' _uow_To.ExecuteNonQuery("SET foreign_key_checks = 1")
|
||||
' '--===================--
|
||||
' Case eSQLType.PostgreSQL
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE ""HCategory"" DISABLE TRIGGER ALL")
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE ""ChartOfAccounts"" DISABLE TRIGGER ALL")
|
||||
' _uow_To.ExecuteNonQuery("UPDATE ""HCategory"" SET ""Oid""='" + _ChartOfAccounts.Oid.ToString + "' WHERE ""Oid""='" + _ChartOfAccounts_New.Oid.ToString + "'")
|
||||
' _uow_To.ExecuteNonQuery("UPDATE ""ChartOfAccounts"" SET ""Oid""='" + _ChartOfAccounts.Oid.ToString + "' WHERE ""Oid""='" + _ChartOfAccounts_New.Oid.ToString + "'")
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE ""HCategory"" ENABLE TRIGGER ALL")
|
||||
' _uow_To.ExecuteNonQuery("ALTER TABLE ""ChartOfAccounts"" ENABLE TRIGGER ALL")
|
||||
' End Select
|
||||
' RaiseEvent DoWork()
|
||||
'Next
|
||||
'RaiseEvent FinalWork
|
||||
|
||||
|
||||
'_ChartOfAccounts_Collection = New XPCollection(Of ChartOfAccounts)(_uow_To, CriteriaOperator.Parse("AccountYear=?", _CopyChartOfAccounts_PopUp.TargetAccountYear))
|
||||
'RaiseEvent InitWork(1, 1, _ChartOfAccounts_Collection.Count)
|
||||
|
||||
'For Each _ChartOfAccounts In _ChartOfAccounts_Collection
|
||||
' RecursiveSetParent(_uow_To, _CopyChartOfAccounts_PopUp.TargetAccountYear, _ChartOfAccounts.AccountNumber, _ChartOfAccounts)
|
||||
' RaiseEvent DoWork()
|
||||
'Next
|
||||
'_uow_To.CommitChanges()
|
||||
'RaiseEvent FinalWork
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Finally
|
||||
If _Session_From.IsConnected Then _Session_From.Disconnect()
|
||||
If _Session_To.IsConnected Then _Session_To.Disconnect()
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
End Sub
|
||||
Private Function GetConnectionString(_Type As Integer, _SystemTool As SystemTool) As String
|
||||
Dim _ConnectionString As String = ""
|
||||
If _Type = 0 Then
|
||||
Select Case _SystemTool.SQLType_From
|
||||
Case eSQLType.MSSQL
|
||||
_ConnectionString = DevExpress.Xpo.DB.MSSqlConnectionProvider.GetConnectionString(_SystemTool.SQLServer_From, _SystemTool.SQLUser_From, _SystemTool.SQLPassword_From, _SystemTool.SQLDatabase_From)
|
||||
Case eSQLType.MySQL
|
||||
_ConnectionString = DevExpress.Xpo.DB.MySqlConnectionProvider.GetConnectionString(_SystemTool.SQLServer_From, _SystemTool.SQLUser_From, _SystemTool.SQLPassword_From, _SystemTool.SQLDatabase_From)
|
||||
Case eSQLType.PostgreSQL
|
||||
_ConnectionString = DevExpress.Xpo.DB.PostgreSqlConnectionProvider.GetConnectionString(_SystemTool.SQLServer_From, _SystemTool.SQLUser_From, _SystemTool.SQLPassword_From, _SystemTool.SQLDatabase_From)
|
||||
End Select
|
||||
ElseIf _Type = 1 Then
|
||||
Select Case _SystemTool.SQLType_To
|
||||
Case eSQLType.MSSQL
|
||||
_ConnectionString = DevExpress.Xpo.DB.MSSqlConnectionProvider.GetConnectionString(_SystemTool.SQLServer_To, _SystemTool.SQLUser_To, _SystemTool.SQLPassword_To, _SystemTool.SQLDatabase_To)
|
||||
Case eSQLType.MySQL
|
||||
_ConnectionString = DevExpress.Xpo.DB.MySqlConnectionProvider.GetConnectionString(_SystemTool.SQLServer_To, _SystemTool.SQLUser_To, _SystemTool.SQLPassword_To, _SystemTool.SQLDatabase_To)
|
||||
Case eSQLType.PostgreSQL
|
||||
_ConnectionString = DevExpress.Xpo.DB.PostgreSqlConnectionProvider.GetConnectionString(_SystemTool.SQLServer_To, _SystemTool.SQLUser_To, _SystemTool.SQLPassword_To, _SystemTool.SQLDatabase_To)
|
||||
End Select
|
||||
End If
|
||||
|
||||
Return _ConnectionString
|
||||
End Function
|
||||
Private Sub RecursiveSetParent(_uow As UnitOfWork, _Year As Long, _AccountNumber As String, _ChartOfAccount_Set As ChartOfAccounts)
|
||||
Dim _AccountNumber_Parent As String = LTrim(RTrim(Mid(_AccountNumber, 1, Len(_AccountNumber) - 1)))
|
||||
Dim _ChartOfAccounts_Parent As ChartOfAccounts
|
||||
|
||||
If _AccountNumber_Parent = "" Then
|
||||
Else
|
||||
_ChartOfAccounts_Parent = _uow.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber=?", _Year, _AccountNumber_Parent))
|
||||
If _ChartOfAccounts_Parent Is Nothing Then
|
||||
RecursiveSetParent(_uow, _Year, _AccountNumber_Parent, _ChartOfAccount_Set)
|
||||
Else
|
||||
_ChartOfAccount_Set.Parent = _ChartOfAccounts_Parent
|
||||
_uow.CommitChanges()
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyVAT_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aSystemTool_CopyVAT.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _SystemTool As SystemTool = TryCast(View.SelectedObjects(0), SystemTool)
|
||||
Dim _VAT_Collection As XPCollection(Of VAT)
|
||||
Dim _Session_From As New Session
|
||||
Dim _Session_To As New Session
|
||||
_Session_From.ConnectionString = GetConnectionString(0, _SystemTool)
|
||||
_Session_To.ConnectionString = GetConnectionString(1, _SystemTool)
|
||||
Try
|
||||
_Session_From.Connect()
|
||||
If _Session_From.IsConnected Then
|
||||
_Session_To.Connect()
|
||||
If _Session_To.IsConnected Then
|
||||
|
||||
Dim _uow_From As New UnitOfWork(_Session_From.DataLayer)
|
||||
Dim _uow_To As New UnitOfWork(_Session_To.DataLayer)
|
||||
_VAT_Collection = New XPCollection(Of VAT)(_uow_From, CriteriaOperator.Parse("1=1"))
|
||||
|
||||
RaiseEvent InitWork(1, 1, _VAT_Collection.Count)
|
||||
For Each _VAT As VAT In _VAT_Collection
|
||||
Dim _VAT_New As New VAT(_uow_To)
|
||||
With _VAT_New
|
||||
.ShortName = _VAT.ShortName
|
||||
.Description = _VAT.Description
|
||||
.KeyValue = _VAT.KeyValue
|
||||
.ChartOfAccountsOut = _uow_To.GetObjectByKey(Of ChartOfAccounts)(_VAT.ChartOfAccountsOut.Oid)
|
||||
.ChartOfAccountsIn = _uow_To.GetObjectByKey(Of ChartOfAccounts)(_VAT.ChartOfAccountsIn.Oid)
|
||||
.ClaimState = _VAT.ClaimState
|
||||
.Active = _VAT.Active
|
||||
.InversState = _VAT.InversState
|
||||
.InversKeyValue = _VAT.InversKeyValue
|
||||
.DefaultForBusinnes = _VAT.DefaultForBusinnes
|
||||
.DefaultForExternalEUNoVAT = _VAT.DefaultForExternalEUNoVAT
|
||||
.DefaultForExternalOther = _VAT.DefaultForExternalOther
|
||||
.DefaultForInversVAT = _VAT.DefaultForInversVAT
|
||||
End With
|
||||
_uow_To.CommitChanges()
|
||||
Select Case _SystemTool.SQLType_To
|
||||
Case eSQLType.MSSQL
|
||||
'--==Oid regenerálás==--
|
||||
_uow_To.ExecuteNonQuery("UPDATE VAT SET Oid='" + _VAT.Oid.ToString + "' WHERE Oid='" + _VAT_New.Oid.ToString + "'")
|
||||
'--===================--
|
||||
Case eSQLType.MySQL
|
||||
'--==Oid regenerálás==--
|
||||
_uow_To.ExecuteNonQuery("UPDATE VAT SET Oid='" + _VAT.Oid.ToString + "' WHERE Oid='" + _VAT_New.Oid.ToString + "'")
|
||||
'--===================--
|
||||
Case eSQLType.PostgreSQL
|
||||
'--==Oid regenerálás==--
|
||||
_uow_To.ExecuteNonQuery("UPDATE ""VAT"" SET ""Oid""='" + _VAT.Oid.ToString + "' WHERE ""Oid""='" + _VAT_New.Oid.ToString + "'")
|
||||
'--===================--
|
||||
End Select
|
||||
|
||||
RaiseEvent DoWork()
|
||||
Next
|
||||
RaiseEvent FinalWork
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Finally
|
||||
If _Session_From.IsConnected Then _Session_From.Disconnect()
|
||||
If _Session_To.IsConnected Then _Session_To.Disconnect()
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyCostHolder_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aSystemTool_CopyCostHolder.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _SystemTool As SystemTool = TryCast(View.SelectedObjects(0), SystemTool)
|
||||
Dim _CostHolder_Collection As XPCollection(Of CostHolder)
|
||||
Dim _Session_From As New Session
|
||||
Dim _Session_To As New Session
|
||||
_Session_From.ConnectionString = GetConnectionString(0, _SystemTool)
|
||||
_Session_To.ConnectionString = GetConnectionString(1, _SystemTool)
|
||||
Try
|
||||
_Session_From.Connect()
|
||||
If _Session_From.IsConnected Then
|
||||
_Session_To.Connect()
|
||||
If _Session_To.IsConnected Then
|
||||
|
||||
Dim _uow_From As New UnitOfWork(_Session_From.DataLayer)
|
||||
Dim _uow_To As New UnitOfWork(_Session_To.DataLayer)
|
||||
_CostHolder_Collection = New XPCollection(Of CostHolder)(_uow_From, CriteriaOperator.Parse("1=1"))
|
||||
|
||||
RaiseEvent InitWork(1, 1, _CostHolder_Collection.Count)
|
||||
For Each _CostHolder As CostHolder In _CostHolder_Collection
|
||||
Dim _CostHolder_New As New CostHolder(_uow_To)
|
||||
With _CostHolder_New
|
||||
.Name = _CostHolder.Name
|
||||
If _CostHolder.Parent IsNot Nothing Then
|
||||
Dim _Parent As CostHolder = _uow_From.FindObject(Of CostHolder)(CriteriaOperator.Parse("Oid=?", _CostHolder.Parent.Oid))
|
||||
.Parent = _uow_To.GetObjectByKey(Of CostHolder)(_Parent.Oid)
|
||||
End If
|
||||
End With
|
||||
_uow_To.CommitChanges()
|
||||
|
||||
Select _SystemTool.SQLType_To
|
||||
Case eSQLType.MSSQL
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE HCategory NOCHECK CONSTRAINT ALL")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE CostHolder NOCHECK CONSTRAINT ALL")
|
||||
_uow_To.ExecuteNonQuery("UPDATE HCategory SET Oid='" + _CostHolder.Oid.ToString + "' WHERE Oid='" + _CostHolder_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("UPDATE CostHolder SET Oid='" + _CostHolder.Oid.ToString + "' WHERE Oid='" + _CostHolder_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE HCategory CHECK CONSTRAINT ALL")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE CostHolder CHECK CONSTRAINT ALL")
|
||||
Case eSQLType.MySQL
|
||||
'--==Oid regenerálás==--
|
||||
_uow_To.ExecuteNonQuery("SET foreign_key_checks = 0")
|
||||
_uow_To.ExecuteNonQuery("UPDATE HCategory SET Oid='" + _CostHolder.Oid.ToString + "' WHERE Oid='" + _CostHolder_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("UPDATE CostHolder SET Oid='" + _CostHolder.Oid.ToString + "' WHERE Oid='" + _CostHolder_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("SET foreign_key_checks = 1")
|
||||
'--===================--
|
||||
Case eSQLType.PostgreSQL
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE ""HCategory"" DISABLE TRIGGER ALL")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE ""CostHolder"" DISABLE TRIGGER ALL")
|
||||
_uow_To.ExecuteNonQuery("UPDATE ""CostHolder"" SET ""Oid""='" + _CostHolder.Oid.ToString + "' WHERE ""Oid""='" + _CostHolder_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("UPDATE ""HCategory"" SET ""Oid""='" + _CostHolder.Oid.ToString + "' WHERE ""Oid""='" + _CostHolder_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE ""HCategory"" ENABLE TRIGGER ALL")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE ""CostHolder"" ENABLE TRIGGER ALL")
|
||||
End Select
|
||||
|
||||
RaiseEvent DoWork()
|
||||
Next
|
||||
RaiseEvent FinalWork
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Finally
|
||||
If _Session_From.IsConnected Then _Session_From.Disconnect()
|
||||
If _Session_To.IsConnected Then _Session_To.Disconnect()
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyControlling_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aSystemTool_CopyControlling.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _SystemTool As SystemTool = TryCast(View.SelectedObjects(0), SystemTool)
|
||||
Dim _Controlling_Collection As XPCollection(Of Controlling)
|
||||
Dim _Session_From As New Session
|
||||
Dim _Session_To As New Session
|
||||
_Session_From.ConnectionString = GetConnectionString(0, _SystemTool)
|
||||
_Session_To.ConnectionString = GetConnectionString(1, _SystemTool)
|
||||
Try
|
||||
_Session_From.Connect()
|
||||
If _Session_From.IsConnected Then
|
||||
_Session_To.Connect()
|
||||
If _Session_To.IsConnected Then
|
||||
|
||||
Dim _uow_From As New UnitOfWork(_Session_From.DataLayer)
|
||||
Dim _uow_To As New UnitOfWork(_Session_To.DataLayer)
|
||||
_Controlling_Collection = New XPCollection(Of Controlling)(_uow_From, CriteriaOperator.Parse("1=1"))
|
||||
|
||||
RaiseEvent InitWork(1, 1, _Controlling_Collection.Count)
|
||||
For Each _Controlling As Controlling In _Controlling_Collection
|
||||
Dim _Controlling_New As New Controlling(_uow_To)
|
||||
With _Controlling_New
|
||||
.Name = _Controlling.Name
|
||||
If _Controlling.Parent IsNot Nothing Then
|
||||
Dim _Parent As Controlling = _uow_From.FindObject(Of Controlling)(CriteriaOperator.Parse("Oid=?", _Controlling.Parent.Oid))
|
||||
.Parent = _uow_To.GetObjectByKey(Of Controlling)(_Parent.Oid)
|
||||
End If
|
||||
If _Controlling.ChartOfAccounts IsNot Nothing Then
|
||||
.ChartOfAccounts = _uow_To.GetObjectByKey(Of ChartOfAccounts)(_Controlling.ChartOfAccounts.Oid)
|
||||
End If
|
||||
If _Controlling.ChartOfAccounts2 IsNot Nothing Then
|
||||
.ChartOfAccounts2 = _uow_To.GetObjectByKey(Of ChartOfAccounts)(_Controlling.ChartOfAccounts2.Oid)
|
||||
End If
|
||||
.IsCOCRequired = _Controlling.IsCOCRequired
|
||||
.COCAboveAmount = _Controlling.COCAboveAmount
|
||||
.IsParent = _Controlling.IsParent
|
||||
.Controllingdirection = _Controlling.Controllingdirection
|
||||
.IsReInvoiceReason = _Controlling.IsReInvoiceReason
|
||||
.ReInvoiceDescription = _Controlling.ReInvoiceDescription
|
||||
.TechnicalContractLimit = _Controlling.TechnicalContractLimit
|
||||
If _Controlling.Controlling1 IsNot Nothing Then
|
||||
.Controlling1 = _uow_To.GetObjectByKey(Of Controlling)(_Controlling.Controlling1.Oid)
|
||||
Else
|
||||
.Controlling1 = Nothing
|
||||
End If
|
||||
If _Controlling.Controlling2 IsNot Nothing Then
|
||||
.Controlling2 = _uow_To.GetObjectByKey(Of Controlling)(_Controlling.Controlling2.Oid)
|
||||
Else
|
||||
.Controlling2 = Nothing
|
||||
End If
|
||||
If _Controlling.Controlling3 IsNot Nothing Then
|
||||
.Controlling3 = _uow_To.GetObjectByKey(Of Controlling)(_Controlling.Controlling3.Oid)
|
||||
Else
|
||||
.Controlling3 = Nothing
|
||||
End If
|
||||
If _Controlling.Controlling4 IsNot Nothing Then
|
||||
.Controlling4 = _uow_To.GetObjectByKey(Of Controlling)(_Controlling.Controlling4.Oid)
|
||||
Else
|
||||
.Controlling4 = Nothing
|
||||
End If
|
||||
If _Controlling.Controlling5 IsNot Nothing Then
|
||||
.Controlling5 = _uow_To.GetObjectByKey(Of Controlling)(_Controlling.Controlling5.Oid)
|
||||
Else
|
||||
.Controlling5 = Nothing
|
||||
End If
|
||||
.IsAdvancePayment = _Controlling.IsAdvancePayment
|
||||
.IsEstateStatistics = _Controlling.IsEstateStatistics
|
||||
End With
|
||||
_uow_To.CommitChanges()
|
||||
|
||||
|
||||
Select _SystemTool.SQLType_To
|
||||
Case eSQLType.MSSQL
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE HCategory NOCHECK CONSTRAINT ALL")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE Controlling NOCHECK CONSTRAINT ALL")
|
||||
_uow_To.ExecuteNonQuery("UPDATE HCategory SET Oid='" + _Controlling.Oid.ToString + "' WHERE Oid='" + _Controlling_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("UPDATE Controlling SET Oid='" + _Controlling.Oid.ToString + "' WHERE Oid='" + _Controlling_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE HCategory CHECK CONSTRAINT ALL")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE Controlling CHECK CONSTRAINT ALL")
|
||||
Case eSQLType.MySQL
|
||||
'--==Oid regenerálás==--
|
||||
_uow_To.ExecuteNonQuery("SET foreign_key_checks = 0")
|
||||
_uow_To.ExecuteNonQuery("UPDATE HCategory SET Oid='" + _Controlling.Oid.ToString + "' WHERE Oid='" + _Controlling_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("UPDATE Controlling SET Oid='" + _Controlling.Oid.ToString + "' WHERE Oid='" + _Controlling_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("SET foreign_key_checks = 1")
|
||||
'--===================--
|
||||
Case eSQLType.PostgreSQL
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE ""HCategory"" DISABLE TRIGGER ALL")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE ""Controlling"" DISABLE TRIGGER ALL")
|
||||
_uow_To.ExecuteNonQuery("UPDATE ""HCategory"" SET ""Oid""='" + _Controlling.Oid.ToString + "' WHERE ""Oid""='" + _Controlling_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("UPDATE ""Controlling"" SET ""Oid""='" + _Controlling.Oid.ToString + "' WHERE ""Oid""='" + _Controlling_New.Oid.ToString + "'")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE ""HCategory"" ENABLE TRIGGER ALL")
|
||||
_uow_To.ExecuteNonQuery("ALTER TABLE ""Controlling"" ENABLE TRIGGER ALL")
|
||||
|
||||
End Select
|
||||
|
||||
RaiseEvent DoWork()
|
||||
Next
|
||||
RaiseEvent FinalWork
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Finally
|
||||
If _Session_From.IsConnected Then _Session_From.Disconnect()
|
||||
If _Session_To.IsConnected Then _Session_To.Disconnect()
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aSystemTool_ExportOids_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aSystemTool_ExportOids.CustomizePopupWindowParams
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _ExportOids_PopUp As New ExportOids_PopUp(_onew.Session)
|
||||
|
||||
e.View = Application.CreateDetailView(_onew, "ExportOids_PopUp_DetailView", False, _ExportOids_PopUp)
|
||||
End Sub
|
||||
Private Sub aSystemTool_ExportOids_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aSystemTool_ExportOids.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _ExportOids_PopUp As ExportOids_PopUp = TryCast(e.PopupWindow.View.SelectedObjects(0), ExportOids_PopUp)
|
||||
If _ExportOids_PopUp IsNot Nothing Then
|
||||
Dim _FileName As String = IO.Path.GetTempPath + "Export.txt"
|
||||
If IO.File.Exists(_FileName) Then IO.File.Delete(_FileName)
|
||||
Dim _StreamWriter As New System.IO.StreamWriter(_FileName, True)
|
||||
Select Case _ExportOids_PopUp.ExportOidClass
|
||||
Case eExportOidClass.Controlling
|
||||
Dim _Controlling_Collection As New XPCollection(Of Controlling)(_ocur.Session, CriteriaOperator.Parse("1=1"))
|
||||
_StreamWriter.WriteLine("<Services_Controlling>")
|
||||
_StreamWriter.WriteLine("<!--szolgaltatascsoport id - Controlling Oid-->")
|
||||
Dim _Index As Integer = 1
|
||||
For Each _Controlling As Controlling In _Controlling_Collection
|
||||
_StreamWriter.WriteLine("<!--" + _Controlling.Name + "-->")
|
||||
_StreamWriter.WriteLine("<add key=" + _Index.ToString + " value=" + _Controlling.Oid.ToString + "></add>")
|
||||
_Index += 1
|
||||
Next
|
||||
_StreamWriter.WriteLine("</Services_Controlling>")
|
||||
Case eExportOidClass.CostHolder
|
||||
Dim _CostHolder_Collection As New XPCollection(Of CostHolder)(_ocur.Session, CriteriaOperator.Parse("1=1"))
|
||||
_StreamWriter.WriteLine("<Services_CostHolder>")
|
||||
_StreamWriter.WriteLine("<!--szolgaltatascsoport id - CostHolder Oid-->")
|
||||
Dim _Index As Integer = 1
|
||||
For Each _CostHolder As CostHolder In _CostHolder_Collection
|
||||
_StreamWriter.WriteLine("<!--" + _CostHolder.Name + "-->")
|
||||
_StreamWriter.WriteLine("<add key=" + _Index.ToString + " value=" + _CostHolder.Oid.ToString + "></add>")
|
||||
_Index += 1
|
||||
Next
|
||||
_StreamWriter.WriteLine("</Services_CostHolder>")
|
||||
Case eExportOidClass.VAT
|
||||
Dim _VAT_Collection As New XPCollection(Of VAT)(_ocur.Session, CriteriaOperator.Parse("1=1"))
|
||||
_StreamWriter.WriteLine("<Services_VAT>")
|
||||
_StreamWriter.WriteLine("<!--afanev - VAT Oid-->")
|
||||
Dim _Index As Integer = 1
|
||||
For Each _VAT As VAT In _VAT_Collection
|
||||
_StreamWriter.WriteLine("<!--" + _VAT.ShortName + "-->")
|
||||
_StreamWriter.WriteLine("<add key=" + _VAT.KeyValuePercent.ToString + " value=" + _VAT.Oid.ToString + "></add>")
|
||||
Next
|
||||
_StreamWriter.WriteLine("</Services_VAT>")
|
||||
End Select
|
||||
_StreamWriter.Close()
|
||||
|
||||
If _ExportOids_PopUp.OpenFileAfterExport Then
|
||||
Process.Start(_FileName)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyCustomersGLParameters_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aSystemTool_CopyCustomersGLParameters.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _SystemTool As SystemTool = TryCast(View.SelectedObjects(0), SystemTool)
|
||||
Dim _CustomersGLParameters_Collection As XPCollection(Of CustomersGLParameters)
|
||||
Dim _Session_From As New Session
|
||||
Dim _Session_To As New Session
|
||||
_Session_From.ConnectionString = GetConnectionString(0, _SystemTool)
|
||||
_Session_To.ConnectionString = GetConnectionString(1, _SystemTool)
|
||||
Try
|
||||
_Session_From.Connect()
|
||||
If _Session_From.IsConnected Then
|
||||
_Session_To.Connect()
|
||||
If _Session_To.IsConnected Then
|
||||
|
||||
Dim _uow_From As New UnitOfWork(_Session_From.DataLayer)
|
||||
Dim _uow_To As New UnitOfWork(_Session_To.DataLayer)
|
||||
_CustomersGLParameters_Collection = New XPCollection(Of CustomersGLParameters)(_uow_From, CriteriaOperator.Parse("1=1"))
|
||||
|
||||
RaiseEvent InitWork(1, 1, _CustomersGLParameters_Collection.Count)
|
||||
For Each _CustomersGLParameters As CustomersGLParameters In _CustomersGLParameters_Collection
|
||||
Dim _CustomersGLParameters_New As New CustomersGLParameters(_uow_To)
|
||||
With _CustomersGLParameters_New
|
||||
.ShortName = _CustomersGLParameters.ShortName
|
||||
.DefaultforBusiness = _CustomersGLParameters.DefaultforBusiness
|
||||
End With
|
||||
_uow_To.CommitChanges()
|
||||
|
||||
Select Case _SystemTool.SQLType_To
|
||||
Case eSQLType.MSSQL
|
||||
_uow_To.ExecuteNonQuery("UPDATE CustomersGLParameters SET Oid='" + _CustomersGLParameters.Oid.ToString + "' WHERE Oid='" + _CustomersGLParameters_New.Oid.ToString + "'")
|
||||
Case eSQLType.MySQL
|
||||
'--==Oid regenerálás==--
|
||||
_uow_To.ExecuteNonQuery("UPDATE CustomersGLParameters SET Oid='" + _CustomersGLParameters.Oid.ToString + "' WHERE Oid='" + _CustomersGLParameters_New.Oid.ToString + "'")
|
||||
'--===================--
|
||||
Case eSQLType.PostgreSQL
|
||||
_uow_To.ExecuteNonQuery("UPDATE ""CustomersGLParameters"" SET ""Oid""='" + _CustomersGLParameters.Oid.ToString + "' WHERE ""Oid""='" + _CustomersGLParameters_New.Oid.ToString + "'")
|
||||
End Select
|
||||
|
||||
RaiseEvent DoWork()
|
||||
Next
|
||||
RaiseEvent FinalWork
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Finally
|
||||
If _Session_From.IsConnected Then _Session_From.Disconnect()
|
||||
If _Session_To.IsConnected Then _Session_To.Disconnect()
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyUnits_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aSystemTool_CopyUnits.Execute
|
||||
'Beep()
|
||||
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyWorkflowSystem_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aSystemTool_CopyWorkflowSystem.CustomizePopupWindowParams
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _SystemTool As SystemTool = TryCast(View.SelectedObjects(0), SystemTool)
|
||||
Dim _Session_From As New Session
|
||||
_Session_From.ConnectionString = GetConnectionString(0, _SystemTool)
|
||||
_Session_From.Connect()
|
||||
If _Session_From.IsConnected Then
|
||||
Dim _CopyWorkflowSystem_CollectionSource As New CollectionSource(_onew, GetType(CopyWorkflowSystem_PopUp))
|
||||
Dim _WorkflowSystem_Collection As New XPCollection(Of WorkflowSystem)(_Session_From)
|
||||
|
||||
If _WorkflowSystem_Collection.Count > 0 Then
|
||||
For Each _WorkflowSystem As WorkflowSystem In _WorkflowSystem_Collection
|
||||
Dim _CopyWorkflowSystem_PopUp As New CopyWorkflowSystem_PopUp(_onew.Session)
|
||||
With _CopyWorkflowSystem_PopUp
|
||||
.NeedToCopy = True
|
||||
.WorkflowSystem = _onew.GetObject(_WorkflowSystem)
|
||||
End With
|
||||
_CopyWorkflowSystem_CollectionSource.Add(_CopyWorkflowSystem_PopUp)
|
||||
Next
|
||||
End If
|
||||
e.View = Application.CreateListView("CopyWorkflowSystem_PopUp_ListView", _CopyWorkflowSystem_CollectionSource, True)
|
||||
_Session_From.Disconnect()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub aSystemTool_CopyWorkflowSystem_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aSystemTool_CopyWorkflowSystem.Execute
|
||||
Try
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _SystemTool As SystemTool = TryCast(View.SelectedObjects(0), SystemTool)
|
||||
Dim _Session_From As New Session
|
||||
Dim _Session_To As New Session
|
||||
_Session_From.ConnectionString = GetConnectionString(0, _SystemTool)
|
||||
_Session_To.ConnectionString = GetConnectionString(1, _SystemTool)
|
||||
|
||||
_Session_From.Connect()
|
||||
If _Session_From.IsConnected Then
|
||||
_Session_To.Connect()
|
||||
If _Session_To.IsConnected Then
|
||||
RaiseEvent InitWork(1, 1, TryCast(e.PopupWindow.View, ListView).CollectionSource.GetCount())
|
||||
Dim _uow_To As New UnitOfWork(_Session_To.DataLayer)
|
||||
|
||||
For Each _CopyWorkflowSystem_PopUp As CopyWorkflowSystem_PopUp In TryCast(e.PopupWindow.View, ListView).CollectionSource.Collection
|
||||
If _CopyWorkflowSystem_PopUp.NeedToCopy Then
|
||||
Dim _WorkflowSystem As New WorkflowSystem(_uow_To)
|
||||
With _WorkflowSystem
|
||||
.CustomersFrom = _uow_To.FindObject(Of CustomersFrom)(CriteriaOperator.Parse("IsDefault=True"))
|
||||
.PartnerType = _CopyWorkflowSystem_PopUp.WorkflowSystem.PartnerType
|
||||
.ShortName = _CopyWorkflowSystem_PopUp.WorkflowSystem.ShortName
|
||||
.Description = _CopyWorkflowSystem_PopUp.WorkflowSystem.Description
|
||||
End With
|
||||
|
||||
For Each _WorkflowSystemSteps As WorkflowSystemSteps In _CopyWorkflowSystem_PopUp.WorkflowSystem.WorkflowSystemSteps
|
||||
Dim _WorkflowSystemSteps_NEW As New WorkflowSystemSteps(_uow_To)
|
||||
With _WorkflowSystemSteps_NEW
|
||||
.WorkflowSystem = _WorkflowSystem
|
||||
.ShortName = _WorkflowSystemSteps.ShortName
|
||||
.StepIndex = _WorkflowSystemSteps.StepIndex
|
||||
.TaskDescription = _WorkflowSystemSteps.TaskDescription
|
||||
.ExpirationDayofFailure = _WorkflowSystemSteps.ExpirationDayofFailure
|
||||
.ActionOnSuccess = _WorkflowSystemSteps.ActionOnSuccess
|
||||
.ActionOnFailure = _WorkflowSystemSteps.ActionOnFailure
|
||||
.IsLastStep = _WorkflowSystemSteps.IsLastStep
|
||||
.IsReadyForImport = _WorkflowSystemSteps.IsReadyForImport
|
||||
.StepFinancialType = _WorkflowSystemSteps.StepFinancialType
|
||||
End With
|
||||
Next
|
||||
_uow_To.CommitChanges()
|
||||
RaiseEvent DoWork()
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
Finally
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
End Sub
|
||||
Private Function IsExistChartOfAccounts(_AccountNumberIn As String, _ChartOfAccounts_CollectionIn As XPCollection(Of ChartOfAccounts)) As Boolean
|
||||
Dim _Result As Boolean = False
|
||||
For Each _ChartOfAccounts As ChartOfAccounts In _ChartOfAccounts_CollectionIn
|
||||
If _ChartOfAccounts.AccountNumber = _AccountNumberIn Then
|
||||
_Result = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Return _Result
|
||||
End Function
|
||||
|
||||
End Class
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
USE [PH20110829]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[Feladattakaritas5] Script Date: 09/09/2011 12:43:10 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].[Feladattakaritas5] AS
|
||||
-- Add the parameters for the stored procedure here
|
||||
declare @RegistryHeader varchar(250), @Count int, @RegistryTask varchar(250), @Edit int
|
||||
-- SET NOCOUNT ON added to prevent extra result sets from
|
||||
-- interfering with SELECT statements.
|
||||
SET NOCOUNT ON;
|
||||
|
||||
declare cRegistryHeader cursor for select t1.RegistryHeader, Count(RegistryHeader) from RegistryTasks as t1 join
|
||||
Task as t2 on t1.Oid=t2.Oid where t2.GCRecord is null and t2.Status='0' group by RegistryHeader having COUNT(RegistryHeader) >1
|
||||
open cRegistryHeader
|
||||
|
||||
fetch next from cRegistryHeader
|
||||
into @RegistryHeader, @Count
|
||||
begin transaction
|
||||
while @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
set @edit = 0
|
||||
declare cRegistryTasks cursor for select t1.oid from RegistryTasks as t1 join Task as t2 on t1.oid=t2.oid where t1.registryheader = @registryheader and t2.gcrecord is null and t2.status='0' order by t2.startdate desc
|
||||
open cRegistryTasks
|
||||
fetch next from cRegistryTasks into @RegistryTask
|
||||
while @@FETCH_STATUS =0
|
||||
begin
|
||||
|
||||
if @Edit=1
|
||||
update Task set gcrecord='11' where Oid = @RegistryTask
|
||||
|
||||
else
|
||||
set @edit = 1
|
||||
fetch next from cRegistryTasks into @RegistryTask
|
||||
end
|
||||
|
||||
close cRegistryTasks
|
||||
deallocate cRegistryTasks
|
||||
|
||||
fetch next from cRegistryHeader into @RegistryHeader, @Count
|
||||
END
|
||||
commit transaction
|
||||
close cRegistryHeader
|
||||
deallocate cRegistryHeader
|
||||
|
||||
GO
|
||||
|
||||
Reference in New Issue
Block a user