API CreateDeliveryNote: Porovnání verzí

Z Podpora.nextis.cz
Přejít na: navigace, hledání
Řádka 354: Řádka 354:
 
==== Example ====
 
==== Example ====
 
<syntaxhighlight lang="sql">
 
<syntaxhighlight lang="sql">
 +
DECLARE @return_value int
 
DECLARE @d datetime
 
DECLARE @d datetime
 
set @d = getdate()
 
set @d = getdate()
  
DECLARE @return_value int
 
 
  EXEC @return_value = [API_CreateDeliveryNote] @StockID= 1 ,@BranchID= 1 ,@SupplierID= 10 ,@OrdererID= 10 ,@RecipientID= 10 ,@TransportID= -1 ,@PaymentTypeID= 1 ,@CurrencyID= 16034 ,@Number= 'WZ-0001' ,@Date= @d ,@OrdererName= 'OrdererName' ,@OrdererStreet= 'OrdererStreet' ,@OrdererCity= 'OrdererCity' ,@OrdererZIPCode= 'OrdererZIPCode' ,@OrdererCountry= 'OrdererCountry' ,@OrdererRegion= 'OrdererRegion' ,@OrdererState= 'OrdererState' ,@CompanyRegistrationNumber= 'CompanyRegistrationNumber' ,@VATNumber= 'VATNumber' ,@RecipientName= 'RecipientName' ,@RecipientStreet= 'RecipientStreet' ,@RecipientCity= 'RecipientCity' ,@RecipientZIPCode= 'RecipientZIPCode' ,@RecipientCountry= 'RecipientCountry' ,@RecipientRegion= 'RecipientRegion' ,@RecipientState= 'RecipientState' ,@RecipientNote= 'RecipientNote' ,@IsCanceled= 0 ,@IsCancelReason= '' ,@IsCancelDate= NULL ,@Note= '' ,@OrdererPhone= 'OrdererPhone' ,@OrdererFax= 'OrdererFax' ,@OrdererMobilePhone= 'OrdererMobilePhone' ,@OrdererEmail= 'OrdererEmail' ,@OrdererUrl= 'OrdererUrl' ,@RecipientPhone= 'RecipientPhone' ,@RecipientFax= 'RecipientFax' ,@RecipientMobilePhone= 'RecipientMobilePhone' ,@RecipientEmail= 'RecipientEmail' ,@RecipientUrl= 'RecipientUrl' ,@RecipientCompanyRegistrationNumber= 'RecipientCompanyRegistrationNumber' ,@RecipientVATNumber= 'RecipientVATNumber' ,@OrdererBankName= 'OrdererBankName' ,@OrdererBankAccount= 'OrdererBankAccount' ,@OrdererVATNumber2= 'OrdererVATNumber2' ,@RecipientVATNumber2= 'RecipientVATNumber2' ,@IsPrinted= 0 ,@PrintedDate= NULL ,@StornoDocument= -1 ,@StornoDocumentOriginID= -1 ,@CurrencyInCurrencyID= 16034 ,@ExchangeRate= 1
 
  EXEC @return_value = [API_CreateDeliveryNote] @StockID= 1 ,@BranchID= 1 ,@SupplierID= 10 ,@OrdererID= 10 ,@RecipientID= 10 ,@TransportID= -1 ,@PaymentTypeID= 1 ,@CurrencyID= 16034 ,@Number= 'WZ-0001' ,@Date= @d ,@OrdererName= 'OrdererName' ,@OrdererStreet= 'OrdererStreet' ,@OrdererCity= 'OrdererCity' ,@OrdererZIPCode= 'OrdererZIPCode' ,@OrdererCountry= 'OrdererCountry' ,@OrdererRegion= 'OrdererRegion' ,@OrdererState= 'OrdererState' ,@CompanyRegistrationNumber= 'CompanyRegistrationNumber' ,@VATNumber= 'VATNumber' ,@RecipientName= 'RecipientName' ,@RecipientStreet= 'RecipientStreet' ,@RecipientCity= 'RecipientCity' ,@RecipientZIPCode= 'RecipientZIPCode' ,@RecipientCountry= 'RecipientCountry' ,@RecipientRegion= 'RecipientRegion' ,@RecipientState= 'RecipientState' ,@RecipientNote= 'RecipientNote' ,@IsCanceled= 0 ,@IsCancelReason= '' ,@IsCancelDate= NULL ,@Note= '' ,@OrdererPhone= 'OrdererPhone' ,@OrdererFax= 'OrdererFax' ,@OrdererMobilePhone= 'OrdererMobilePhone' ,@OrdererEmail= 'OrdererEmail' ,@OrdererUrl= 'OrdererUrl' ,@RecipientPhone= 'RecipientPhone' ,@RecipientFax= 'RecipientFax' ,@RecipientMobilePhone= 'RecipientMobilePhone' ,@RecipientEmail= 'RecipientEmail' ,@RecipientUrl= 'RecipientUrl' ,@RecipientCompanyRegistrationNumber= 'RecipientCompanyRegistrationNumber' ,@RecipientVATNumber= 'RecipientVATNumber' ,@OrdererBankName= 'OrdererBankName' ,@OrdererBankAccount= 'OrdererBankAccount' ,@OrdererVATNumber2= 'OrdererVATNumber2' ,@RecipientVATNumber2= 'RecipientVATNumber2' ,@IsPrinted= 0 ,@PrintedDate= NULL ,@StornoDocument= -1 ,@StornoDocumentOriginID= -1 ,@CurrencyInCurrencyID= 16034 ,@ExchangeRate= 1
 
</syntaxhighlight>
 
</syntaxhighlight>

Verze z 22. 9. 2017, 09:29

Description

Method allows You to create new delivery note in system.

Exact name

API_CreateDeliveryNote

Type

Standard executable stored procedure.

Specification

Parameter Data type Value range Description Relation
@StockID int ID of stock from stock list (see relation) API_GetStocks.ID
@BranchID int ID of branch from branch list (see relation) API_GetBranches.ID
@SupplierID int ID of customer from customer list (see relation) API_GetCustomers.ID
@OrdererID int ID of customer from customer list (see relation) API_GetCustomers.ID
@RecipientID int ID of customer from customer list (see relation) API_GetCustomers.ID
@TransportID int ID of transport from transport list (see relation) API_GetTransports.ID
@PaymentTypeID int Payment type ID.

-1 - _NA

1 - Cash

2 - WireTransfer

3 - CreditCard

4 - Before

5 - Voucher

6 - CashOnDelivery

@CurrencyID int ID of currency from currency list (see relation) API_GetCurrency.ID
@Number varchar(25) Number
@Date datetime Date
@OrdererName varchar(140) Orderer name
@OrdererStreet varchar(100) Orderer street
@OrdererCity varchar(140) Orderer city
@OrdererZIPCode char(10) Orderer ZIP code
@OrdererCountry varchar(50) Orderer country
@OrdererRegion varchar(30) Orderer region
@OrdererState varchar(50) Orderer state
@CompanyRegistrationNumber char(20) Company registration number
@VATNumber char(20) VAT number
@RecipientName varchar(140) Recipient name
@RecipientStreet varchar(100) Recipient street
@RecipientCity varchar(140) Recipient city
@RecipientZIPCode char(10) Recipient ZIP code
@RecipientCountry varchar(50) Recipient country
@RecipientRegion varchar(30) Recipient region
@RecipientState varchar(50) Recipient state
@RecipientNote nvarchar(250) Recipient note
@IsCanceled int Is canceled
@IsCancelReason varchar(150) Is cancel reason
@IsCancelDate datetime Is cancel date
@Note varchar(300) Note
@OrdererPhone nvarchar(30) Orderer phone
@OrdererFax nvarchar(30) Orderer fax
@OrdererMobilePhone nvarchar(30) Orderer mobile phone
@OrdererEmail nvarchar(60) Orderer email
@OrdererUrl nvarchar(50) Orderer url
@RecipientPhone nvarchar(30) Recipient phone
@RecipientFax nvarchar(30) Recipient fax
@RecipientMobilePhone nvarchar(30) Recipient mobile phone
@RecipientEmail nvarchar(60) Recipient email
@RecipientUrl nvarchar(50) Recipient url
@RecipientCompanyRegistrationNumber char(20) Recipient company registration number
@RecipientVATNumber char(20) Recipient VAT number
@OrdererBankName nvarchar(120) Orderer bank name
@OrdererBankAccount nvarchar(50) Orderer bank account
@OrdererVATNumber2 char(20) Orderer VAT number 2
@RecipientVATNumber2 char(20) Recipient VAT number 2
@IsPrinted int Is printed
@PrintedDate date Printed date
@StornoDocument int Storno document
@StornoDocumentOriginID int ID of delivery note from delivery note list (see relation) API_GetDeliveryNote.ID
@CurrencyInCurrencyID int ID of currency from currency list (see relation) API_GetCurrency.ID
@ExchangeRate decimal(18,2) Exchange rate

Return

0 : OK
100 : Item could not be created

Example

DECLARE @return_value int
DECLARE @d datetime
set @d = getdate()

 EXEC @return_value = [API_CreateDeliveryNote] @StockID= 1 ,@BranchID= 1 ,@SupplierID= 10 ,@OrdererID= 10 ,@RecipientID= 10 ,@TransportID= -1 ,@PaymentTypeID= 1 ,@CurrencyID= 16034 ,@Number= 'WZ-0001' ,@Date= @d ,@OrdererName= 'OrdererName' ,@OrdererStreet= 'OrdererStreet' ,@OrdererCity= 'OrdererCity' ,@OrdererZIPCode= 'OrdererZIPCode' ,@OrdererCountry= 'OrdererCountry' ,@OrdererRegion= 'OrdererRegion' ,@OrdererState= 'OrdererState' ,@CompanyRegistrationNumber= 'CompanyRegistrationNumber' ,@VATNumber= 'VATNumber' ,@RecipientName= 'RecipientName' ,@RecipientStreet= 'RecipientStreet' ,@RecipientCity= 'RecipientCity' ,@RecipientZIPCode= 'RecipientZIPCode' ,@RecipientCountry= 'RecipientCountry' ,@RecipientRegion= 'RecipientRegion' ,@RecipientState= 'RecipientState' ,@RecipientNote= 'RecipientNote' ,@IsCanceled= 0 ,@IsCancelReason= '' ,@IsCancelDate= NULL ,@Note= '' ,@OrdererPhone= 'OrdererPhone' ,@OrdererFax= 'OrdererFax' ,@OrdererMobilePhone= 'OrdererMobilePhone' ,@OrdererEmail= 'OrdererEmail' ,@OrdererUrl= 'OrdererUrl' ,@RecipientPhone= 'RecipientPhone' ,@RecipientFax= 'RecipientFax' ,@RecipientMobilePhone= 'RecipientMobilePhone' ,@RecipientEmail= 'RecipientEmail' ,@RecipientUrl= 'RecipientUrl' ,@RecipientCompanyRegistrationNumber= 'RecipientCompanyRegistrationNumber' ,@RecipientVATNumber= 'RecipientVATNumber' ,@OrdererBankName= 'OrdererBankName' ,@OrdererBankAccount= 'OrdererBankAccount' ,@OrdererVATNumber2= 'OrdererVATNumber2' ,@RecipientVATNumber2= 'RecipientVATNumber2' ,@IsPrinted= 0 ,@PrintedDate= NULL ,@StornoDocument= -1 ,@StornoDocumentOriginID= -1 ,@CurrencyInCurrencyID= 16034 ,@ExchangeRate= 1

Notices

None.