Global PrintSankOK As Boolean
Global PrintKujnaOK As Boolean
Global PrintKujna2OK As Boolean
Global PrintNarackaOK As Boolean
Global PrintSmetkaOK As Boolean
Global LevMargin As Integer
Function PrintSank(SmetkaBroj As Long) 'ne se koristi
On Error GoTo PosError
PrintSankOK = False
Dim rs As ADODB.Recordset
Dim txt As String
Dim Naziv As String
Dim Danok As String
Dim Cena As String
Dim DDV As String
Dim Kolicina As String
Dim Rb As Integer
Dim SQLSmetkaStavki As String
SQLSmetkaStavki = "SELECT tblArtikli_Prodazba.Naziv, tblSmetki_Markirajne.Kolicina" _
& " FROM tblArtikli_Prodazba INNER JOIN tblSmetki_Markirajne ON tblArtikli_Prodazba.ID_ArtikalP = tblSmetki_Markirajne.Stavka" _
& " WHERE (((tblArtikli_Prodazba.Kujna_Sank)=1) AND ((tblSmetki_Markirajne.Smetka_Br)=" & SmetkaBroj & "));"
Set rs = New ADODB.Recordset
rs.Open SQLSmetkaStavki, cn, adOpenStatic, adLockOptimistic
If rs.RecordCount <= 0 Then
' MsgBox "Бројот на ставките во нарачката за шанк е помал или енаков на 0! ВадеЕ“ето на нарачка не е дозволено "
PrintSankOK = True
Exit Function
End If
'**************************************************************************
' If SelectPrinter(ReadIniValue(App.Path & "\Setup.ini", "Printeri", "Sank")) = True Then
' Call MsgBox("PRINTER NOT FOUND ", vbOKOnly + vbExclamation + vbApplicationModal + vbDefaultButton1, "")
' Exit Function
' End If
'**************************************************************************
' With Printer.Font
' .Name = "Times New Roman"
' .Size = ReadIniValue(App.Path & "\Setup.ini", "SmetkaSetup", "SizeFont")
' End With
Set rptNaracka_Sank.DataSource = rs
rptNaracka_Sank.LeftMargin = 10
rptNaracka_Sank.TopMargin = 10
rptNaracka_Sank.Sections("section4").Controls.Item("txtData").Caption = Format(Date, "dd.mm.yyyy")
rptNaracka_Sank.Sections("section4").Controls.Item("txtCas").Caption = Format(Time, "hh:mm:ss")
rptNaracka_Sank.Sections("section4").Controls.Item("txtKelner").Caption = DLookup("Vraboten_Ime", "tblVraboteni", "ID_Vraboten=" & DLookup("Vraboten", "tblSmetki", "ID_Smetka=" & SmetkaBroj))
rptNaracka_Sank.Sections("section4").Controls.Item("txtMasa").Caption = DLookup("Masa", "tblMasi", "ID_Masa=" & DLookup("Masa", "tblSmetki", "ID_Smetka=" & SmetkaBroj))
rptNaracka_Sank.Sections("section4").Controls.Item("txtSmetkaBroj").Caption = Format(DLookup("Smetka_Broj", "tblSmetki", "ID_Smetka=" & SmetkaBroj), "0000000")
'rptNaracka_Sank.WindowState = 2
'rptNaracka_Sank.Show vbModal
rptNaracka_Sank.PrintReport
' Rb = 0
PrintSankOK = True
PosError:
If Error <> "" Then
' If Err = 482 Then Call PrinterGreska
On Error Resume Next
PrintSankOK = False
Exit Function
End If
End Function
Function PrintKujna(SmetkaBroj As Long)
On Error GoTo PosError
PrintKujnaOK = False
Dim rs As ADODB.Recordset
Dim txt As String
Dim Naziv As String
Dim Danok As String
Dim Cena As String
Dim DDV As String
Dim Kolicina As String
Dim Rb As Integer
Dim Prio As Boolean
Dim PrioPrint As Boolean
Prio = True
PrioPrint = False
Dim SQLSmetkaStavki As String
SQLSmetkaStavki = "SELECT tblArtikli_Prodazba.Naziv, tblSmetki_Markirajne.Kolicina" _
& " FROM tblArtikli_Prodazba INNER JOIN tblSmetki_Markirajne ON tblArtikli_Prodazba.ID_ArtikalP = tblSmetki_Markirajne.Stavka" _
& " WHERE (((tblArtikli_Prodazba.Kujna_Sank)=2) AND ((tblSmetki_Markirajne.Smetka_Br)=" & SmetkaBroj & "));"
Set rs = New ADODB.Recordset
rs.Open SQLSmetkaStavki, cn, adOpenStatic, adLockOptimistic
If rs.RecordCount <= 0 Then
' MsgBox "Бројот на ставките во нарачката за шанк е помал или енаков на 0! ВадеЕ“ето на нарачка не е дозволено "
PrintKujnaOK = True
Exit Function
End If
'**************************************************************************
' If SelectPrinter(ReadIniValue(App.Path & "\Setup.ini", "Printeri", "Kujna")) = True Then
' Call MsgBox("PRINTER NOT FOUND ", vbOKOnly + vbExclamation + vbApplicationModal + vbDefaultButton1, "")
' Exit Function
' End If
'**************************************************************************
' With Printer.Font
' .Name = "Times New Roman"
' .Size = ReadIniValue(App.Path & "\Setup.ini", "SmetkaSetup", "SizeFont") + 1
' End With
Set rptNaracka_Kujna.DataSource = rs
rptNaracka_Kujna.LeftMargin = 10
rptNaracka_Kujna.TopMargin = 10
rptNaracka_Kujna.Sections("section4").Controls.Item("txtData").Caption = Format(Date, "dd.mm.yyyy")
rptNaracka_Kujna.Sections("section4").Controls.Item("txtCas").Caption = Format(Time, "hh:mm:ss")
rptNaracka_Kujna.Sections("section4").Controls.Item("txtKelner").Caption = DLookup("Vraboten_Ime", "tblVraboteni", "ID_Vraboten=" & DLookup("Vraboten", "tblSmetki", "ID_Smetka=" & SmetkaBroj))
rptNaracka_Kujna.Sections("section4").Controls.Item("txtMasa").Caption = DLookup("Masa", "tblMasi", "ID_Masa=" & DLookup("Masa", "tblSmetki", "ID_Smetka=" & SmetkaBroj))
rptNaracka_Kujna.Sections("section4").Controls.Item("txtSmetkaBroj").Caption = Format(DLookup("Smetka_Broj", "tblSmetki", "ID_Smetka=" & SmetkaBroj), "0000000")
'rptNaracka_Kujna.WindowState = 2
'rptNaracka_Kujna.Show vbModal
rptNaracka_Kujna.PrintReport
If Vnimanie = True Then rptNaracka_Kujna.Sections("section5").Controls.Item("labVnimanie").Caption = "POZOR PIZZA"
PrintKujnaOK = True
PosError:
If Error <> "" Then
' If Err = 482 Then Call PrinterGreska
On Error Resume Next
PrintKujnaOK = False
Exit Function
End If
End Function