diff --git a/SDL/mdm/usrcntlFremdrechnungen.vb b/SDL/mdm/usrcntlFremdrechnungen.vb index 94318945..9f626a9e 100644 --- a/SDL/mdm/usrcntlFremdrechnungen.vb +++ b/SDL/mdm/usrcntlFremdrechnungen.vb @@ -246,7 +246,7 @@ Public Class usrcntlFremdrechnungen --MSE - SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'MSE' as Lieferant,-1 as invoice_id, [invoice_date] as Rechnungsdatum, cast([invoice_id] as nvarchar) as Rechnungsnummer,[customer_number] as Kundennummer, [total_amount_euro] as Bruttobetrag ,(total_amount_euro - [total_vat_amount_euro]) as Nettobetrag ,[total_vat_amount_euro] as MWST,[country] as Land,'RE' as Art,daId, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblMSEInvoices where customer_number = (select top 1 customer_id from tblMSECustomers where 1 = 1 " & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere("MSE", "country") & " ) order by invoice_date, invoice_id + SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'MSE' as Lieferant,-1 as invoice_id, [invoice_date] as Rechnungsdatum, cast([invoice_id] as nvarchar) as Rechnungsnummer,[customer_number] as Kundennummer, [total_amount_euro] as Bruttobetrag ,(total_amount_euro - [total_vat_amount_euro]) as Nettobetrag ,[total_vat_amount_euro] as MWST,[country] as Land,'RE' as Art,daId, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblMSEInvoices inner join tblMSECustomers on customer_id = [customer_number] where 1 = 1 " & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere("MSE", "country") & " order by invoice_date, invoice_id UNION ALL