API CreateOrder: Porovnání verzí
Z Podpora.nextis.cz
(Založena nová stránka s textem „==== Description ==== Method allows You to create new order in system. ==== Exact name ==== <code>API_CreateOrder</code> ==== Type ==== Standard executab…“) |
|||
(Není zobrazeno 8 mezilehlých verzí od stejného uživatele.) | |||
Řádka 27: | Řádka 27: | ||
| | | | ||
|Currency ID | |Currency ID | ||
− | | | + | |API_GetCurrency.ID |
|- | |- | ||
|@CurrencyInCurrencyID | |@CurrencyInCurrencyID | ||
Řádka 33: | Řádka 33: | ||
| | | | ||
|Currency in currency ID | |Currency in currency ID | ||
− | | | + | |API_GetCurrency.ID |
|- | |- | ||
|@ExchangeRate | |@ExchangeRate | ||
Řádka 45: | Řádka 45: | ||
| | | | ||
|Customer branch ID | |Customer branch ID | ||
− | | | + | |API_GetCustomers.ID |
|- | |- | ||
|@PaymentMethodID | |@PaymentMethodID | ||
Řádka 51: | Řádka 51: | ||
| | | | ||
|Payment method ID | |Payment method ID | ||
+ | 1 - Cash, | ||
+ | 2 - Transfer, | ||
+ | 3 - CardPersonally, | ||
+ | 4 - Before, | ||
+ | 5 - Voucher, | ||
+ | 6 - DeliveryCash, | ||
+ | 7 - GoPay, | ||
+ | 8 - Payout | ||
| | | | ||
|- | |- | ||
Řádka 69: | Řádka 77: | ||
| | | | ||
|Transport ID | |Transport ID | ||
− | | | + | |API_GetTransports.ID |
|- | |- | ||
|@ExpeditionID | |@ExpeditionID | ||
Řádka 75: | Řádka 83: | ||
| | | | ||
|Expedition ID | |Expedition ID | ||
+ | 1 - Immediately, | ||
+ | 2 - Entire only | ||
| | | | ||
|- | |- | ||
Řádka 80: | Řádka 90: | ||
|int | |int | ||
| | | | ||
− | | | + | |Pause warehouse release (manually authorization required) |
+ | 0 - OFF | ||
+ | 1 - ON | ||
| | | | ||
|- | |- | ||
Řádka 93: | Řádka 105: | ||
| | | | ||
|Order type ID | |Order type ID | ||
+ | -1 - NA | ||
+ | 0 - Personal, | ||
+ | 1 - Warehouse, | ||
+ | 2 - Intraday, | ||
+ | 5 - Common, | ||
+ | 6 - Warehouse (producer), | ||
+ | 500 - Manufacturing (Assembly) | ||
| | | | ||
|- | |- | ||
Řádka 99: | Řádka 118: | ||
| | | | ||
|Separated document | |Separated document | ||
+ | 0 - OFF | ||
+ | 1 - ON | ||
| | | | ||
|- | |- | ||
Řádka 105: | Řádka 126: | ||
| | | | ||
|Final document type ID | |Final document type ID | ||
+ | 0 - OFF | ||
+ | 5 - Receipt, | ||
+ | 1 - Bank transfer invoice, | ||
+ | 2 - Cash invoice, | ||
+ | 10 - Delivery note | ||
| | | | ||
|- | |- | ||
Řádka 111: | Řádka 137: | ||
| | | | ||
|Wait for next order | |Wait for next order | ||
+ | 0 - OFF | ||
+ | 1 - ON | ||
| | | | ||
|- | |- | ||
Řádka 117: | Řádka 145: | ||
| | | | ||
|Add deposits | |Add deposits | ||
+ | 0 - NO | ||
+ | 1 - YES | ||
| | | | ||
|- | |- | ||
Řádka 123: | Řádka 153: | ||
| | | | ||
|Do not order from supplier | |Do not order from supplier | ||
+ | 0 - Deactivated, | ||
+ | 1 - Activated, | ||
+ | -1 - Automatic | ||
+ | | | ||
+ | |- | ||
+ | |@OtherShippingAddress | ||
+ | |bit | ||
+ | | | ||
+ | |Other shipping address | ||
+ | 0 - NO | ||
+ | 1 - YES | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientName | ||
+ | |nvarchar(140) | ||
+ | | | ||
+ | |Recipient name | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientStreet | ||
+ | |nvarchar(100) | ||
+ | | | ||
+ | |Recipient street | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientCity | ||
+ | |nvarchar(140) | ||
+ | | | ||
+ | |Recipient city | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientPostal | ||
+ | |nvarchar(10) | ||
+ | | | ||
+ | |Recipient postal | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientDistrict | ||
+ | |nvarchar(150) | ||
+ | | | ||
+ | |Recipient district | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientProvince | ||
+ | |nvarchar(30) | ||
+ | | | ||
+ | |Recipient province | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientStat | ||
+ | |nvarchar(50) | ||
+ | | | ||
+ | |Recipient stat | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientRegNo | ||
+ | |nvarchar(20) | ||
+ | | | ||
+ | |Recipient Reg. No. | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientTAX | ||
+ | |nvarchar(20) | ||
+ | | | ||
+ | |Recipient TAX | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientTelephone | ||
+ | |nvarchar(30) | ||
+ | | | ||
+ | |Recipient telephone | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientFax | ||
+ | |nvarchar(30) | ||
+ | | | ||
+ | |Recipient fax | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientPhone | ||
+ | |nvarchar(30) | ||
+ | | | ||
+ | |Recipient phone | ||
+ | | | ||
+ | |- | ||
+ | |@RecipientEmail | ||
+ | |nvarchar(60) | ||
+ | | | ||
+ | |Recipient email | ||
| | | | ||
|- | |- | ||
Řádka 156: | Řádka 275: | ||
| | | | ||
|Supplier ID | |Supplier ID | ||
− | | | + | -1 - Automatic selection |
+ | |API_GetCustomers.ID | ||
|- | |- | ||
|Quantity | |Quantity | ||
Řádka 190: | Řádka 310: | ||
Insert INTO @OrderItems | Insert INTO @OrderItems | ||
SELECT 232157, -1, 2, 300, 370 | SELECT 232157, -1, 2, 300, 370 | ||
− | Union | + | Union all |
SELECT 5650223, -1, 1, 20, 30 | SELECT 5650223, -1, 1, 20, 30 | ||
Řádka 212: | Řádka 332: | ||
@AddDeposits = 0, | @AddDeposits = 0, | ||
@DoNotOrderFromSupplier = -1, | @DoNotOrderFromSupplier = -1, | ||
+ | @OtherShippingAddress = 1, | ||
+ | @RecipientName = 'Test Name', | ||
+ | @RecipientStreet = 'Street', | ||
+ | @RecipientCity = 'City', | ||
+ | @RecipientPostal = '00-320', | ||
+ | @RecipientDistrict = '', | ||
+ | @RecipientProvince = '', | ||
+ | @RecipientStat = 'Polska', | ||
+ | @RecipientRegNo = '', | ||
+ | @RecipientTAX = '', | ||
+ | @RecipientTelephone = '', | ||
+ | @RecipientFax = '', | ||
+ | @RecipientPhone = '123-456-789', | ||
+ | @RecipientEmail = '', | ||
@OrderItems = @OrderItems, | @OrderItems = @OrderItems, | ||
@OrderNo = @_OrderNo OUTPUT, | @OrderNo = @_OrderNo OUTPUT, |
Aktuální verze z 6. 11. 2020, 16:20
Obsah
Description
Method allows You to create new order in system.
Exact name
API_CreateOrder
Type
Standard executable stored procedure with table-Valued Parameters.
Specification
Parameter | Data type | Value range | Description | Relation |
---|---|---|---|---|
@Series | nvarchar(10) | Series number starts. Format: Series+Year+Auto Increment Number | ||
@CurrencyID | int | Currency ID | API_GetCurrency.ID | |
@CurrencyInCurrencyID | int | Currency in currency ID | API_GetCurrency.ID | |
@ExchangeRate | decimal(18,6) | Exchange rate | ||
@CustomerBranchID | int | Customer branch ID | API_GetCustomers.ID | |
@PaymentMethodID | int | Payment method ID
1 - Cash, 2 - Transfer, 3 - CardPersonally, 4 - Before, 5 - Voucher, 6 - DeliveryCash, 7 - GoPay, 8 - Payout |
||
@SupplierOrderNo | nvarchar(80) | Supplier Order Number | ||
@Note | nvarchar(600) | Note | ||
@TransportID | int | Transport ID | API_GetTransports.ID | |
@ExpeditionID | int | Expedition ID
1 - Immediately, 2 - Entire only |
||
@LockRelease | int | Pause warehouse release (manually authorization required)
0 - OFF 1 - ON |
||
@RealizationDate | datetime | Realization Date | ||
@OrderTypeID | int | Order type ID
-1 - NA 0 - Personal, 1 - Warehouse, 2 - Intraday, 5 - Common, 6 - Warehouse (producer), 500 - Manufacturing (Assembly) |
||
@SeparatedDocument | int | Separated document
0 - OFF 1 - ON |
||
@FinalDocumentTypeID | int | Final document type ID
0 - OFF 5 - Receipt, 1 - Bank transfer invoice, 2 - Cash invoice, 10 - Delivery note |
||
@WaitForNextOrder | int | Wait for next order
0 - OFF 1 - ON |
||
@AddDeposits | bit | Add deposits
0 - NO 1 - YES |
||
@DoNotOrderFromSupplier | int | Do not order from supplier
0 - Deactivated, 1 - Activated, -1 - Automatic |
||
@OtherShippingAddress | bit | Other shipping address
0 - NO 1 - YES |
||
@RecipientName | nvarchar(140) | Recipient name | ||
@RecipientStreet | nvarchar(100) | Recipient street | ||
@RecipientCity | nvarchar(140) | Recipient city | ||
@RecipientPostal | nvarchar(10) | Recipient postal | ||
@RecipientDistrict | nvarchar(150) | Recipient district | ||
@RecipientProvince | nvarchar(30) | Recipient province | ||
@RecipientStat | nvarchar(50) | Recipient stat | ||
@RecipientRegNo | nvarchar(20) | Recipient Reg. No. | ||
@RecipientTAX | nvarchar(20) | Recipient TAX | ||
@RecipientTelephone | nvarchar(30) | Recipient telephone | ||
@RecipientFax | nvarchar(30) | Recipient fax | ||
@RecipientPhone | nvarchar(30) | Recipient phone | ||
@RecipientEmail | nvarchar(60) | Recipient email | ||
@OrderNo | nvarchar(25) | Order number OUTPUT | ||
@OrderID | int | Order ID OUTPUT |
Table-Valued Parameters Specification
Columns name | Data type | Value range | Description | Relation |
---|---|---|---|---|
ProduktGroupID | int | ProduktGroupID | API_GetProductGroups.ID | |
SupplierID | int | Supplier ID
-1 - Automatic selection |
API_GetCustomers.ID | |
Quantity | decimal(14,2) | Quantity | ||
PurchasePriceInCurrency | decimal(19,6) | Purchase price in currency | ||
PurchasePriceAfterDiscountInCurrency | decimal(19,6) | Purchase price after discount in currency |
Return
Number : OK - Number of added items -100 : Order could not be created
Example
DECLARE @return_value int
Declare @OrderItems dbo.ApiOrderItems
Declare @_OrderNo nvarchar(25)
Declare @_OrderID int
Insert INTO @OrderItems
SELECT 232157, -1, 2, 300, 370
Union all
SELECT 5650223, -1, 1, 20, 30
exec @return_value = dbo.[API_CreateOrder]
@Series = 'ORD',
@CurrencyID = 16034,
@CurrencyInCurrencyID = 16034,
@ExchangeRate = 1,
@CustomerBranchID = 75,
@PaymentMethodID = 2,
@SupplierOrderNo = '',
@Note = 'Some note',
@TransportID = 2,
@ExpeditionID = 1,
@LockRelease = 0,
@RealizationDate = -1,
@OrderTypeID = 0,
@SeparatedDocument = 0,
@FinalDocumentTypeID = 0,
@WaitForNextOrder = 0,
@AddDeposits = 0,
@DoNotOrderFromSupplier = -1,
@OtherShippingAddress = 1,
@RecipientName = 'Test Name',
@RecipientStreet = 'Street',
@RecipientCity = 'City',
@RecipientPostal = '00-320',
@RecipientDistrict = '',
@RecipientProvince = '',
@RecipientStat = 'Polska',
@RecipientRegNo = '',
@RecipientTAX = '',
@RecipientTelephone = '',
@RecipientFax = '',
@RecipientPhone = '123-456-789',
@RecipientEmail = '',
@OrderItems = @OrderItems,
@OrderNo = @_OrderNo OUTPUT,
@OrderID = @_OrderID OUTPUT
Select @return_value, @_OrderNo, @_OrderID
Notices
API_CreateOrder procedure uses own data type called OrderItems (dbo.ApiOrderItems).