Code:
Public Function GenerateQRPayment(intDocumentType As Integer, intDocumentID As Integer) As String
Dim strDocumentNo, strCurrencyCode, strCreatedDate, strTaxDate, strDueDate, strCustomerReference, strVSymbol As String
Dim strCustomerICO, strCustomerVAT1, strAmountToPay, strSubTotal, strVATAmount As String
Dim intCompanyAccountID As Integer
Dim strURL As String
strURL = "https://api.qrfgen.cz/generator/image?"
Select Case intDocumentType
Case 1 ' Faktura vydaná (daňový doklad)
If IsNull(DLookup("InvoiceID", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID)) Then
GenerateQRPayment = ""
Exit Function
End If
strDocumentNo = DLookup("InvoiceNo", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID)
strCurrencyCode = DLookup("CurrencyCode", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID)
strCreatedDate = Format(DLookup("InvoiceCreatedDate", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID), "yyyymmdd")
strTaxDate = Format(DLookup("InvoiceTaxDate", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID), "yyyymmdd")
strDueDate = Format(DLookup("InvoiceDueDate", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID), "yyyymmdd")
strCustomerReference = DLookup("CustomerReference", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID)
strVSymbol = DLookup("VSymbol", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID)
strCustomerICO = DLookup("CustomerICO", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID)
strCustomerVAT1 = DLookup("CustomerVAT1", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID)
strAmountToPay = Replace(Format(DLookup("TotalToPay", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID), "0.00"), ",", ".")
strSubTotal = Replace(Format(DLookup("SubTotal", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID), "0.00"), ",", ".")
strVATAmount = Replace(Format(DLookup("VATAmount", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID), "0.00"), ",", ".")
intCompanyAccountID = DLookup("BillToAccountID", "v_InvoicesReceivable", "InvoiceID=" & intDocumentID)
' dodělat vyúčtování záloh (SA)
strURL = strURL & _
"ID=" & strDocumentNo & "&" & _
"CC=" & strCurrencyCode & "&" & _
"DD=" & strCreatedDate & "&" & _
"DUZP=" & strTaxDate & "&" & _
"DT=" & strDueDate & "&" & _
"INI=" & DLookup("InfoValue", "v_CompanyInfo", "Infoname='CompanyICO'") & "&" & _
"VII=" & DLookup("InfoValue", "v_CompanyInfo", "Infoname='CompanyVAT'") & "&" & _
"INR=" & strCustomerICO & "&" & _
"VIR=" & strCustomerVAT1 & "&" & _
"TP=0&" & _
"TD=9&" & _
"SA=0&" & _
"VS=" & strVSymbol & "&" & _
"AM=" & strAmountToPay & "&" & _
"TB0=" & strSubTotal & "&" & _
"T0=" & strVATAmount & "&" & _
"ACC=" & DLookup("IBANCode", "v_CompanyAccounts", "CompanyAccountID=" & intCompanyAccountID) & "&" & _
"qrplatba=1"
End Select
GenerateQRPayment = strURL
End Function
With this, I am able to generate the correct URL for every invoice in my system. But the problem is assigning this URL to the web browser control.