cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Business One Create Invoice using SL but got a NotFound error

mMason1
Explorer
0 Likes
386

Hello, 

We have made a software that uses ServiceLayer to create Invoice from Delivery or SalesOrder. But now, a new customer reported that he got a NotFound error when trying to create an Invoice from Delivery, and here is the http request:

POST https://example.com/sl/b1s/v1/Invoices

Content is:

{
  "CardCode": "C00001",
  "DocEntry": 0,
  "DocObjectCode": 0,
  "DocNum": 0,
  "TrackingNumber": "123456789123",
  "PickRemark": "",
  "DocumentLines": [
    {
      "BaseEntry": 33,
      "LineNum": 0,
      "BaseLine": 0,
      "BaseType": 15,
      "WarehouseCode": "02",
      "ItemCode": "012.34.A-B",
      "Quantity": 1.0,
      "RemainingOpenQuantity": 0.0,
      "UoMCode": "",
      "CommodityClassification": 0,
      "CountryOrg": "",
      "BatchNumbers": [],
      "SerialNumbers": [],
      "TaxCode": "TAXON",
      "Price": 0.0
    }
  ],
  "DocumentAdditionalExpenses": [
    {
      "LineNum": 0,
      "ExpenseCode": 5,
      "LineTotal": 15.98,
      "Remarks": "// SomeExpense Canada Post Expedited Parcel",
      "TaxCode": "TAXON",
      "BaseDocEntry": null,
      "BaseDocLine": null,
      "BaseDocType": null
    }
  ],
  "DocumentPackages": [
    {
      "Number": 1,
      "DocumentPackageItems": [
        {
          "ItemCode": "012.34.A-B",
          "Quantity": 1.0,
          "MeasureUnit": "",
          "UoMEntry": -1,
          "UnitsOfMeasurement": 1.0
        }
      ],
      "Type": "Box"
    }
  ],
  "DownPaymentsToDraw": [],
  "B1S_ReplaceCollectionsOnPatch": false,
  "U_V33SB_ShopifyOrderId": "123456789",
  "U_V33SB_ShopifyRefundId": "",
  "U_V33SB_TrackingUpdated": "N",
  "U_V33SB_ShopifyFulfillmentId": "",
  "U_V33_BranchName": "ABCDEFG",
  "U_IdocsComments": "",
  "U_V33SB_EXTERNALORDERID": "",
  "U_UpdateIDocs": "",
  "U_IsInvoiceFullyPaid": "",
  "U_V33_StarShipFreight": "15.98"
}

The error is No matching record found (ODBC -2028).

But they do have an expense whose Expenses Code is 5:

{
	"Name" : "ShopifyDifference",
	"RevenuesAccount" : "_SYS00000000834",
	"ExpenseAccount" : "_SYS00000000834",
	"TaxLiable" : "tNO",
	"FixedAmountRevenues" : 0.0,
	"FixedAmountExpenses" : 0.0,
	"OutputVATGroup" : null,
	"InputVATGroup" : null,
	"DistributionMethod" : "aed_None",
	"Includein1099" : "tNO",
	"FreightOffsetAccount" : null,
	"WTLiable" : "N",
	"ExpensCode" : 5,
	"ExpenseExemptedAccount" : null,
	"RevenuesExemptedAccount" : null,
	"DistributionRule" : "",
	"DrawingMethod" : "dmTotal",
	"FreightType" : "ftShipping",
	"Stock" : "tNO",
	"LastPurchasePrice" : "tNO",
	"Project" : null,
	"DistributionRule2" : "",
	"DistributionRule3" : "",
	"DistributionRule4" : "",
	"DistributionRule5" : "",
	"DataVersion" : 1,
	"SAFTProductType" : "saftpt_Services"
}

But it seems I don't set the Additional Expense properly in my environment (Maybe you can give some help about this).

Could you give me some help about this NotFound problem? Thanks a lot!

 

Accepted Solutions (0)

Answers (0)