ncts fremd api
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Xml
|
Imports System.Xml
|
||||||
Imports com.sun.corba.se.spi.orb
|
Imports com.sun.corba.se.spi.orb
|
||||||
|
Imports java.lang
|
||||||
Imports Newtonsoft.Json
|
Imports Newtonsoft.Json
|
||||||
Imports VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_declarations_ApiResponseHandler
|
Imports VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_declarations_ApiResponseHandler
|
||||||
|
|
||||||
@@ -9,7 +10,7 @@ Public Class cATEZ_ncts_api
|
|||||||
|
|
||||||
Shared API_KEY = "2a6fe6bf-6547-4d56-b14a-8a18f94f9e94"
|
Shared API_KEY = "2a6fe6bf-6547-4d56-b14a-8a18f94f9e94"
|
||||||
|
|
||||||
Public Shared Sub query_declarations(startDate As Date, endDate As Date)
|
Public Shared Sub query_declarations(startDate As Date, endDate As Date, Optional OverrideNCTSFin As Boolean = False)
|
||||||
Try
|
Try
|
||||||
' This example assumes the Chilkat API to have been previously unlocked.
|
' This example assumes the Chilkat API to have been previously unlocked.
|
||||||
' See Global Unlock Sample for sample code.
|
' See Global Unlock Sample for sample code.
|
||||||
@@ -53,87 +54,93 @@ Public Class cATEZ_ncts_api
|
|||||||
NCTS_FREMD.ncts_Partnersystem = "ATEZ"
|
NCTS_FREMD.ncts_Partnersystem = "ATEZ"
|
||||||
NCTS_FREMD.ncts_MRN = NCTS_TMP.Mrn
|
NCTS_FREMD.ncts_MRN = NCTS_TMP.Mrn
|
||||||
|
|
||||||
|
If NCTS_FREMD.ncts_Status = 60 And OverrideNCTSFin = False Then
|
||||||
NCTS_FREMD.ncts_Eroeffnung = NCTS_TMP.MrnDate
|
'Wenn NCTS beretis Erledigt und kein Flag fürs überschreiben, mach nix....
|
||||||
|
Else
|
||||||
If NCTS_TMP.MrnDate IsNot Nothing Then
|
|
||||||
If If(NCTS_FREMD.ncts_LimitDate, "").ToString = "" Then NCTS_FREMD.ncts_LimitDate = CDate(NCTS_TMP.MrnDate).AddDays(10)
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
'RELEASED
|
NCTS_FREMD.ncts_Eroeffnung = NCTS_TMP.MrnDate
|
||||||
'IN_USE
|
|
||||||
If NCTS_TMP.GuaranteeUsageStatus IsNot Nothing Then
|
|
||||||
Select Case NCTS_TMP.GuaranteeUsageStatus
|
|
||||||
Case "IN_USE"
|
|
||||||
NCTS_FREMD.ncts_Eroeffnung = NCTS_TMP.MrnDate
|
|
||||||
NCTS_FREMD.ncts_Status = 50
|
|
||||||
Case "RELEASED"
|
|
||||||
NCTS_FREMD.ncts_Eroeffnung = NCTS_TMP.MrnDate
|
|
||||||
If If(NCTS_FREMD.ncts_Ankunft, "").ToString = "" Then NCTS_FREMD.ncts_Ankunft = NCTS_TMP.MrnDate
|
|
||||||
If If(NCTS_FREMD.ncts_Erledigung, "").ToString = "" Then NCTS_FREMD.ncts_Erledigung = NCTS_TMP.MrnDate
|
|
||||||
NCTS_FREMD.ncts_Status = 60
|
|
||||||
End Select
|
|
||||||
End If
|
|
||||||
|
|
||||||
'WRT_NOT
|
If NCTS_TMP.MrnDate IsNot Nothing Then
|
||||||
'MRN_NOTIFIED
|
If If(NCTS_FREMD.ncts_LimitDate, "").ToString = "" Then NCTS_FREMD.ncts_LimitDate = CDate(NCTS_TMP.MrnDate).AddDays(10)
|
||||||
'GUAINF
|
|
||||||
'CTR_DEC
|
|
||||||
'CTRINFDEP
|
|
||||||
'MRN_ALL
|
|
||||||
'REL_TRA
|
|
||||||
'TRANSIT_CLOSE
|
|
||||||
'ARR_ADV
|
|
||||||
If NCTS_TMP.Status IsNot Nothing Then
|
|
||||||
Select Case NCTS_TMP.Status
|
|
||||||
Case "ARR_ADV"
|
|
||||||
If If(NCTS_FREMD.ncts_Ankunft, "").ToString = "" Then NCTS_FREMD.ncts_Ankunft = NCTS_TMP.MrnDate
|
|
||||||
NCTS_FREMD.ncts_Status = 53
|
|
||||||
Case "TRANSIT_CLOSE"
|
|
||||||
If If(NCTS_FREMD.ncts_Ankunft, "").ToString = "" Then NCTS_FREMD.ncts_Ankunft = NCTS_TMP.MrnDate
|
|
||||||
If If(NCTS_FREMD.ncts_Erledigung, "").ToString = "" Then NCTS_FREMD.ncts_Erledigung = NCTS_TMP.MrnDate
|
|
||||||
NCTS_FREMD.ncts_Status = 60
|
|
||||||
End Select
|
|
||||||
End If
|
|
||||||
|
|
||||||
NCTS_FREMD.ncts_Status_KEWILL_Equivalent = NCTS_FREMD.ncts_Status
|
|
||||||
NCTS_FREMD.ncts_ObjectName = NCTS_TMP.Lrn
|
|
||||||
NCTS_FREMD.ncts_ActiveBorderTransportMeans_1_IdentificationNumber = NCTS_TMP.Trailer
|
|
||||||
|
|
||||||
|
|
||||||
NCTS_FREMD.LOAD_Guarantee()
|
|
||||||
|
|
||||||
NCTS_FREMD.ncts_GUARANTEE.Clear()
|
|
||||||
|
|
||||||
|
|
||||||
If NCTS_TMP.GuaranteeAmount > 0 AndAlso NCTS_TMP.Grn IsNot Nothing Then
|
|
||||||
|
|
||||||
Dim GRT = New cNCTS_FREMD_Guarantee
|
|
||||||
GRT.nctsGRT_Type = Nothing
|
|
||||||
|
|
||||||
GRT.nctsGRT_AccessCode = Nothing
|
|
||||||
GRT.nctsGRT_GRN = NCTS_TMP.Grn
|
|
||||||
GRT.nctsGRT_AmountToBeCoveredFremdWaehrung = NCTS_TMP.GuaranteeAmount
|
|
||||||
GRT.nctsGRT_Currency = NCTS_TMP.GuaranteeAmountCurrency
|
|
||||||
|
|
||||||
' MsgBox(If(GRT.nctsGRT_Currency, ""))
|
|
||||||
'--> EUR
|
|
||||||
If GRT.nctsGRT_AmountToBeCoveredFremdWaehrung IsNot Nothing Then
|
|
||||||
If If(GRT.nctsGRT_Currency, "") <> "EUR" Then
|
|
||||||
Dim betragEUR = VERAG_PROG_ALLGEMEIN.cEZB_Waehrungskurse.EXCHANGE_CURTOEUR(GRT.nctsGRT_AmountToBeCoveredFremdWaehrung, GRT.nctsGRT_Currency, NCTS_FREMD.ncts_Trans_DatumZeit.ToShortDateString)
|
|
||||||
GRT.nctsGRT_AmountToBeCovered = If(betragEUR > 0, betragEUR, GRT.nctsGRT_AmountToBeCoveredFremdWaehrung)
|
|
||||||
Else
|
|
||||||
GRT.nctsGRT_AmountToBeCovered = GRT.nctsGRT_AmountToBeCoveredFremdWaehrung
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
NCTS_FREMD.ncts_GUARANTEE.Clear()
|
'RELEASED
|
||||||
NCTS_FREMD.ncts_GUARANTEE.Add(GRT)
|
'IN_USE
|
||||||
End If
|
If NCTS_TMP.GuaranteeUsageStatus IsNot Nothing Then
|
||||||
|
Select Case NCTS_TMP.GuaranteeUsageStatus
|
||||||
|
Case "IN_USE"
|
||||||
|
NCTS_FREMD.ncts_Eroeffnung = NCTS_TMP.MrnDate
|
||||||
|
NCTS_FREMD.ncts_Status = 50
|
||||||
|
Case "RELEASED"
|
||||||
|
NCTS_FREMD.ncts_Eroeffnung = NCTS_TMP.MrnDate
|
||||||
|
If If(NCTS_FREMD.ncts_Ankunft, "").ToString = "" Then NCTS_FREMD.ncts_Ankunft = NCTS_TMP.MrnDate
|
||||||
|
If If(NCTS_FREMD.ncts_Erledigung, "").ToString = "" Then NCTS_FREMD.ncts_Erledigung = NCTS_TMP.MrnDate
|
||||||
|
NCTS_FREMD.ncts_Status = 60
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
NCTS_FREMD.SAVE_ALL()
|
'WRT_NOT
|
||||||
|
'MRN_NOTIFIED
|
||||||
|
'GUAINF
|
||||||
|
'CTR_DEC
|
||||||
|
'CTRINFDEP
|
||||||
|
'MRN_ALL
|
||||||
|
'REL_TRA
|
||||||
|
'TRANSIT_CLOSE
|
||||||
|
'ARR_ADV
|
||||||
|
If NCTS_TMP.Status IsNot Nothing Then
|
||||||
|
Select Case NCTS_TMP.Status
|
||||||
|
Case "ARR_ADV"
|
||||||
|
If If(NCTS_FREMD.ncts_Ankunft, "").ToString = "" Then NCTS_FREMD.ncts_Ankunft = NCTS_TMP.MrnDate
|
||||||
|
NCTS_FREMD.ncts_Status = 53
|
||||||
|
Case "TRANSIT_CLOSE"
|
||||||
|
If If(NCTS_FREMD.ncts_Ankunft, "").ToString = "" Then NCTS_FREMD.ncts_Ankunft = NCTS_TMP.MrnDate
|
||||||
|
If If(NCTS_FREMD.ncts_Erledigung, "").ToString = "" Then NCTS_FREMD.ncts_Erledigung = NCTS_TMP.MrnDate
|
||||||
|
NCTS_FREMD.ncts_Status = 60
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
|
NCTS_FREMD.ncts_Status_KEWILL_Equivalent = NCTS_FREMD.ncts_Status
|
||||||
|
NCTS_FREMD.ncts_ObjectName = NCTS_TMP.Lrn
|
||||||
|
NCTS_FREMD.ncts_ActiveBorderTransportMeans_1_IdentificationNumber = NCTS_TMP.Trailer
|
||||||
|
|
||||||
|
|
||||||
|
NCTS_FREMD.LOAD_Guarantee()
|
||||||
|
|
||||||
|
NCTS_FREMD.ncts_GUARANTEE.Clear()
|
||||||
|
|
||||||
|
|
||||||
|
If NCTS_TMP.GuaranteeAmount > 0 AndAlso NCTS_TMP.Grn IsNot Nothing Then
|
||||||
|
|
||||||
|
Dim GRT = New cNCTS_FREMD_Guarantee
|
||||||
|
GRT.nctsGRT_Type = Nothing
|
||||||
|
|
||||||
|
GRT.nctsGRT_AccessCode = Nothing
|
||||||
|
GRT.nctsGRT_GRN = NCTS_TMP.Grn
|
||||||
|
GRT.nctsGRT_AmountToBeCoveredFremdWaehrung = NCTS_TMP.GuaranteeAmount
|
||||||
|
GRT.nctsGRT_Currency = NCTS_TMP.GuaranteeAmountCurrency
|
||||||
|
|
||||||
|
' MsgBox(If(GRT.nctsGRT_Currency, ""))
|
||||||
|
'--> EUR
|
||||||
|
If GRT.nctsGRT_AmountToBeCoveredFremdWaehrung IsNot Nothing Then
|
||||||
|
If If(GRT.nctsGRT_Currency, "") <> "EUR" Then
|
||||||
|
Dim betragEUR = VERAG_PROG_ALLGEMEIN.cEZB_Waehrungskurse.EXCHANGE_CURTOEUR(GRT.nctsGRT_AmountToBeCoveredFremdWaehrung, GRT.nctsGRT_Currency, NCTS_FREMD.ncts_Trans_DatumZeit.ToShortDateString)
|
||||||
|
GRT.nctsGRT_AmountToBeCovered = If(betragEUR > 0, betragEUR, GRT.nctsGRT_AmountToBeCoveredFremdWaehrung)
|
||||||
|
Else
|
||||||
|
GRT.nctsGRT_AmountToBeCovered = GRT.nctsGRT_AmountToBeCoveredFremdWaehrung
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
NCTS_FREMD.ncts_GUARANTEE.Clear()
|
||||||
|
NCTS_FREMD.ncts_GUARANTEE.Add(GRT)
|
||||||
|
End If
|
||||||
|
|
||||||
|
NCTS_FREMD.SAVE_ALL()
|
||||||
|
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|||||||
Reference in New Issue
Block a user