div. Änderungen, etc.
This commit is contained in:
@@ -475,6 +475,13 @@ Public Class cRechnungsausgang
|
||||
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
|
||||
End Function
|
||||
|
||||
Public Function SAVE_AUTOMAIL() As Boolean
|
||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||
|
||||
Dim sqlstr = " UPDATE Rechnungsausgang SET Automailversand_sent=getDate() WHERE RK_ID=@RK_ID "
|
||||
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
|
||||
End Function
|
||||
|
||||
Public Function SAVE_DsId(DsId) As Boolean
|
||||
Me.dsId = DsId
|
||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||
|
||||
@@ -433,7 +433,7 @@ Public Class cSMS
|
||||
End Function
|
||||
|
||||
|
||||
Function sendWhatsAppTemplate(Originator As String, template_ParamMFGAdditional As String) As Boolean
|
||||
Function sendWhatsAppTemplate(Originator As String, template_ParamMFGAdditional As String, useNewTemplates As Boolean, Message As String) As Boolean
|
||||
Try
|
||||
VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat()
|
||||
Dim API_STRING = "https://connect.esendex.com"
|
||||
@@ -454,22 +454,21 @@ Public Class cSMS
|
||||
|
||||
rest.AddHeader("Content-Type", "application/json")
|
||||
rest.AddHeader("Authorization", API_USER_AUTHORIZATION)
|
||||
'rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json")
|
||||
|
||||
'Dim sbRequestBody As New Chilkat.StringBuilder
|
||||
'json.EmitSb(sbRequestBody)
|
||||
Me.sms_art = "WHATSAPP"
|
||||
|
||||
|
||||
Dim mfg = ""
|
||||
Dim location = ""
|
||||
Dim Company = ""
|
||||
|
||||
Select Case Originator
|
||||
Case "FRONTOFFICE"
|
||||
mfg = "VERAG - UNISPED - IMEX"
|
||||
Company = Originator
|
||||
location = Originator
|
||||
Case Else
|
||||
location = Originator
|
||||
Company = Originator
|
||||
End Select
|
||||
If template_ParamMFGAdditional <> "" Then
|
||||
mfg = template_ParamMFGAdditional & " " & mfg
|
||||
@@ -486,10 +485,36 @@ Public Class cSMS
|
||||
|
||||
'---------------------------------------------
|
||||
Me.sms_Account = "EX0341154" 'WHATSAPP Account
|
||||
' Dim TemplateId = "e5c1ce77-31a0-4663-9576-be340f73ac1c"
|
||||
Dim successJsonLoad As Boolean
|
||||
|
||||
If useNewTemplates Then
|
||||
|
||||
successJsonLoad = json.Load("
|
||||
{
|
||||
""accountReference"": """ & Me.sms_Account & """,
|
||||
""channels"": [
|
||||
""WHATSAPP""
|
||||
],
|
||||
""metadata"":{
|
||||
""key"": ""value""
|
||||
},
|
||||
""recipient"": {
|
||||
""variables"": {
|
||||
""Company"": """ & Company & """,
|
||||
""Message"": """ & Message & """
|
||||
},
|
||||
""address"": {
|
||||
""msisdn"": """ & HandyNr & """
|
||||
}
|
||||
},
|
||||
""content"": {
|
||||
""templateId"": """ & Me.sms_templateID & """
|
||||
}
|
||||
}")
|
||||
|
||||
|
||||
Dim successJsonLoad As Boolean = json.Load("
|
||||
Else
|
||||
successJsonLoad = json.Load("
|
||||
{
|
||||
""accountReference"": """ & Me.sms_Account & """,
|
||||
""channels"": [
|
||||
@@ -512,6 +537,7 @@ Public Class cSMS
|
||||
}
|
||||
}")
|
||||
|
||||
End If
|
||||
|
||||
If (successJsonLoad <> True) Then
|
||||
' MsgBox(json.LastErrorText)
|
||||
@@ -559,50 +585,6 @@ Public Class cSMS
|
||||
MsgBox("Fehler: WHATSAPP Daten wurden nicht gespeichert!")
|
||||
End If
|
||||
|
||||
|
||||
Return True
|
||||
'productTitle = json.StringOf("product.title");
|
||||
'productBody_html = json.StringOf("product.body_html");
|
||||
'productVendor = json.StringOf("product.vendor");
|
||||
'productProduct_type = json.StringOf("product.product_type");
|
||||
'productCreated_at = json.StringOf("product.created_at");
|
||||
'productHandle = json.StringOf("product.handle");
|
||||
'productUpdated_at = json.StringOf("product.updated_at");
|
||||
'productPublished_at = json.IsNullOf("product.published_at");
|
||||
'productTemplate_suffix = json.IsNullOf("product.template_suffix");
|
||||
'productPublished_scope = json.StringOf("product.published_scope");
|
||||
'productTags = json.StringOf("product.tags");
|
||||
'productImage = json.IsNullOf("product.image");
|
||||
'i = 0;
|
||||
'count_i = json.SizeOfArray("product.variants");
|
||||
'while (i < count_i) {
|
||||
' json.I = i;
|
||||
' id = json.IntOf("product.variants[i].id");
|
||||
' product_id = json.IntOf("product.variants[i].product_id");
|
||||
' title = json.StringOf("product.variants[i].title");
|
||||
' price = json.StringOf("product.variants[i].price");
|
||||
' sku = json.StringOf("product.variants[i].sku");
|
||||
' position = json.IntOf("product.variants[i].position");
|
||||
' grams = json.IntOf("product.variants[i].grams");
|
||||
' inventory_policy = json.StringOf("product.variants[i].inventory_policy");
|
||||
' compare_at_price = json.IsNullOf("product.variants[i].compare_at_price");
|
||||
' fulfillment_service = json.StringOf("product.variants[i].fulfillment_service");
|
||||
' inventory_management = json.IsNullOf("product.variants[i].inventory_management");
|
||||
' option1 = json.StringOf("product.variants[i].option1");
|
||||
' option2 = json.IsNullOf("product.variants[i].option2");
|
||||
' option3 = json.IsNullOf("product.variants[i].option3");
|
||||
' created_at = json.StringOf("product.variants[i].created_at");
|
||||
' updated_at = json.StringOf("product.variants[i].updated_at");
|
||||
' taxable = json.BoolOf("product.variants[i].taxable");
|
||||
' barcode = json.IsNullOf("product.variants[i].barcode");
|
||||
' image_id = json.IsNullOf("product.variants[i].image_id");
|
||||
' inventory_quantity = json.IntOf("product.variants[i].inventory_quantity");
|
||||
' weight = json.IntOf("product.variants[i].weight");
|
||||
' weight_unit = json.StringOf("product.variants[i].weight_unit");
|
||||
' old_inventory_quantity = json.IntOf("product.variants[i].old_inventory_quantity");
|
||||
' requires_shipping = json.BoolOf("product.variants[i].requires_shipping");
|
||||
' i = i + 1;
|
||||
'}
|
||||
Return True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user