diff --git a/SDL/USTV/frmMDM_USTVAntrag.vb b/SDL/USTV/frmMDM_USTVAntrag.vb index 816b24c7..5764f73e 100644 --- a/SDL/USTV/frmMDM_USTVAntrag.vb +++ b/SDL/USTV/frmMDM_USTVAntrag.vb @@ -1593,7 +1593,7 @@ Public Class frmMDM_USTVAntrag Select Case If(SchnittstellenNr, -1) Case 1 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) RK_ID FROM Rechnungsausgang where cast(Rechnungsausgang.RechnungsDatum as Date) ='" & reDat & "' and Rechnungsausgang.RechnungsNr='" & reNr & "' AND FilialenNr = 4814 AND RK_ID is not null", "FMZOLL",,, -1) 'Case 6, 0 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [plInv_daId] FROM [tblPLOSE_Inv_Data] where plInv_SupplierRechnungsDatum='" & reDat & "' and isnull(plose_RechnungsNr,plInv_SupplierRechnungsNr)='" & reNr & "' and plInv_SupplierCountry='" & Antrag_LandKz & "' AND [plInv_daId] is not null", "FMZOLL",,, -1) - Case 6, 0 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [plInv_daId] FROM [tblPLOSE_Inv_Data] where plInv_SupplierRechnungsDatum='" & reDat & "' and isnull(plose_RechnungsNr,plInv_SupplierRechnungsNr)='" & reNr & "' and plInv_SupplierCountry='" & Antrag_LandKz & "' AND [plInv_daId] is not null", "FMZOLL",,, -1) + Case 6, 0 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [plInv_daId] FROM [tblPLOSE_Inv_Data] where plInv_SupplierRechnungsDatum='" & reDat & "' and plInv_SupplierRechnungsNr='" & reNr & "' and plInv_SupplierCountry='" & Antrag_LandKz & "' AND [plInv_daId] is not null", "FMZOLL",,, -1) Case 4, 9 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblMSEInvoices] as inv inner join tblMSECustomers on inv.customer_number = customer_id where invoice_date='" & reDat & "' and country='" & Antrag_LandKz & "' AND partner_customer_number = " & USTV_ANTRAG.UStVAn_KuNr & " AND daId is not null", "FMZOLL",,, -1) Case 10 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblUTAImportNew] where Rechnungsdatum='" & reDat & "' and Abrechnungsnummer='" & reNr & "' and Lieferland_ISO2='" & Antrag_LandKz & "' AND daId is not null", "FMZOLL",,, -1) Case 7 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [rmc_daId] FROM [tblRMCImport] where rmc_reDatum='" & reDat & "' and rmc_reNr='" & reNr & "' and rmc_landKZ='" & Antrag_LandKz & "' AND [rmc_daId] is not null", "FMZOLL",,, -1) diff --git a/SDL/USTV/frmUSTVoffeneAntraege.vb b/SDL/USTV/frmUSTVoffeneAntraege.vb index 64958b4b..ba388037 100644 --- a/SDL/USTV/frmUSTVoffeneAntraege.vb +++ b/SDL/USTV/frmUSTVoffeneAntraege.vb @@ -415,7 +415,7 @@ End With tblTrdinInvoice.SteuerbetragLokal FROM tblTrdinInvoice inner join Adressen on Adressen.AdressenNr = tblTrdinInvoice.RechnungsKundenNr - WHERE tblTrdinInvoice.Rechnungsdatum Between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' AND tblTrdinInvoice.SteuerbetragLokal<>0 AND tblTrdinInvoice.UStVAn_ID is null AND tblTrdinInvoice.WährungLokal='EUR' " & sqlwhere & " + WHERE tblTrdinInvoice.Rechnungsdatum Between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' AND tblTrdinInvoice.SteuerbetragLokal<>0 AND tblTrdinInvoice.UStVAn_ID is null And Firma_ID = 19 AND tblTrdinInvoice.WährungLokal='EUR' " & sqlwhere & " ORDER BY tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer" .SET_SQL(sqlstring, "FMZOLL") .LOAD() @@ -562,7 +562,7 @@ End With sum(tblTrdinInvoice.SteuerbetragLokal) as MWSt FROM [tblTrdinInvoice] inner join Adressen on Adressen.AdressenNr = tblTrdinInvoice.RechnungsKundenNr - where tblTrdinInvoice.Rechnungsdatum Between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' AND tblTrdinInvoice.UStVAn_ID is null + where tblTrdinInvoice.Rechnungsdatum Between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' AND tblTrdinInvoice.UStVAn_ID is null And Firma_ID = 19 " & sqlwhereVERAG & "group by Adressen.AdressenNr, tblTrdinInvoice.RechnungsKundenNr,Adressen.[Name 1],Adressen.LandKz ,[Rechnungsdatum] having sum(tblTrdinInvoice.SteuerbetragLokal) <> 0 UNION ALL