API CreateDocumentItem: Porovnání verzí
Skočit na navigaci
Skočit na vyhledávání
Založena nová stránka s textem „==== Description ==== Method allows You to create new document item in system. ==== Exact name ==== <code>API_CreateDocumentItem</code> ==== Type ==== St…“ |
Bez shrnutí editace |
||
| (Není zobrazeno 6 mezilehlých verzí od stejného uživatele.) | |||
| Řádek 16: | Řádek 16: | ||
!Relation | !Relation | ||
|- | |- | ||
|ReceiptID | |@ReceiptID | ||
|int | |int | ||
|ID of | | | ||
| | |ID of delivery note from delivery note list (see relation) | ||
| API_GetDeliveryNote.ID | |||
|- | |- | ||
|DocumentID | |@DocumentID | ||
|int | |int | ||
| | |||
|ID of invoices from invoices list (see relation) | |ID of invoices from invoices list (see relation) | ||
| API_GetInvoices.ID | | API_GetInvoices.ID | ||
|- | |- | ||
|DocumentID2 | |@DocumentID2 | ||
|int | |int | ||
| | |||
|ID of original invoices from invoices list (see relation) | |ID of original invoices from invoices list (see relation) | ||
| API_GetInvoices.ID | | API_GetInvoices.ID | ||
|- | |- | ||
|ProductID | |@ProductID | ||
|int | |int | ||
| | |||
|ID of product from products list (see relation) | |ID of product from products list (see relation) | ||
| API_GetProducts.ID | | API_GetProducts.ID | ||
|- | |- | ||
|StorageCardID | |@StorageCardID | ||
|int | |int | ||
| | |||
|ID of stock dispositions from stock dispositions list (see relation) | |ID of stock dispositions from stock dispositions list (see relation) | ||
| API_GetStockDispositions.ID | | API_GetStockDispositions.ID | ||
|- | |- | ||
|MeasureUnitID | |@MeasureUnitID | ||
|int | |int | ||
| | |||
|ID of unit from units list (see relation) | |ID of unit from units list (see relation) | ||
| API_GetUnits.ID | | API_GetUnits.ID | ||
|- | |- | ||
|VATID | |@VATID | ||
|int | |int | ||
| | |||
|ID of VAT rates from VAT rates list (see relation) | |ID of VAT rates from VAT rates list (see relation) | ||
| API_GetVATRates.ID | | API_GetVATRates.ID | ||
|- | |- | ||
|TypeID | |@TypeID | ||
|int | |int | ||
| | |||
|Type ID. | |Type ID. | ||
1 - Product, | 1 - Product, | ||
| Řádek 65: | Řádek 73: | ||
| | | | ||
|- | |- | ||
|IssueQuantity | |@IssueQuantity | ||
|numeric(12,4) | |numeric(12,4) | ||
| | |||
|Issue quantity | |Issue quantity | ||
| | | | ||
|- | |- | ||
|RetailPricePerPiece | |@RetailPricePerPiece | ||
|decimal(18,4) | |decimal(18,4) | ||
| | |||
|Retail price per piece | |Retail price per piece | ||
| | | | ||
|- | |- | ||
|PurchPrice | |@PurchPrice | ||
|decimal(19,4) | |decimal(19,4) | ||
| | |||
|Purch price | |Purch price | ||
| | | | ||
|- | |- | ||
|PurchasePriceInCurrency | |@PurchasePriceInCurrency | ||
|decimal(19,4) | |decimal(19,4) | ||
| | |||
|Purchase price in currency | |Purchase price in currency | ||
| | | | ||
|- | |- | ||
|TotalPrice | |@TotalPrice | ||
|decimal(19,2) | |decimal(19,2) | ||
| | |||
|Total price | |Total price | ||
| | | | ||
|- | |- | ||
|TotalPriceInCurrency | |@TotalPriceInCurrency | ||
|decimal(19,2) | |decimal(19,2) | ||
| | |||
|Total price in currency | |Total price in currency | ||
| | | | ||
|- | |- | ||
|DiscountPercent | |@DiscountPercent | ||
|decimal(6,2) | |decimal(6,2) | ||
| | |||
|Discount percent | |Discount percent | ||
| | | | ||
|- | |- | ||
|DiscountPrice | |@DiscountPrice | ||
|decimal(18,2) | |decimal(18,2) | ||
| | |||
|Discount price | |Discount price | ||
| | | | ||
|- | |- | ||
|DiscountPriceInCurrency | |@DiscountPriceInCurrency | ||
|decimal(18,2) | |decimal(18,2) | ||
| | |||
|Discount price in currency | |Discount price in currency | ||
| | | | ||
|- | |- | ||
|PurchasePriceAfterDiscount | |@PurchasePriceAfterDiscount | ||
|decimal(18,4) | |decimal(18,4) | ||
| | |||
|Purchase price after discount | |Purchase price after discount | ||
| | | | ||
|- | |- | ||
|PurchasePriceAfterDiscountInCurrency | |@PurchasePriceAfterDiscountInCurrency | ||
|decimal(18,4) | |decimal(18,4) | ||
| | |||
|Purchase price after discount in currency | |Purchase price after discount in currency | ||
| | | | ||
|- | |- | ||
|TotalPriceAfterDiscount | |@TotalPriceAfterDiscount | ||
|decimal(18,2) | |decimal(18,2) | ||
| | |||
|Total price after discount | |Total price after discount | ||
| | | | ||
|- | |- | ||
|TotalPriceAfterDiscountInCurrency | |@TotalPriceAfterDiscountInCurrency | ||
|decimal(18,2) | |decimal(18,2) | ||
| | |||
|Total price after discount in currency | |Total price after discount in currency | ||
| | | | ||
|- | |- | ||
|PerPiecePurchasePrice | |@PerPiecePurchasePrice | ||
|decimal(18,6) | |decimal(18,6) | ||
| | |||
|Per piece purchase price | |Per piece purchase price | ||
| | | | ||
|- | |- | ||
|PerPieceVATPrice | |@PerPieceVATPrice | ||
|decimal(18,4) | |decimal(18,4) | ||
| | |||
|Per piece VAT price | |Per piece VAT price | ||
| | | | ||
|- | |- | ||
|TotalPriceWithVAT | |@TotalPriceWithVAT | ||
|decimal(18,2) | |decimal(18,2) | ||
| | |||
|Total price with VAT | |Total price with VAT | ||
| | | | ||
|- | |- | ||
|TotalPriceWithVATInCurrency | |@TotalPriceWithVATInCurrency | ||
|decimal(18,2) | |decimal(18,2) | ||
| | |||
|Total price with VAT in currency | |Total price with VAT in currency | ||
| | | | ||
|- | |- | ||
|VATRate | |@VATRate | ||
|numeric(6,2) | |numeric(6,2) | ||
| | |||
|VAT rate | |VAT rate | ||
| | | | ||
|- | |- | ||
|ExchangeRate | |@ExchangeRate | ||
|decimal(19,4) | |decimal(19,4) | ||
| | |||
|Exchange rate | |Exchange rate | ||
| | | | ||
|- | |- | ||
|VATTypeID | |@VATTypeID | ||
|int | |int | ||
| | |||
|VAT Type ID | |VAT Type ID | ||
| -1 | | -1 | ||
|- | |- | ||
|VATSetted | |@VATSetted | ||
|int | |int | ||
| | |||
|VAT setted | |VAT setted | ||
| 0 | | 0 | ||
|- | |- | ||
|VATSettedDate | |@VATSettedDate | ||
|datetime | |datetime | ||
| | |||
|VAT setted date | |VAT setted date | ||
| null | | null | ||
|- | |- | ||
|Note | |@Note | ||
|nvarchar(100) | |nvarchar(100) | ||
| | |||
|Note | |Note | ||
| | | | ||
|- | |- | ||
|AvailableStockQuantity | |@AvailableStockQuantity | ||
|decimal(18,3) | |decimal(18,3) | ||
| | |||
|Available stock quantity | |Available stock quantity | ||
| | | | ||
|- | |- | ||
|StockClosed | |@StockClosed | ||
|int | |int | ||
| | |||
|Stock closed | |Stock closed | ||
| 0 | | 0 | ||
|- | |- | ||
|OriginItemID | |@OriginItemID | ||
|int | |int | ||
| | |||
|ID of original items from document items list (see relation) | |ID of original items from document items list (see relation) | ||
| API_GetDocumentItems.ID | | API_GetDocumentItems.ID | ||
|- | |- | ||
|ReturnID | |@ReturnID | ||
|int | |int | ||
| | |||
| | | | ||
| | | | ||
|- | |- | ||
|ReturnItemID | |@ReturnItemID | ||
|int | |int | ||
| | |||
| | | | ||
| | | | ||
|- | |- | ||
|ActionPrice | |@ActionPrice | ||
|int | |int | ||
| | |||
|Action price | |Action price | ||
0 - normal price | 0 - normal price | ||
| Řádek 213: | Řádek 250: | ||
| | | | ||
|- | |- | ||
|Name2 | |@Name2 | ||
|nvarchar(200) | |nvarchar(200) | ||
| | |||
|Name 2 | |Name 2 | ||
| | | | ||
|} | |} | ||
==== Return ==== | |||
0 : OK | |||
100 : Item could not be created | |||
==== Example ==== | ==== Example ==== | ||
<syntaxhighlight lang="sql"> | <syntaxhighlight lang="sql"> | ||
EXEC [API_CreateDocumentItem] @ | DECLARE @return_value int | ||
EXEC @return_value = [API_CreateDocumentItem] @ReceiptID= -1 ,@DocumentID= 7 ,@DocumentID2= -1 ,@ProductID= -1 ,@StorageCardID= -1 ,@MeasureUnitID= 148 ,@VATID= 16028 ,@TypeID= 7 ,@IssueQuantity= 1 ,@RetailPricePerPiece= 300 ,@PurchPrice= 300 ,@PurchasePriceInCurrency= 300 ,@TotalPrice= 300.00 ,@TotalPriceInCurrency= 300 ,@DiscountPercent= 10 ,@DiscountPrice= 30 ,@DiscountPriceInCurrency= 30 ,@PurchasePriceAfterDiscount= 270 ,@PurchasePriceAfterDiscountInCurrency= 270 ,@TotalPriceAfterDiscount= 270.00 ,@TotalPriceAfterDiscountInCurrency= 270 ,@PerPiecePurchasePrice= 0 ,@PerPieceVATPrice= 56.7 ,@TotalPriceWithVAT= 56.7 ,@TotalPriceWithVATInCurrency= 56.7 ,@VATRate= 21.00 ,@ExchangeRate= 1 ,@VATTypeID= 20 ,@VATSetted= 2 ,@VATSettedDate= NULL ,@Note= '' ,@AvailableStockQuantity= 0 ,@StockClosed= 0 ,@OriginItemID= -1 ,@ReturnID= NULL ,@ReturnItemID= NULL ,@ActionPrice= NULL ,@Name2= 'GDB400' | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Notices ==== | ==== Notices ==== | ||
None. | None. | ||
Aktuální verze z 30. 9. 2021, 14:13
Description
Method allows You to create new document item in system.
Exact name
API_CreateDocumentItem
Type
Standard executable stored procedure.
Specification
| Parameter | Data type | Value range | Description | Relation |
|---|---|---|---|---|
| @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 | |
| @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 |
||
| @Name2 | nvarchar(200) | Name 2 |
Return
0 : OK 100 : Item could not be created
Example
DECLARE @return_value int
EXEC @return_value = [API_CreateDocumentItem] @ReceiptID= -1 ,@DocumentID= 7 ,@DocumentID2= -1 ,@ProductID= -1 ,@StorageCardID= -1 ,@MeasureUnitID= 148 ,@VATID= 16028 ,@TypeID= 7 ,@IssueQuantity= 1 ,@RetailPricePerPiece= 300 ,@PurchPrice= 300 ,@PurchasePriceInCurrency= 300 ,@TotalPrice= 300.00 ,@TotalPriceInCurrency= 300 ,@DiscountPercent= 10 ,@DiscountPrice= 30 ,@DiscountPriceInCurrency= 30 ,@PurchasePriceAfterDiscount= 270 ,@PurchasePriceAfterDiscountInCurrency= 270 ,@TotalPriceAfterDiscount= 270.00 ,@TotalPriceAfterDiscountInCurrency= 270 ,@PerPiecePurchasePrice= 0 ,@PerPieceVATPrice= 56.7 ,@TotalPriceWithVAT= 56.7 ,@TotalPriceWithVATInCurrency= 56.7 ,@VATRate= 21.00 ,@ExchangeRate= 1 ,@VATTypeID= 20 ,@VATSetted= 2 ,@VATSettedDate= NULL ,@Note= '' ,@AvailableStockQuantity= 0 ,@StockClosed= 0 ,@OriginItemID= -1 ,@ReturnID= NULL ,@ReturnItemID= NULL ,@ActionPrice= NULL ,@Name2= 'GDB400'
Notices
None.