2016-05-17 78 views
2

我想要從Web服務API獲取折扣代碼的方式,即將有一個函數調用可以告訴我要應用哪個折扣代碼?Acumatica Web API應用折扣

我在其他方面試圖檢索折扣代碼,但他們可以按項目或按項目價格類和客戶等等等,這使得代碼比預期的更長。

希望API中有一個「GetBestDiscount」工具可以幫助我?

感謝, 摹

回答

2

此時Acumatica折扣引擎停用任何Web服務呼叫。由於這個事實,輸入訂單行沒有任何折扣將不會填充折扣代碼。

但是,在Acumatica大學,有GetSalesPrice.zip定製軟件包專門爲客戶檢索項目的價格(連接到I200基於屏幕的Web服務5.3和I210基於合同的Web服務5.3源)。

樣品呼籲基於屏幕的API:

Content getSalesPriceSchema = context.GetSchema(); 
var commands = new Command[] 
{ 
    new Value 
    { 
     Value = customer, 
     LinkedCommand =getSalesPriceSchema.RequiredInputParameters.Customer 
    }, 
    new Value 
    { 
     Value = inventoryID, 
     LinkedCommand =getSalesPriceSchema.RequiredInputParameters.InventoryID 
    }, 
    getSalesPriceSchema.OutputPrice.Price 
}; 
Content price = context.Submit(commands)[0]; 

樣品呼籲合同爲基礎的API:

GetSalesPriceInquiry priceToBeGet = new GetSalesPriceInquiry 
{ 
    Customer = new StringValue { Value = customer }, 
    InventoryID = new StringValue { Value = inventoryID } 
}; 
GetSalesPriceInquiry stockItemPrice = (GetSalesPriceInquiry)soapClient.Put(priceToBeGet); 
+0

嗨魯斯蘭,這檢索正確的價格,但我們可以得到折扣代碼的等價物? – GaGa

+0

感謝您的幫助魯斯蘭:) – GaGa

+0

謝謝魯斯蘭。我們應用您的解決方案,現在我們可以在銷售訂單中正確導入DiscountCode和DiscountPercentage。 –

0

有沒有這樣的API,但是你可以使用銷售訂單輸入屏幕API來創建一個臨時的銷售訂單,一行添加到它和檢索設定的價格或折扣,但不保存訂購。這將是最準確的信息,因爲折扣和價格也取決於日期,數量以及同時訂購的其他產品。

+0

這是否意味着,輸入訂單行沒有任何折扣應該自動填充折扣碼?到目前爲止,它將它設置爲沒有折扣碼(0%),如果我把它留爲空 – GaGa

1

我試圖創建通過API指令輸入屏幕的臨時銷售訂單行,但不保存作爲加布裏埃爾的建議。 我可以檢索設置的價格沒有問題,但折扣百分比和折扣碼不返回。 返回的折扣百分比爲零,折扣代碼爲空。

這是因爲Acumatica折扣引擎對於我猜測的任何Web服務呼叫都是停用的。

爲什麼Acumatica折扣引擎停用任何Web服務調用?