API UpdateDocumentItem

Z Podpora.nextis.cz
Verze z 30. 9. 2021, 16:11, kterou vytvořil Chrzaszcz (diskuse | příspěvky)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)
Přejít na: navigace, hledání

Description

Method allows You to update document item in system.

Exact name

API_UpdateDocumentItem

Type

Standard executable stored procedure.

Specification

Parameter Data type Value range Description Relation
@ID int Internal system id API_GetDocumentItems.ID
@ReceiptID int ID of delivery note from delivery note list (see relation) API_GetDeliveryNote.ID
@DocumentID int ID of invoices from invoices list (see relation) API_GetInvoices.ID
@DocumentID2 int ID of original invoices from invoices list (see relation) API_GetInvoices.ID
@ProductID int ID of product from products list (see relation) API_GetProducts.ID
@Name2 nvarchar(200) Name 2
@StorageCardID int ID of stock dispositions from stock dispositions list (see relation) API_GetStockDispositions.ID
@MeasureUnitID int ID of unit from units list (see relation) API_GetUnits.ID
@VATID int ID of VAT rates from VAT rates list (see relation) API_GetVATRates.ID
@TypeID int Type ID.

1 - Product,

2 - Service,

7 - Text,

500 - CreditNote,

999 - Round

@IssueQuantity numeric(12,4) Issue quantity
@RetailPricePerPiece decimal(18,4) Retail price per piece
@PurchPrice decimal(19,4) Purch price
@PurchasePriceInCurrency decimal(19,4) Purchase price in currency
@TotalPrice decimal(19,2) Total price
@TotalPriceInCurrency decimal(19,2) Total price in currency
@DiscountPercent decimal(6,2) Discount percent
@DiscountPrice decimal(18,2) Discount price
@DiscountPriceInCurrency decimal(18,2) Discount price in currency
@PurchasePriceAfterDiscount decimal(18,4) Purchase price after discount
@PurchasePriceAfterDiscountInCurrency decimal(18,4) Purchase price after discount in currency
@TotalPriceAfterDiscount decimal(18,2) Total price after discount
@TotalPriceAfterDiscountInCurrency decimal(18,2) Total price after discount in currency
@PerPiecePurchasePrice decimal(18,6) Per piece purchase price
@PerPieceVATPrice decimal(18,4) Per piece VAT price
@TotalPriceWithVAT decimal(18,2) Total price with VAT
@TotalPriceWithVATInCurrency decimal(18,2) Total price with VAT in currency
@VATRate numeric(6,2) VAT rate
@ExchangeRate decimal(19,4) Exchange rate
@VATTypeID int VAT Type ID -1
@VATSetted int VAT setted 0
@VATSettedDate datetime VAT setted date null
@Note nvarchar(100) Note
@AvailableStockQuantity decimal(18,3) Available stock quantity
@StockClosed int Stock closed 0
@OriginItemID int ID of original items from document items list (see relation) API_GetDocumentItems.ID
@ReturnID int
@ReturnItemID int
@ActionPrice int Action price

0 - normal price

1 - action price

Return

0 : OK
100 : Item could not be updated

Example

 DECLARE @return_value int
 DECLARE @ID int
 DECLARE @ReceiptID int
 DECLARE @DocumentID int
 DECLARE @DocumentID2 int
 DECLARE @ProductID int
 DECLARE @Name2 nvarchar(200)
 DECLARE @StorageCardID int
 DECLARE @MeasureUnitID int
 DECLARE @VATID int
 DECLARE @TypeID int
 DECLARE @IssueQuantity numeric(12,4)
 DECLARE @RetailPricePerPiece decimal(18,4)
 DECLARE @PurchPrice decimal(19,4)
 DECLARE @PurchasePriceInCurrency decimal(19,4)
 DECLARE @TotalPrice decimal(19,2)
 DECLARE @TotalPriceInCurrency decimal(19,2)
 DECLARE @DiscountPercent decimal(6,2)
 DECLARE @DiscountPrice decimal(18,2)
 DECLARE @DiscountPriceInCurrency decimal(18,2)
 DECLARE @PurchasePriceAfterDiscount decimal(18,4)
 DECLARE @PurchasePriceAfterDiscountInCurrency decimal(18,4)
 DECLARE @TotalPriceAfterDiscount decimal(18,2)
 DECLARE @TotalPriceAfterDiscountInCurrency decimal(18,2)
 DECLARE @PerPiecePurchasePrice decimal(18,6)
 DECLARE @PerPieceVATPrice decimal(18,4)
 DECLARE @TotalPriceWithVAT decimal(18,2)
 DECLARE @TotalPriceWithVATInCurrency decimal(18,2)
 DECLARE @VATRate numeric(6,2)
 DECLARE @ExchangeRate decimal(19,4)
 DECLARE @VATTypeID int
 DECLARE @VATSetted int
 DECLARE @VATSettedDate datetime
 DECLARE @Note nvarchar(100)
 DECLARE @AvailableStockQuantity decimal(18,3)
 DECLARE @StockClosed int
 DECLARE @OriginItemID int
 DECLARE @ReturnID int
 DECLARE @ReturnItemID int
 DECLARE @ActionPrice int
 
 SELECT @ID = [ID], 
       @ReceiptID = [ReceiptID],
       @DocumentID = [DocumentID],
       @DocumentID2 = [DocumentID2],
       @ProductID = [ProductID],
       @Name2 = 'Name X',
       @StorageCardID = [StorageCardID],
       @MeasureUnitID = [MeasureUnitID],
       @VATID = [VATID],
       @TypeID = [TypeID],
       @IssueQuantity = [IssueQuantity],
       @RetailPricePerPiece = [RetailPricePerPiece],
       @PurchPrice = [PurchPrice],
       @PurchasePriceInCurrency = [PurchasePriceInCurrency],
       @TotalPrice = [TotalPrice],
       @TotalPriceInCurrency = [TotalPriceInCurrency],
       @DiscountPercent = [DiscountPercent],
       @DiscountPrice = [DiscountPrice],
       @DiscountPriceInCurrency = [DiscountPriceInCurrency],
       @PurchasePriceAfterDiscount = [PurchasePriceAfterDiscount],
       @PurchasePriceAfterDiscountInCurrency = [PurchasePriceAfterDiscountInCurrency],
       @TotalPriceAfterDiscount = [TotalPriceAfterDiscount],
       @TotalPriceAfterDiscountInCurrency = [TotalPriceAfterDiscountInCurrency],
       @PerPiecePurchasePrice = [PerPiecePurchasePrice],
       @PerPieceVATPrice = [PerPieceVATPrice],
       @TotalPriceWithVAT = [TotalPriceWithVAT],
       @TotalPriceWithVATInCurrency = [TotalPriceWithVATInCurrency],
       @VATRate = [VATRate],
       @ExchangeRate = [ExchangeRate],
       @VATTypeID = [VATTypeID],
       @VATSetted = [VATSetted],
       @VATSettedDate = [VATSettedDate],
       @Note = [Note],
       @AvailableStockQuantity = [AvailableStockQuantity],
       @StockClosed = [StockClosed],
       @OriginItemID = [OriginItemID],
       @ReturnID = [ReturnID],
       @ReturnItemID = [ReturnItemID],
       @ActionPrice = [ActionPrice],
 FROM   [API_GetDocumentItems] 
 WHERE  id = 3
 
 EXECUTE @return_value = [API_UpdateDocumentItem] 
  @ID, 
  @ReceiptID,
  @DocumentID,
  @DocumentID2,
  @ProductID,
  @Name2,
  @StorageCardID,
  @MeasureUnitID,
  @VATID,
  @TypeID,
  @IssueQuantity,
  @RetailPricePerPiece,
  @PurchPrice,
  @PurchasePriceInCurrency,
  @TotalPrice,
  @TotalPriceInCurrency,
  @DiscountPercent,
  @DiscountPrice,
  @DiscountPriceInCurrency,
  @PurchasePriceAfterDiscount,
  @PurchasePriceAfterDiscountInCurrency,
  @TotalPriceAfterDiscount,
  @TotalPriceAfterDiscountInCurrency,
  @PerPiecePurchasePrice,
  @PerPieceVATPrice,
  @TotalPriceWithVAT,
  @TotalPriceWithVATInCurrency,
  @VATRate,
  @ExchangeRate,
  @VATTypeID,
  @VATSetted,
  @VATSettedDate,
  @Note,
  @AvailableStockQuantity,
  @StockClosed,
  @OriginItemID,
  @ReturnID,
  @ReturnItemID,
  @ActionPrice

Notices

None.