div. Änderngen (Barverkauf, ustva, etc.).
This commit is contained in:
@@ -81,24 +81,40 @@ Public Class cMSEAPI
|
||||
End Function
|
||||
|
||||
Public Shared Function countBackToCustomerNotSet(SQL As SQL) As Integer
|
||||
Return SQL.getValueTxtBySql("SELECT count(InvToCustomer) FROM [tblMSEInvoices] where InvToCustomer Is null ", "FMZOLL",,, -1)
|
||||
Return SQL.getValueTxtBySql("SELECT count(*) FROM [tblMSEInvoices] where InvToCustomer Is null ", "FMZOLL",,, -1)
|
||||
End Function
|
||||
|
||||
Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing) As DataTable
|
||||
Public Shared Function countBackToCustomerNotSet(SQL As SQL, AdressenNrVon As Integer, AdressenNrBis As Integer) As Integer
|
||||
Return SQL.getValueTxtBySql("SELECT count(*) FROM [tblMSEInvoices] inner join [tblMSECustomers] On [customer_number] = [customer_id] INNER JOIN Adressen On Adressen.MSEKundenNr = [customer_number] where InvToCustomer Is null AND Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis, "FMZOLL",,, -1)
|
||||
End Function
|
||||
|
||||
Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing, Optional dt As DataTable = Nothing, Optional AdressenNrVon As Integer = -1, Optional AdressenNrBis As Integer = -1) As Integer
|
||||
Try
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
|
||||
Dim sqlTime As String = ""
|
||||
Dim sqlAdressenNr As String = ""
|
||||
|
||||
If IsDate(reDatVon) AndAlso CDate(reDatVon) > "01.01.2020" AndAlso IsDate(reDatBis) AndAlso CDate(reDatBis) > "01.01.2020" Then
|
||||
sqlTime = " And cast(invoice_date As Date) between '" & reDatVon.ToShortDateString & "' and '" & reDatBis.ToShortDateString & "'"
|
||||
End If
|
||||
|
||||
Dim SQLstr = "Select invoice_id As RechnungsNr,[invoice_date] As Rechnungsdatum, Adressen.AdressenNr As KundenNr,Adressen.[Name 1] As Kunde, kde_keineMWSt As keineMWST from tblMSEInvoices inner join [tblMSECustomers] On [customer_number] = [customer_id] INNER JOIN Adressen On Adressen.MSEKundenNr = [customer_number] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where daId Is null " & sqlTime & " group by invoice_id, Adressen.AdressenNr, Adressen.[Name 1], invoice_date, kde_keineMWSt"
|
||||
If AdressenNrVon > 0 AndAlso AdressenNrBis > 0 Then
|
||||
sqlAdressenNr = " AND Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis
|
||||
End If
|
||||
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
Dim SQLstr = "Select invoice_id As RechnungsNr,[invoice_date] As Rechnungsdatum, Adressen.AdressenNr As KundenNr,Adressen.[Name 1] As Kunde, kde_keineMWSt As keineMWST from tblMSEInvoices inner join [tblMSECustomers] On [customer_number] = [customer_id] INNER JOIN Adressen On Adressen.MSEKundenNr = [customer_number] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where daId Is null " & sqlTime & sqlAdressenNr & " group by invoice_id, Adressen.AdressenNr, Adressen.[Name 1], invoice_date, kde_keineMWSt"
|
||||
dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL")
|
||||
Return dt.Rows.Count
|
||||
Else
|
||||
Dim SQLstr = "Select count(*) from tblMSEInvoices inner join [tblMSECustomers] On [customer_number] = [customer_id] INNER JOIN Adressen On Adressen.MSEKundenNr = [customer_number] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where daId Is null " & sqlTime & sqlAdressenNr
|
||||
Return SQL.getValueTxtBySql(SQLstr, "FMZOLL",,, 0)
|
||||
End If
|
||||
|
||||
|
||||
Dim dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL")
|
||||
|
||||
Return dt
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user