API CreateCustomer: Porovnání verzí
Z Podpora.nextis.cz
(Založena nová stránka s textem „==== Description ==== Method allows You to create new customer in system. ==== Exact name ==== <code>API_CreateCustomer</code> ==== Type ==== Standard ex…“) |
|||
(Není zobrazeno 9 mezilehlých verzí od stejného uživatele.) | |||
Řádka 16: | Řádka 16: | ||
!Relation | !Relation | ||
|- | |- | ||
− | | | + | |@ShortName |
− | | | + | |nvarchar(30) |
− | |||
| | | | ||
− | |||
− | |||
− | |||
|Short name | |Short name | ||
| | | | ||
|- | |- | ||
− | |CompanyName | + | |@CompanyName |
|nvarchar(250) | |nvarchar(250) | ||
+ | | | ||
|Company name | |Company name | ||
| | | | ||
|- | |- | ||
− | |CompanyRegistrationNumber | + | |@CompanyRegistrationNumber |
|nvarchar(20) | |nvarchar(20) | ||
+ | | | ||
|Company registration number | |Company registration number | ||
| | | | ||
|- | |- | ||
− | |VATNumber | + | |@VATNumber |
|nvarchar(20) | |nvarchar(20) | ||
+ | | | ||
|VAT number | |VAT number | ||
| | | | ||
|- | |- | ||
− | |VATNumber2 | + | |@VATNumber2 |
|nvarchar(15) | |nvarchar(15) | ||
+ | | | ||
|VAT number 2 | |VAT number 2 | ||
| | | | ||
|- | |- | ||
− | |VATPayer | + | |@VATPayer |
|int | |int | ||
+ | | | ||
|VATPayer | |VATPayer | ||
| | | | ||
|- | |- | ||
− | |TransportID | + | |@TransportID |
|int | |int | ||
+ | | | ||
|ID of transport from transport list (see relation) | |ID of transport from transport list (see relation) | ||
|API_GetTransports.ID | |API_GetTransports.ID | ||
|- | |- | ||
− | |Username | + | |@Username |
|nvarchar(255) | |nvarchar(255) | ||
+ | | | ||
|Username | |Username | ||
| | | | ||
|- | |- | ||
− | |Password | + | |@Password |
|nvarchar(25) | |nvarchar(25) | ||
+ | | | ||
|Password | |Password | ||
| | | | ||
|- | |- | ||
− | |OrderConfirmationPassword | + | |@OrderConfirmationPassword |
|nvarchar(25) | |nvarchar(25) | ||
+ | | | ||
|Order confirmation password | |Order confirmation password | ||
| | | | ||
|- | |- | ||
− | |Street | + | |@Street |
|nvarchar(100) | |nvarchar(100) | ||
+ | | | ||
|Street | |Street | ||
| | | | ||
|- | |- | ||
− | |City | + | |@City |
|nvarchar(80) | |nvarchar(80) | ||
+ | | | ||
|City | |City | ||
| | | | ||
|- | |- | ||
− | |ZIPCode | + | |@ZIPCode |
|nvarchar(15) | |nvarchar(15) | ||
+ | | | ||
|ZIP code | |ZIP code | ||
| | | | ||
|- | |- | ||
− | |State | + | |@State |
|int | |int | ||
+ | | | ||
|ID of country from country list (see relation) | |ID of country from country list (see relation) | ||
|API_GetCountry.ID | |API_GetCountry.ID | ||
|- | |- | ||
− | |BranchID | + | |@BranchID |
|int | |int | ||
+ | | | ||
|ID of branche from branch list (see relation) | |ID of branche from branch list (see relation) | ||
|API_GetBranches.ID | |API_GetBranches.ID | ||
|- | |- | ||
− | |WorkshopID | + | |@WorkshopID |
|int | |int | ||
+ | | | ||
|ID of workshop from workshop list (see relation) | |ID of workshop from workshop list (see relation) | ||
|API_GetWorkshops.ID | |API_GetWorkshops.ID | ||
|- | |- | ||
− | |StockID | + | |@StockID |
|int | |int | ||
+ | | | ||
|ID of stock from stock list (see relation) | |ID of stock from stock list (see relation) | ||
|API_GetStocks.ID | |API_GetStocks.ID | ||
|- | |- | ||
− | |CurrencyID | + | |@CurrencyID |
|int | |int | ||
+ | | | ||
|ID of currency from currency list (see relation) | |ID of currency from currency list (see relation) | ||
|API_GetCurrency.ID | |API_GetCurrency.ID | ||
|- | |- | ||
− | |SendOrderConfirmationEmail | + | |@SendOrderConfirmationEmail |
|int | |int | ||
+ | | | ||
|Send order confirmation email | |Send order confirmation email | ||
| | | | ||
|- | |- | ||
− | |OrderConfirmationEmail | + | |@OrderConfirmationEmail |
|nvarchar(100) | |nvarchar(100) | ||
+ | | | ||
|Order confirmation email | |Order confirmation email | ||
| | | | ||
|- | |- | ||
− | |Email | + | |@Email |
|nvarchar(100) | |nvarchar(100) | ||
+ | | | ||
|Email | |Email | ||
| | | | ||
|- | |- | ||
− | |EshopEmails | + | |@EshopEmails |
|nvarchar(400) | |nvarchar(400) | ||
+ | | | ||
|Eshop emails | |Eshop emails | ||
| | | | ||
|- | |- | ||
− | |IsBuyer | + | |@IsBuyer |
|int | |int | ||
+ | | | ||
|Is buyer | |Is buyer | ||
| | | | ||
|- | |- | ||
− | |IsSupplier | + | |@IsSupplier |
|int | |int | ||
+ | | | ||
|Is supplier | |Is supplier | ||
| | | | ||
|- | |- | ||
− | |Region | + | |@Region |
|nvarchar(30) | |nvarchar(30) | ||
+ | | | ||
|Region | |Region | ||
| | | | ||
|- | |- | ||
− | |Country | + | |@Country |
|nvarchar(50) | |nvarchar(50) | ||
+ | | | ||
|Country | |Country | ||
| | | | ||
|- | |- | ||
− | |IsCompetition | + | |@IsCompetition |
|int | |int | ||
+ | | | ||
|Is competition | |Is competition | ||
| | | | ||
|- | |- | ||
− | |FileMarkText | + | |@FileMarkText |
|nvarchar(200) | |nvarchar(200) | ||
+ | | | ||
|File mark text | |File mark text | ||
| | | | ||
|- | |- | ||
− | |IsWSInvoicesExportAllowed | + | |@IsWSInvoicesExportAllowed |
|bit | |bit | ||
+ | | | ||
|Is WS invoices export allowed | |Is WS invoices export allowed | ||
| | | | ||
|- | |- | ||
− | |IsWSDeliveryNotesExportAllowed | + | |@IsWSDeliveryNotesExportAllowed |
|bit | |bit | ||
+ | | | ||
|Is WS delivery notes export Allowed | |Is WS delivery notes export Allowed | ||
| | | | ||
|- | |- | ||
− | |IsWSImportOrdersAllowed | + | |@IsWSImportOrdersAllowed |
|bit | |bit | ||
+ | | | ||
|Is WS import orders Allowed | |Is WS import orders Allowed | ||
| | | | ||
|- | |- | ||
− | |StoreBackOrder | + | |@StoreBackOrder |
|int | |int | ||
+ | | | ||
|Store backorder | |Store backorder | ||
| | | | ||
|- | |- | ||
− | |IsSupplierIndividualOrders | + | |@IsSupplierIndividualOrders |
|int | |int | ||
+ | | | ||
|Is supplier individual orders | |Is supplier individual orders | ||
| | | | ||
|- | |- | ||
− | |IsSupplierShortcut | + | |@IsSupplierShortcut |
|nvarchar(10) | |nvarchar(10) | ||
+ | | | ||
|Is supplier shortcut | |Is supplier shortcut | ||
| | | | ||
|- | |- | ||
− | |Note | + | |@Note |
|nvarchar(500) | |nvarchar(500) | ||
+ | | | ||
|Note | |Note | ||
| | | | ||
|- | |- | ||
− | |Note2 | + | |@Note2 |
|nvarchar(500) | |nvarchar(500) | ||
+ | | | ||
|Note 2 | |Note 2 | ||
| | | | ||
|- | |- | ||
− | |GlobalPricing | + | |@GlobalPricing |
|int | |int | ||
+ | | | ||
|Global pricing | |Global pricing | ||
| | | | ||
|- | |- | ||
− | |OrderGroup | + | |@OrderGroup |
|nvarchar(10) | |nvarchar(10) | ||
+ | | | ||
|Order group | |Order group | ||
| | | | ||
|- | |- | ||
− | |GPSLatitude | + | |@GPSLatitude |
|nvarchar(20) | |nvarchar(20) | ||
+ | | | ||
|GPS latitude | |GPS latitude | ||
| | | | ||
|- | |- | ||
− | |GPSLongitude | + | |@GPSLongitude |
|nvarchar(20) | |nvarchar(20) | ||
+ | | | ||
|GPS longitude | |GPS longitude | ||
| | | | ||
|- | |- | ||
+ | |@ParentID | ||
+ | |int | ||
+ | | | ||
|ParentID | |ParentID | ||
+ | | | ||
+ | |- | ||
+ | |@VisibleProductsAmountOnStockLimit | ||
+ | |int | ||
+ | | | ||
+ | |Visible products amount on stock limit | ||
+ | -1 = Default, | ||
+ | |||
+ | 0 = Picture, | ||
+ | |||
+ | 5 = up to 5 products, | ||
+ | |||
+ | 10 = up to 10 products, | ||
+ | |||
+ | 1000 = full amount | ||
+ | | | ||
+ | |- | ||
+ | |@AreOrdersVisible | ||
|int | |int | ||
− | | | + | | |
+ | |Are visible orders: | ||
+ | -1 = Default, | ||
+ | |||
+ | 0 = Off, | ||
+ | |||
+ | 1 = On | ||
+ | | | ||
+ | |- | ||
+ | |@DeliveryAddressID | ||
+ | |int | ||
+ | | | ||
+ | |ID of delivery address from customer list (see relation). | ||
+ | -1 = Default | ||
+ | |API_GetCustomers.ID | ||
+ | |- | ||
+ | |@DefaultPaymentType | ||
+ | |int | ||
+ | | | ||
+ | |Default payment type: | ||
+ | 0 = Default - cash, | ||
+ | |||
+ | 1 = cash, | ||
+ | |||
+ | 2 = transfer | ||
+ | | | ||
+ | |- | ||
+ | |@DueType | ||
+ | |int | ||
+ | | | ||
+ | |IF @DefaultPaymentType = 2. Due type: | ||
+ | 0 = Default - Global setting, | ||
+ | |||
+ | 1 = Global setting, | ||
+ | |||
+ | 2 = Individual setting | ||
+ | | | ||
+ | |- | ||
+ | |@DueDays | ||
+ | |int | ||
+ | | | ||
+ | |If @DefaultPaymentType = 2 and @DueType = 2. Due days: | ||
+ | 0 = Default | ||
+ | | | ||
+ | |- | ||
+ | |@CorrectionPaymentType | ||
+ | |int | ||
+ | | | ||
+ | |Correction payment type: | ||
+ | 1 = Default - cash, | ||
+ | |||
+ | 2 = transfer | ||
+ | | | ||
+ | |- | ||
+ | |@CorrectionPaymentRange | ||
+ | |int | ||
+ | | | ||
+ | |If @CorrectionPaymentType = 2. Correction payment range: | ||
+ | 0 = Default - Global setting, | ||
+ | |||
+ | 1 = Individual setting | ||
+ | | | ||
+ | |- | ||
+ | |@CorrectionPaymentRangeDays | ||
+ | |int | ||
+ | | | ||
+ | |If @CorrectionPaymentType = 2 and @CorrectionPaymentRange = 1. Correction payment range days: | ||
+ | 0 = Default | ||
| | | | ||
|} | |} | ||
+ | |||
+ | ==== Return ==== | ||
+ | 0 : OK | ||
+ | 100 : Item could not be created | ||
==== Example ==== | ==== Example ==== | ||
<syntaxhighlight lang="sql"> | <syntaxhighlight lang="sql"> | ||
− | EXEC [API_CreateCustomer] @WorkshopID = 1 ,@ | + | DECLARE @return_value int |
+ | EXEC @return_value = [API_CreateCustomer] @ShortName= 'ShortName' ,@CompanyName= 'CompanyName' ,@CompanyRegistrationNumber= 'CompanyRegistrationNumber' ,@VATNumber= 'VATNumber' ,@VATNumber2= 'VATNumber2' ,@VATPayer= 1 ,@TransportID= 1 ,@Username= 'Username' ,@Password= 'Password' ,@OrderConfirmationPassword= 'OrderConfirmationPassword' ,@Street= 'Street' ,@City= 'City' ,@ZIPCode= 'ZIPCode' ,@State= 15797 ,@BranchID= 1 ,@WorkshopID= 1 ,@StockID= 1 ,@CurrencyID= 144 ,@SendOrderConfirmationEmail= 0 ,@OrderConfirmationEmail= 'OrderConfirmationEmail' ,@Email= 'Email' ,@EshopEmails= 'EshopEmails' ,@IsBuyer= 0 ,@IsSupplier= 0 ,@Region= 'Region' ,@Country= 'Country' ,@IsCompetition= 0 ,@FileMarkText= 'FileMarkText' ,@IsWSInvoicesExportAllowed= 0 ,@IsWSDeliveryNotesExportAllowed= 0 ,@IsWSImportOrdersAllowed= 0 ,@StoreBackOrder= 0 ,@IsSupplierIndividualOrders= 0 ,@IsSupplierShortcut= 'IsSupplierShortcut' ,@Note= 'Note' ,@Note2= 'Note2' ,@GlobalPricing= 0 ,@OrderGroup= 'OrderGroup' ,@GPSLatitude= 'GPSLatitude' ,@GPSLongitude= 'GPSLongitude' ,@ParentID= -1, @VisibleProductsAmountOnStockLimit = 10, @AreOrdersVisible = 1, @DeliveryAddressID = -1, @DefaultPaymentType = 1, @DueType = 1, @DueDays = 0, @CorrectionPaymentType = 1, @CorrectionPaymentRange = 0, @CorrectionPaymentRangeDays = 0 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Notices ==== | ==== Notices ==== | ||
None. | None. |
Aktuální verze z 13. 8. 2020, 10:31
Description
Method allows You to create new customer in system.
Exact name
API_CreateCustomer
Type
Standard executable stored procedure.
Specification
Parameter | Data type | Value range | Description | Relation |
---|---|---|---|---|
@ShortName | nvarchar(30) | Short name | ||
@CompanyName | nvarchar(250) | Company name | ||
@CompanyRegistrationNumber | nvarchar(20) | Company registration number | ||
@VATNumber | nvarchar(20) | VAT number | ||
@VATNumber2 | nvarchar(15) | VAT number 2 | ||
@VATPayer | int | VATPayer | ||
@TransportID | int | ID of transport from transport list (see relation) | API_GetTransports.ID | |
@Username | nvarchar(255) | Username | ||
@Password | nvarchar(25) | Password | ||
@OrderConfirmationPassword | nvarchar(25) | Order confirmation password | ||
@Street | nvarchar(100) | Street | ||
@City | nvarchar(80) | City | ||
@ZIPCode | nvarchar(15) | ZIP code | ||
@State | int | ID of country from country list (see relation) | API_GetCountry.ID | |
@BranchID | int | ID of branche from branch list (see relation) | API_GetBranches.ID | |
@WorkshopID | int | ID of workshop from workshop list (see relation) | API_GetWorkshops.ID | |
@StockID | int | ID of stock from stock list (see relation) | API_GetStocks.ID | |
@CurrencyID | int | ID of currency from currency list (see relation) | API_GetCurrency.ID | |
@SendOrderConfirmationEmail | int | Send order confirmation email | ||
@OrderConfirmationEmail | nvarchar(100) | Order confirmation email | ||
nvarchar(100) | ||||
@EshopEmails | nvarchar(400) | Eshop emails | ||
@IsBuyer | int | Is buyer | ||
@IsSupplier | int | Is supplier | ||
@Region | nvarchar(30) | Region | ||
@Country | nvarchar(50) | Country | ||
@IsCompetition | int | Is competition | ||
@FileMarkText | nvarchar(200) | File mark text | ||
@IsWSInvoicesExportAllowed | bit | Is WS invoices export allowed | ||
@IsWSDeliveryNotesExportAllowed | bit | Is WS delivery notes export Allowed | ||
@IsWSImportOrdersAllowed | bit | Is WS import orders Allowed | ||
@StoreBackOrder | int | Store backorder | ||
@IsSupplierIndividualOrders | int | Is supplier individual orders | ||
@IsSupplierShortcut | nvarchar(10) | Is supplier shortcut | ||
@Note | nvarchar(500) | Note | ||
@Note2 | nvarchar(500) | Note 2 | ||
@GlobalPricing | int | Global pricing | ||
@OrderGroup | nvarchar(10) | Order group | ||
@GPSLatitude | nvarchar(20) | GPS latitude | ||
@GPSLongitude | nvarchar(20) | GPS longitude | ||
@ParentID | int | ParentID | ||
@VisibleProductsAmountOnStockLimit | int | Visible products amount on stock limit
-1 = Default, 0 = Picture, 5 = up to 5 products, 10 = up to 10 products, 1000 = full amount |
||
@AreOrdersVisible | int | Are visible orders:
-1 = Default, 0 = Off, 1 = On |
||
@DeliveryAddressID | int | ID of delivery address from customer list (see relation).
-1 = Default |
API_GetCustomers.ID | |
@DefaultPaymentType | int | Default payment type:
0 = Default - cash, 1 = cash, 2 = transfer |
||
@DueType | int | IF @DefaultPaymentType = 2. Due type:
0 = Default - Global setting, 1 = Global setting, 2 = Individual setting |
||
@DueDays | int | If @DefaultPaymentType = 2 and @DueType = 2. Due days:
0 = Default |
||
@CorrectionPaymentType | int | Correction payment type:
1 = Default - cash, 2 = transfer |
||
@CorrectionPaymentRange | int | If @CorrectionPaymentType = 2. Correction payment range:
0 = Default - Global setting, 1 = Individual setting |
||
@CorrectionPaymentRangeDays | int | If @CorrectionPaymentType = 2 and @CorrectionPaymentRange = 1. Correction payment range days:
0 = Default |
Return
0 : OK 100 : Item could not be created
Example
DECLARE @return_value int
EXEC @return_value = [API_CreateCustomer] @ShortName= 'ShortName' ,@CompanyName= 'CompanyName' ,@CompanyRegistrationNumber= 'CompanyRegistrationNumber' ,@VATNumber= 'VATNumber' ,@VATNumber2= 'VATNumber2' ,@VATPayer= 1 ,@TransportID= 1 ,@Username= 'Username' ,@Password= 'Password' ,@OrderConfirmationPassword= 'OrderConfirmationPassword' ,@Street= 'Street' ,@City= 'City' ,@ZIPCode= 'ZIPCode' ,@State= 15797 ,@BranchID= 1 ,@WorkshopID= 1 ,@StockID= 1 ,@CurrencyID= 144 ,@SendOrderConfirmationEmail= 0 ,@OrderConfirmationEmail= 'OrderConfirmationEmail' ,@Email= 'Email' ,@EshopEmails= 'EshopEmails' ,@IsBuyer= 0 ,@IsSupplier= 0 ,@Region= 'Region' ,@Country= 'Country' ,@IsCompetition= 0 ,@FileMarkText= 'FileMarkText' ,@IsWSInvoicesExportAllowed= 0 ,@IsWSDeliveryNotesExportAllowed= 0 ,@IsWSImportOrdersAllowed= 0 ,@StoreBackOrder= 0 ,@IsSupplierIndividualOrders= 0 ,@IsSupplierShortcut= 'IsSupplierShortcut' ,@Note= 'Note' ,@Note2= 'Note2' ,@GlobalPricing= 0 ,@OrderGroup= 'OrderGroup' ,@GPSLatitude= 'GPSLatitude' ,@GPSLongitude= 'GPSLongitude' ,@ParentID= -1, @VisibleProductsAmountOnStockLimit = 10, @AreOrdersVisible = 1, @DeliveryAddressID = -1, @DefaultPaymentType = 1, @DueType = 1, @DueDays = 0, @CorrectionPaymentType = 1, @CorrectionPaymentRange = 0, @CorrectionPaymentRangeDays = 0
Notices
None.