QuickBooks QBFC SDK에서 인벤토리 조정에 회선을 추가해야합니다. 그러나 어떤 이유로 시리얼/로트 참조가 필요하다고 나와 있습니다.QuickBooks InventroyAdjustMod
다음은 조정 라인에 대한 QBFC 참조입니다. ORTypeAdjustmentMod는 필수 필드이지만 일련 번호 나 로트 번호는 사용하지 않습니다. 오른쪽의 "Y"는 필수 필드를 나타냅니다. 여기
같은 요청의 XML 버전입니다. 여기서는 ORTypeAdjustmentMod가 선택 사항입니다.< -BEGIN OR- 의견이 의미하는 바는 모르겠지만 ORTypeAdjustmentMod와 관련이 있습니다.
는 사람이 QuickBooks에 SDK이 비슷한으로 실행 했습니까?
편집
다음은 그의 QuickBooks에 이야기 호출하는 코드입니다. 전체 클래스에 대한 전역 세션 관리자가 있고 메시지가 SendMessage 함수로 전송됩니다. 롯/일련 번호가 포함되어 있지 않습니다 QuickBooks에에서 오류가 "(0) 요소 - ORTypeAdjustmentMod가 : InventoryAdjustmentLineModList 필수 필드가 InventoryAdjustmentMod의 InventoryAdjustmentLineModList 끝의 끝이 없습니다"입니다 내가 발견 한
또 다른 문제를, 어떤 TxnLineID를 "-1"로 설정하여 기존 재고 조정에 새 라인을 추가 할 때 일련 번호/로트 번호와 관련이있을 수 있습니다. 이는 트랜잭션의 모든 기존 라인을 지우고 새 라인을 추가합니다 . 이 경우 "OK"상태 메시지가 나타납니다.
Function AdjustInventory(itemid As String, adjustment As Single, account As String, _class As String, jobnumber As String, reference As String) As String
Dim requestMsgSet As IMsgSetRequest
'Checks if previous inventory adjust exists and returns JArray of each line
'of the transaction. No issue here.
Dim lines As JArray = GetPreviousQuery(reference)
requestMsgSet = sessionManager.CreateMsgSetRequest("US", 13, 0)
requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue
Dim responseMsgSet As IMsgSetResponse
Dim exists As Boolean = lines(0)("exists")
'if a previoius adjustment doesnt exist, make a new one.
If Not exists Then
Dim InventoryAdjustmentAddRq As IInventoryAdjustmentAdd
InventoryAdjustmentAddRq = requestMsgSet.AppendInventoryAdjustmentAddRq()
InventoryAdjustmentAddRq.AccountRef.FullName.SetValue(account)
InventoryAdjustmentAddRq.ClassRef.FullName.SetValue(_class)
InventoryAdjustmentAddRq.RefNumber.SetValue(reference)
If jobnumber IsNot Nothing Then
InventoryAdjustmentAddRq.CustomerRef.FullName.SetValue(jobnumber)
End If
Dim InventoryAdjustmentLineAdd91 As IInventoryAdjustmentLineAdd
InventoryAdjustmentLineAdd91 = InventoryAdjustmentAddRq.InventoryAdjustmentLineAddList.Append()
InventoryAdjustmentLineAdd91.ItemRef.ListID.SetValue(itemid)
InventoryAdjustmentLineAdd91.ORTypeAdjustment.QuantityAdjustment.ORQuantityAdjustment.QuantityDifference.SetValue(adjustment)
responseMsgSet = Me.SendMessage(requestMsgSet)
Else
Dim InventoryAdjustmentModRq As IInventoryAdjustmentMod
InventoryAdjustmentModRq = requestMsgSet.AppendInventoryAdjustmentModRq()
'InventoryAdjustmentModRq.RefNumber.SetValue(reference)
InventoryAdjustmentModRq.TxnID.SetValue(lines(0)("transactionid"))
InventoryAdjustmentModRq.EditSequence.SetValue(lines(0)("editsequence"))
Dim isitemnew As Boolean = True
'loops through all items in adjustment to see if the current item matches.
For Each line As JObject In lines
If line("listid") = itemid Then
Dim prevquan As Single
prevquan = line("quantitydifference")
Dim newval As Single = prevquan + adjustment
Dim InventoryAdjustmentLineMod116 As IInventoryAdjustmentLineMod
InventoryAdjustmentLineMod116 = InventoryAdjustmentModRq.InventoryAdjustmentLineModList.Append()
InventoryAdjustmentLineMod116.ItemRef.ListID.SetValue(itemid)
InventoryAdjustmentLineMod116.QuantityDifference.SetValue(newval)
InventoryAdjustmentLineMod116.TxnLineID.SetValue(lines(0)("linetxnid"))
InventoryAdjustmentLineMod116.ORTypeAdjustmentMod.LotAdjustment.CountAdjustment.SetValue(newval)
isitemnew = False
End If
Next
'If item is new, append it to the inventory adjustment.
If isitemnew Then
Dim invadjustlineadd As IInventoryAdjustmentLineMod
invadjustlineadd = InventoryAdjustmentModRq.InventoryAdjustmentLineModList.Append()
'Heres where the erasing issue arises'
'the transaction doesnt get replaced when the TxnLineID is actually matches
'an existing TxnLineID, it only happens when trying to add a new one.
invadjustlineadd.TxnLineID.SetValue("-1")
invadjustlineadd.ItemRef.ListID.SetValue(itemid)
invadjustlineadd.QuantityDifference.SetValue(adjustment)
invadjustlineadd.ORTypeAdjustmentMod.LotAdjustment.CountAdjustment.SetValue(adjustment)
Debug.WriteLine(invadjustlineadd.TxnLineID.GetValue.ToString)
End If
responseMsgSet = Me.SendMessage(requestMsgSet)
End If
Dim res As Object = responseMsgSet.ResponseList.GetAt(0)
Dim code As String = res.StatusCode
Dim mes As String = res.StatusMessage
Dim sev As String = res.StatusSeverity
Dim jres As Object
jres = New With {Key .status = sev, Key .code = code, Key .detail = mes}
Dim output As String = JsonConvert.SerializeObject(jres)
Return output
End Function
Function SendMessage(requestMsgSet As IMsgSetRequest) As IMsgSetResponse
Dim responseMsgSet As IMsgSetResponse
'Send the request and get the response from QuickBooks
responseMsgSet = sessionManager.DoRequests(requestMsgSet)
'End the session and close the connection to QuickBooks
Return responseMsgSet
End Function
코드의 모양은 어떻습니까? 보내는 XML 요청은 어떻게 생겼습니까? 이 정보가 없으면 우리는 당신을 도울 수 없습니다. –
@KeithPalmerJr. 제 질문은 반드시 SDK와 관련이 있습니다. 필자의 코드는 아닙니다. XML SDK는 선택 사항이지만 .NET SDK는 필요하다고 말합니다. – Philip556677
실제 오류 메시지는 무엇입니까? 코드는 어떻게 생겼습니까? –