API CreateBasketItem: Porovnání verzí
Skočit na navigaci
Skočit na vyhledávání
Bez shrnutí editace |
Bez shrnutí editace |
||
| (Nejsou zobrazeny 4 mezilehlé verze od stejného uživatele.) | |||
| Řádek 16: | Řádek 16: | ||
!Relation | !Relation | ||
|- | |- | ||
|CustomerID | |@CustomerID | ||
|int | |int | ||
| | | | ||
| Řádek 22: | Řádek 22: | ||
|API_GetCustomers.ID | |API_GetCustomers.ID | ||
|- | |- | ||
|CustomerWorkshopID | |@CustomerWorkshopID | ||
|int | |int | ||
| | | | ||
| Řádek 28: | Řádek 28: | ||
|API_GetWorkshops.ID = API_GetCustomers.WorkshopID | |API_GetWorkshops.ID = API_GetCustomers.WorkshopID | ||
|- | |- | ||
|GroupID | |@GroupID | ||
|int | |int | ||
| | | | ||
| Řádek 34: | Řádek 34: | ||
|API_GetProductGroups.ID | |API_GetProductGroups.ID | ||
|- | |- | ||
|ProductID | |@ProductID | ||
|int | |int | ||
| | | | ||
| Řádek 40: | Řádek 40: | ||
|API_GetProducts.ID | |API_GetProducts.ID | ||
|- | |- | ||
|StorageCardID | |@StorageCardID | ||
|int | |int | ||
| | | | ||
| Řádek 46: | Řádek 46: | ||
|API_GetStockDispositions.ID | |API_GetStockDispositions.ID | ||
|- | |- | ||
|OrderID | |@OrderID | ||
|int | |int | ||
| | | | ||
| Řádek 52: | Řádek 52: | ||
|API_GetOrders.ID | |API_GetOrders.ID | ||
|- | |- | ||
|GroupCode | |@GroupCode | ||
|nvarchar(40) | |nvarchar(40) | ||
| | | | ||
| | |Group code | ||
| | | | ||
|- | |- | ||
|ProductCode | |@ProductCode | ||
|nvarchar(40) | |nvarchar(40) | ||
| | | | ||
| | |Product code | ||
| | | | ||
|- | |- | ||
|ManufacturerCode | |@ManufacturerCode | ||
|nvarchar(40) | |nvarchar(40) | ||
| | | | ||
| | |Manufacturer code | ||
| | | | ||
|- | |- | ||
|SupplierCode | |@SupplierCode | ||
|nvarchar(40) | |nvarchar(40) | ||
| | | | ||
| | |Supplier code | ||
| | | | ||
|- | |- | ||
|Brand | |@Brand | ||
|nvarchar(50) | |nvarchar(50) | ||
| | | | ||
| | |Brand | ||
| | | | ||
|- | |- | ||
|Desription | |@Desription | ||
|nvarchar(250) | |nvarchar(250) | ||
| | | | ||
| Řádek 88: | Řádek 88: | ||
| | | | ||
|- | |- | ||
|OrderedQuantity | |@OrderedQuantity | ||
|decimal(18,2) | |decimal(18,2) | ||
| | | | ||
| Řádek 94: | Řádek 94: | ||
| | | | ||
|- | |- | ||
|PricePerPiece | |@PricePerPiece | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 100: | Řádek 100: | ||
| | | | ||
|- | |- | ||
|PricePerPieceWithVAT | |@PricePerPieceWithVAT | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 106: | Řádek 106: | ||
| | | | ||
|- | |- | ||
|PurchasePricePerPiece | |@PurchasePricePerPiece | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 112: | Řádek 112: | ||
| | | | ||
|- | |- | ||
|PurchasePricePerPieceWithVAT | |@PurchasePricePerPieceWithVAT | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 118: | Řádek 118: | ||
| | | | ||
|- | |- | ||
|TotalPrice | |@TotalPrice | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 124: | Řádek 124: | ||
| | | | ||
|- | |- | ||
|TotalPriceWithVAT | |@TotalPriceWithVAT | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 130: | Řádek 130: | ||
| | | | ||
|- | |- | ||
|TotalPurchasePrice | |@TotalPurchasePrice | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 136: | Řádek 136: | ||
| | | | ||
|- | |- | ||
|TotalPurchasePriceWithVAT | |@TotalPurchasePriceWithVAT | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 142: | Řádek 142: | ||
| | | | ||
|- | |- | ||
|DiscountInPercent | |@DiscountInPercent | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 148: | Řádek 148: | ||
| | | | ||
|- | |- | ||
|DiscountPrice | |@DiscountPrice | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 154: | Řádek 154: | ||
| | | | ||
|- | |- | ||
|SurchargesPrice | |@SurchargesPrice | ||
|decimal(18,2) | |decimal(18,2) | ||
| | | | ||
| Řádek 160: | Řádek 160: | ||
| | | | ||
|- | |- | ||
|SurchargePriceWithVAT | |@SurchargePriceWithVAT | ||
|decimal(18,2) | |decimal(18,2) | ||
| | | | ||
| Řádek 166: | Řádek 166: | ||
| | | | ||
|- | |- | ||
|PricePerPieceInCurrency | |@PricePerPieceInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 172: | Řádek 172: | ||
| | | | ||
|- | |- | ||
|PricePerPieceWithVATInCurrency | |@PricePerPieceWithVATInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 178: | Řádek 178: | ||
| | | | ||
|- | |- | ||
|PurchasePricePerPieceInCurrency | |@PurchasePricePerPieceInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 184: | Řádek 184: | ||
| | | | ||
|- | |- | ||
|PurchasePricePerPieceWithVATInCurrency | |@PurchasePricePerPieceWithVATInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 190: | Řádek 190: | ||
| | | | ||
|- | |- | ||
|TotalPriceInCurrency | |@TotalPriceInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 196: | Řádek 196: | ||
| | | | ||
|- | |- | ||
|TotalPriceWithVATInCurrency | |@TotalPriceWithVATInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 202: | Řádek 202: | ||
| | | | ||
|- | |- | ||
|TotalPurchasePriceInCurrency | |@TotalPurchasePriceInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 208: | Řádek 208: | ||
| | | | ||
|- | |- | ||
|TotalPurchasePriceWithVATInCurrency | |@TotalPurchasePriceWithVATInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 214: | Řádek 214: | ||
| | | | ||
|- | |- | ||
|DiscountPriceInCurrency | |@DiscountPriceInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 220: | Řádek 220: | ||
| | | | ||
|- | |- | ||
|SurchargesPriceInCurrency | |@SurchargesPriceInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 226: | Řádek 226: | ||
| | | | ||
|- | |- | ||
|SurchargesPriceWithVATInCurrency | |@SurchargesPriceWithVATInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 232: | Řádek 232: | ||
| | | | ||
|- | |- | ||
|CurrencyID | |@CurrencyID | ||
|int | |int | ||
| | | | ||
| Řádek 238: | Řádek 238: | ||
|API_GetCurrency.ID | |API_GetCurrency.ID | ||
|- | |- | ||
|ForeignCurrencyID | |@ForeignCurrencyID | ||
|int | |int | ||
| | | | ||
| Řádek 244: | Řádek 244: | ||
|API_GetCurrency.ID | |API_GetCurrency.ID | ||
|- | |- | ||
|Note | |@Note | ||
|nvarchar(50) | |nvarchar(50) | ||
| | | | ||
| Řádek 250: | Řádek 250: | ||
| | | | ||
|- | |- | ||
|VATRate | |@VATRate | ||
|decimal(18,2) | |decimal(18,2) | ||
| | | | ||
| Řádek 256: | Řádek 256: | ||
| | | | ||
|- | |- | ||
|HistoryInfo | |@HistoryInfo | ||
|nvarchar(300) | |nvarchar(300) | ||
| | | | ||
| Řádek 262: | Řádek 262: | ||
| | | | ||
|- | |- | ||
|ActionPrice | |@ActionPrice | ||
|int | |int | ||
| | | | ||
| Řádek 268: | Řádek 268: | ||
| | | | ||
|- | |- | ||
|ChildPricePerPieceInCurrency | |@ChildPricePerPieceInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 274: | Řádek 274: | ||
| | | | ||
|- | |- | ||
|ChildPricePerPieceWithVATInCurrency | |@ChildPricePerPieceWithVATInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 280: | Řádek 280: | ||
| | | | ||
|- | |- | ||
|ChildPurchasePricePerPieceInCurrency | |@ChildPurchasePricePerPieceInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 286: | Řádek 286: | ||
| | | | ||
|- | |- | ||
|ChildPurchasePricePerPieceWithVATInCurrency | |@ChildPurchasePricePerPieceWithVATInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
| Řádek 292: | Řádek 292: | ||
| | | | ||
|- | |- | ||
|ChildDiscountInCurrency | |@ChildDiscountInCurrency | ||
|decimal(18,3) | |decimal(18,3) | ||
| | | | ||
|Child discount in currency | |Child discount in currency | ||
||} | | | ||
|} | |||
==== Return ==== | |||
0 : OK | |||
100 : Item could not be created | |||
==== Example ==== | ==== Example ==== | ||
<syntaxhighlight lang="sql"> | <syntaxhighlight lang="sql"> | ||
EXEC [ | DECLARE @return_value int | ||
EXEC @return_value = [API_CreateShopBasket] @CustomerID= 12 ,@CustomerWorkshopID= 12 ,@GroupID= 32 ,@ProductID= 34 ,@StorageCardID= -1 ,@OrderID= -1 ,@GroupCode= 'OP570' ,@ProductCode= 'A000000034' ,@ManufacturerCode= 'OP570' ,@SupplierCode= 'A000000034' ,@Brand= 'FILTRON' ,@Desription= 'Oil filter' ,@OrderedQuantity= 8 ,@PricePerPiece= 6.743 ,@PricePerPieceWithVAT= 8.29 ,@PurchasePricePerPiece= 5.348 ,@PurchasePricePerPieceWithVAT= 6.58 ,@TotalPrice= 53.94 ,@TotalPriceWithVAT= 66.32 ,@TotalPurchasePrice= 42.78 ,@TotalPurchasePriceWithVAT= 52.64 ,@DiscountInPercent= 20.7 ,@DiscountPrice= -11.16 ,@SurchargesPrice= 0 ,@SurchargePriceWithVAT= 0 ,@PricePerPieceInCurrency= 6.740 ,@PricePerPieceWithVATInCurrency= 8.290 ,@PurchasePricePerPieceInCurrency= 5.350 ,@PurchasePricePerPieceWithVATInCurrency= 6.580 ,@TotalPriceInCurrency= 53.920 ,@TotalPriceWithVATInCurrency= 66.320 ,@TotalPurchasePriceInCurrency= 42.800 ,@TotalPurchasePriceWithVATInCurrency= 52.640 ,@DiscountPriceInCurrency= -1.390 ,@SurchargesPriceInCurrency= 0 ,@SurchargesPriceWithVATInCurrency= 0 ,@CurrencyID= 16034 ,@ForeignCurrencyID= 16034 ,@Note= '',@VATRate= 23.00 ,@HistoryInfo= '' ,@ActionPrice= 0 ,@ChildPricePerPieceInCurrency= -1.000 ,@ChildPricePerPieceWithVATInCurrency= -1.000 ,@ChildPurchasePricePerPieceInCurrency= -1.000 ,@ChildPurchasePricePerPieceWithVATInCurrency= -1.000 ,@ChildDiscountInCurrency= -1.000 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Notices ==== | ==== Notices ==== | ||
None. | None.|} | ||
Aktuální verze z 22. 9. 2017, 08:21
Description
Method allows You to create new basket item in system.
Exact name
API_CreateBasketItem
Type
Standard executable stored procedure.
Specification
| Parameter | Data type | Value range | Description | Relation |
|---|---|---|---|---|
| @CustomerID | int | ID of customer from customers list (see relation) | API_GetCustomers.ID | |
| @CustomerWorkshopID | int | ID of workshops from workshops list (see relation) | API_GetWorkshops.ID = API_GetCustomers.WorkshopID | |
| @GroupID | int | ID of product groups from product groups list (see relation) | API_GetProductGroups.ID | |
| @ProductID | int | ID of product from product list (see relation) | API_GetProducts.ID | |
| @StorageCardID | int | ID of stock dispositions from stock dispositions list (see relation) | API_GetStockDispositions.ID | |
| @OrderID | int | ID of orders from orders list (see relation) | API_GetOrders.ID | |
| @GroupCode | nvarchar(40) | Group code | ||
| @ProductCode | nvarchar(40) | Product code | ||
| @ManufacturerCode | nvarchar(40) | Manufacturer code | ||
| @SupplierCode | nvarchar(40) | Supplier code | ||
| @Brand | nvarchar(50) | Brand | ||
| @Desription | nvarchar(250) | Desription | ||
| @OrderedQuantity | decimal(18,2) | Ordered quantity | ||
| @PricePerPiece | decimal(18,3) | Price per piece | ||
| @PricePerPieceWithVAT | decimal(18,3) | Price per piece with VAT | ||
| @PurchasePricePerPiece | decimal(18,3) | Purchase price per piece | ||
| @PurchasePricePerPieceWithVAT | decimal(18,3) | Purchase price per piece with VAT | ||
| @TotalPrice | decimal(18,3) | Total price | ||
| @TotalPriceWithVAT | decimal(18,3) | Total price with VAT | ||
| @TotalPurchasePrice | decimal(18,3) | Total purchase Price | ||
| @TotalPurchasePriceWithVAT | decimal(18,3) | Total purchase price with VAT | ||
| @DiscountInPercent | decimal(18,3) | DiscountIn percent | ||
| @DiscountPrice | decimal(18,3) | Discount price | ||
| @SurchargesPrice | decimal(18,2) | Surcharges price | ||
| @SurchargePriceWithVAT | decimal(18,2) | Surcharge price with VAT | ||
| @PricePerPieceInCurrency | decimal(18,3) | Price per piece in currency | ||
| @PricePerPieceWithVATInCurrency | decimal(18,3) | Price per piece with VAT in currency | ||
| @PurchasePricePerPieceInCurrency | decimal(18,3) | Purchase price per piece in currency | ||
| @PurchasePricePerPieceWithVATInCurrency | decimal(18,3) | Purchase price per piece with VAT in currency | ||
| @TotalPriceInCurrency | decimal(18,3) | Total price in currency | ||
| @TotalPriceWithVATInCurrency | decimal(18,3) | Total price with VAT in currency | ||
| @TotalPurchasePriceInCurrency | decimal(18,3) | Total purchase price in currency | ||
| @TotalPurchasePriceWithVATInCurrency | decimal(18,3) | Total purchase price with VAT in currency | ||
| @DiscountPriceInCurrency | decimal(18,3) | Discount price in currency | ||
| @SurchargesPriceInCurrency | decimal(18,3) | Surcharges price in currency | ||
| @SurchargesPriceWithVATInCurrency | decimal(18,3) | Surcharges price with VAT in currency | ||
| @CurrencyID | int | ID of currency from currency list (see relation) | API_GetCurrency.ID | |
| @ForeignCurrencyID | int | ID of currency from currency list (see relation) | API_GetCurrency.ID | |
| @Note | nvarchar(50) | Note | ||
| @VATRate | decimal(18,2) | VAT rate | ||
| @HistoryInfo | nvarchar(300) | History info | ||
| @ActionPrice | int | Action price | ||
| @ChildPricePerPieceInCurrency | decimal(18,3) | Child price per piece in currency | ||
| @ChildPricePerPieceWithVATInCurrency | decimal(18,3) | Child price per piece with VAT in currency | ||
| @ChildPurchasePricePerPieceInCurrency | decimal(18,3) | Child purchase price per piece in currency | ||
| @ChildPurchasePricePerPieceWithVATInCurrency | decimal(18,3) | Child purchase price per piece with VAT in currency | ||
| @ChildDiscountInCurrency | decimal(18,3) | Child discount in currency |
Return
0 : OK 100 : Item could not be created
Example
DECLARE @return_value int
EXEC @return_value = [API_CreateShopBasket] @CustomerID= 12 ,@CustomerWorkshopID= 12 ,@GroupID= 32 ,@ProductID= 34 ,@StorageCardID= -1 ,@OrderID= -1 ,@GroupCode= 'OP570' ,@ProductCode= 'A000000034' ,@ManufacturerCode= 'OP570' ,@SupplierCode= 'A000000034' ,@Brand= 'FILTRON' ,@Desription= 'Oil filter' ,@OrderedQuantity= 8 ,@PricePerPiece= 6.743 ,@PricePerPieceWithVAT= 8.29 ,@PurchasePricePerPiece= 5.348 ,@PurchasePricePerPieceWithVAT= 6.58 ,@TotalPrice= 53.94 ,@TotalPriceWithVAT= 66.32 ,@TotalPurchasePrice= 42.78 ,@TotalPurchasePriceWithVAT= 52.64 ,@DiscountInPercent= 20.7 ,@DiscountPrice= -11.16 ,@SurchargesPrice= 0 ,@SurchargePriceWithVAT= 0 ,@PricePerPieceInCurrency= 6.740 ,@PricePerPieceWithVATInCurrency= 8.290 ,@PurchasePricePerPieceInCurrency= 5.350 ,@PurchasePricePerPieceWithVATInCurrency= 6.580 ,@TotalPriceInCurrency= 53.920 ,@TotalPriceWithVATInCurrency= 66.320 ,@TotalPurchasePriceInCurrency= 42.800 ,@TotalPurchasePriceWithVATInCurrency= 52.640 ,@DiscountPriceInCurrency= -1.390 ,@SurchargesPriceInCurrency= 0 ,@SurchargesPriceWithVATInCurrency= 0 ,@CurrencyID= 16034 ,@ForeignCurrencyID= 16034 ,@Note= '',@VATRate= 23.00 ,@HistoryInfo= '' ,@ActionPrice= 0 ,@ChildPricePerPieceInCurrency= -1.000 ,@ChildPricePerPieceWithVATInCurrency= -1.000 ,@ChildPurchasePricePerPieceInCurrency= -1.000 ,@ChildPurchasePricePerPieceWithVATInCurrency= -1.000 ,@ChildDiscountInCurrency= -1.000
Notices
None.|}