Documentation
¶
Index ¶
- Constants
- func VerifyUser(username string, password string, clientCode string, client *http.Client) (string, error)
- type BodyMock
- type BusinessArea
- type ClientMock
- type ConfParameter
- type ContactPerson
- type ContactPersons
- type Country
- type Currency
- type CustomerImportReport
- type CustomerImportReports
- type DocumentData
- type DocumentDatas
- type Employee
- type EmployeeProduct
- type EmployeeWarehouse
- type GetProductUnitsResponse
- type GetProductsResponse
- type GetUserRightsResponse
- type HttpClient
- type IdentityToken
- type InstallationRequest
- type InstallationResponse
- type InvoiceRow
- type InvoiceState
- type JwtToken
- type JwtTokenResponse
- type Manager
- type ObjAttribute
- type PartnerClient
- type PointOfSale
- type Product
- type ProductBrand
- type ProductCategory
- type ProductDimensions
- type ProductGroup
- type ProductImage
- type ProductRow
- type ProductRows
- type ProductUnit
- type ProductVariaton
- type Project
- type ProjectStatus
- type PurchaseDocImportReport
- type PurchaseDocImportReports
- type PurchaseDocumentConstructor
- type PurchaseDocumentConstructors
- type Records
- type SaleDocImportReport
- type SaleDocImportReports
- type SessionInfo
- type SessionKeyUser
- type SessionKeyUserResponse
- type StockInfo
- type Supplier
- type UserCredentials
- type UserRights
- type VerifyUserResponse
- type Warehouse
- type Warehouses
- type WebshopClient
Constants ¶
View Source
const ( GetSalesDocumentsMethod = "getSalesDocuments" GetCustomersMethod = "getCustomers" GetCountriesMethod = "getCountries" GetEmployeesMethod = "getEmployees" GetBusinessAreasMethod = "getBusinessAreas" GetProjectsMethod = "getProjects" GetProjectStatusesMethod = "getProjectStatuses" GetCurrenciesMethod = "getCurrencies" GetVatRatesMethod = "getVatRates" GetPaymentsMethod = "getPayments" GetUserRightsMethod = "getUserRights" GetCompanyInfoMethod = "getCompanyInfo" VerifyIdentityTokenMethod = "verifyIdentityToken" GetPointsOfSaleMethod = "getPointsOfSale" GetIdentityToken = "getIdentityToken" GetJWTTokenMethod = "getJwtToken" GetConfParametersMethod = "getConfParameters" GetWarehousesMethod = "getWarehouses" GetAddressesMethod = "getAddresses" GetProductsMethod = "getProducts" GetProductCategoriesMethod = "getProductCategories" GetProductBrandsMethod = "getBrands" GetProductGroupsMethod = "getProductGroups" GetProductUnitsMethod = "getProductUnits" VerifyCustomerUserMethod = "verifyCustomerUser" )
View Source
const ( PAID PaymentStatus = "PAID" UNPAID PaymentStatus = "UNPAID" PENDING InvoiceState = "PENDING" CARD PaymentType = "CARD" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BodyMock ¶ added in v0.3.0
BodyMock implements resp.Body
func NewFromStr ¶ added in v0.3.0
NewFromStr creates BodyMock from a string
func NewFromStruct ¶ added in v0.3.0
func NewFromStruct(input interface{}) *BodyMock
NewFromStruct creates BodyMock from a struct converted to json or string
type BusinessArea ¶ added in v0.1.0
type ClientMock ¶ added in v0.3.0
type ClientMock struct {
ErrToGive error
ResponseToGive *http.Response
Requests []*http.Request
Lock sync.Mutex
}
ClientMock mocks HttpClient interface
type ConfParameter ¶
type ContactPerson ¶
type ContactPerson struct {
ContactPersonID int `json:"contactPersonID"`
FullName string `json:"fullName"`
GroupName string `json:"groupName"`
CountryID string `json:"countryID"`
Phone string `json:"phone"`
Email string `json:"email"`
Fax string `json:"fax"`
Code string `json:"code"`
BankName string `json:"bankName"`
BankAccountNumber string `json:"bankAccountNumber"`
BankIBAN string `json:"bankIBAN"`
BankSWIFT string `json:"bankSWIFT"`
Notes string `json:"notes"`
}
type ContactPersons ¶
type ContactPersons []ContactPerson
type CustomerImportReport ¶
type CustomerImportReports ¶
type CustomerImportReports []CustomerImportReport
type DocumentData ¶
type DocumentData struct {
//Document type
Type string
//Currency code: "EUR", "USD" etc. Currency must be defined in your Erply account.
CurrencyCode string
//eg. 2010-01-29
//Each sales document must have a date. If omitted, API applies current date.
Date string
//eg. 14:59:00
//If omitted, API applies current time.
Time string
//Assign a custom number to this sales document. As opposed to invoiceNo, this field may contain letters, spacing and punctuation.
CustomNumber string
// number of invoice document in provider system
InvoiceNumber string
// Invoice content text
InvoiceContentText string
///Sales document's custom reference number. This field must be used only if you want to override default reference numbers.
CustomReferenceNumber string
//Notes printed on the invoice
Notes string
//Additional text
Text string
//Status of the document itself.
//For invoices, possible values: PENDING, READY, MAILED, PRINTED. For orders, possible values are: PENDING, READY, SHIPPED, FULFILLED, CANCELLED
InvoiceState InvoiceState
//Expected invoice payment method: eg. CASH, CARD, TRANSFER, CHECK, GIFTCARD.
PaymentType PaymentType
// DEB for debit and CRED for credit
PaymentMethod string
//By default: system-specific, usually 14.
//In how many days the invoice is due.
PaymentDays string
//Invoice payment status.
//Possible values: PAID, UNPAID.
PaymentStatus PaymentStatus
//Invoice payment information, who paid, when, how.
//Max 255 characters
PaymentInfo string
//Payment reference number
PaymentReferenceNumber string
//ISO date (yyyy-mm-dd)
// Customer requested delivery date (for the whole document). You may also set requested delivery dates for each line individually, see deliveryDate#
DeliveryDate string
//ISO date (yyyy-mm-dd)
ShippingDate string
//Search by exact warehouse code.
WarehouseCode string
//seller company registry code
Seller CustomerConstructor
Payer CustomerConstructor
Buyer CustomerConstructor
Delivery CustomerConstructor
ProductRows ProductRows
CustomerId uint
}
type DocumentDatas ¶
type DocumentDatas []DocumentData
type Employee ¶ added in v0.1.0
type Employee struct {
EmployeeID string `json:"employeeID"`
FullName string `json:"fullName"`
EmployeeName string `json:"employeeName"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Phone string `json:"phone"`
Mobile string `json:"mobile"`
Email string `json:"email"`
Fax string `json:"fax"`
Code string `json:"code"`
Gender string `json:"gender"`
UserID string `json:"userID"`
Username string `json:"username"`
UserGroupID string `json:"userGroupID"`
Warehouses []EmployeeWarehouse `json:"warehouses"`
PointsOfSale string `json:"pointsOfSale"`
ProductIDs []EmployeeProduct `json:"productIDs"`
Attributes []ObjAttribute `json:"attributes"`
LastModified uint64 `json:"lastModified"`
LastModifiedByUserName string `json:"lastModifiedByUserName"`
// detail fileds
Skype string `json:"skype"`
Birthday string `json:"birthday"`
JobTitleID uint `json:"jobTitleID"`
JobTitleName string `json:"jobTitleName"`
Notes string `json:"notes"`
Added uint64 `json:"added"`
}
type EmployeeProduct ¶ added in v0.1.0
type EmployeeWarehouse ¶ added in v0.1.0
type EmployeeWarehouse struct {
Id uint `json:"id"`
}
type GetProductUnitsResponse ¶
type GetProductUnitsResponse struct {
Status Status `json:"status"`
ProductUnits []ProductUnit `json:"records"`
}
GetProductUnitsResponse ...
type GetProductsResponse ¶
type GetProductsResponse struct {
Status Status `json:"status"`
Products []Product `json:"records"`
}
GetProductsResponse ...
type GetUserRightsResponse ¶
type GetUserRightsResponse struct {
Status Status `json:"status"`
Records []UserRights `json:"records"`
}
type HttpClient ¶ added in v0.3.0
HttpClient abstracts http client implementation
type IdentityToken ¶
type IdentityToken struct {
Jwt string `json:"identityToken"`
}
type InstallationRequest ¶ added in v0.1.0
type InstallationResponse ¶ added in v0.1.0
type InvoiceRow ¶
type InvoiceRow struct {
RowID string `json:"rowID"`
ProductID string `json:"productID"`
Product *Product
ItemName string `json:"itemName"`
Barcode string `json:"barcode"`
VatrateID string `json:"vatrateID"`
Amount string `json:"amount"`
Price string `json:"price"`
Discount string `json:"discount"`
BillingStartDate string `json:"billingStartDate"`
BillingEndDate string `json:"billingEndDate"`
Code string `json:"code"`
FinalNetPrice float64 `json:"finalNetPrice"`
FinalPriceWithVAT float64 `json:"finalPriceWithVAT"`
RowNetTotal float64 `json:"rowNetTotal"`
RowVAT float64 `json:"rowVAT"`
RowTotal float64 `json:"rowTotal"`
CampaignIDs string `json:"campaignIDs"`
}
type InvoiceState ¶
type InvoiceState string
type JwtTokenResponse ¶ added in v0.1.0
type JwtTokenResponse struct {
Status Status `json:"status"`
Records JwtToken `json:"records"`
}
type Manager ¶ added in v0.4.0
type Manager interface {
GetCountries(ctx context.Context, filters map[string]string) ([]Country, error)
GetUserRights(ctx context.Context, filters map[string]string) ([]UserRights, error)
GetEmployees(ctx context.Context, filters map[string]string) ([]Employee, error)
GetBusinessAreas(ctx context.Context, filters map[string]string) ([]BusinessArea, error)
GetCurrencies(ctx context.Context, filters map[string]string) ([]Currency, error)
LogProcessingOfCustomerData(ctx context.Context, filters map[string]string) error
}
this interface sums up the general requests here
type ObjAttribute ¶ added in v0.1.0
type PartnerClient ¶ added in v0.4.0
type PartnerClient struct {
Client *Client
PartnerTokenProvider auth.PartnerTokenProvider
}
func NewPartnerClient ¶ added in v0.4.0
func NewPartnerClient(sessionKey, clientCode, partnerKey string, customCli *http.Client) (*PartnerClient, error)
type PointOfSale ¶
type Product ¶
type Product struct {
ProductID int `json:"productID"`
ParentProductID int `json:"parentProductID"`
Type string `json:"type"`
Name string `json:"name"`
NameEng string `json:"nameENG"`
Description string `json:"description"`
DescriptionEng string `json:"descriptionENG"`
DescriptionLong string `json:"longdesc"`
DescriptionLongEng string `json:"longdescENG"`
Status string `json:"status"`
Code string `json:"code"`
Code2 string `json:"code2"`
Code3 *string `json:"code3"`
Price float64 `json:"price"`
PriceWithVat float32 `json:"priceWithVat"`
UnitName *string `json:"unitName"`
Images []ProductImage `json:"images"`
DisplayedInWebshop byte `json:"displayedInWebshop"`
CategoryId uint `json:"categoryID"`
CategoryName string `json:"categoryName"`
BrandID uint `json:"brandID"`
BrandName string `json:"brandName"`
GroupID uint `json:"groupID"`
GroupName string `json:"groupName"`
Warehouses map[uint]StockInfo `json:"warehouses"`
RelatedProducts []string `json:"relatedProducts"`
Vatrate float64 `json:"vatrate"`
ProductVariations []string `json:"productVariations"` // Variations of matrix product
VariationList []ProductVariaton `json:"variationList"`
}
Product ...
type ProductBrand ¶ added in v0.1.0
type ProductCategory ¶ added in v0.1.0
type ProductDimensions ¶ added in v0.1.0
type ProductGroup ¶ added in v0.1.0
type ProductGroup struct {
ID uint `json:"productGroupID"`
Name string `json:"name"`
ShowInWebshop string `json:"showInWebshop"`
NonDiscountable byte `json:"nonDiscountable"`
PositionNo int `json:"positionNo"`
ParentGroupID string `json:"parentGroupID"`
Added uint64 `json:"added"`
LastModified uint64 `json:"lastModified"`
SubGroups []ProductGroup `json:"subGroups"`
}
type ProductImage ¶ added in v0.1.0
type ProductImage struct {
PictureID string `json:"pictureID"`
Name string `json:"name"`
ThumbURL string `json:"thumbURL"`
SmallURL string `json:"smallURL"`
LargeURL string `json:"largeURL"`
FullURL string `json:"fullURL"`
External byte `json:"external"`
HostingProvider string `json:"hostingProvider"`
Hash *string `json:"hash"`
Tenant *string `json:"tenant"`
}
type ProductRow ¶
type ProductRow struct {
//ID of the product (SKU) sold. Either productID or serviceID can be set, but not both at the same time. Both can be omitted, however - in that case a free-text invoice row will be created.
ProductID string
ItemName string
//Sold quantity must be a decimal, and can not be zero.
Amount string
///Net sales price per item, pre-discount.
Price string
//Discount % that WILL BE SUBTRACTED from the price specified in previous parameter.
Discount string
//Customer requested delivery date for this specific item. You can also set a requested delivery date for the whole document, see deliveryDate above.
DeliveryDate string
//Billing start date. See previous field.
BillingStartDate string
//Billing end date. See previous field.
BillingEndDate string
// item vat rate
VatRate string
}
type ProductRows ¶
type ProductRows []ProductRow
type ProductUnit ¶
ProductUnit ...
type ProductVariaton ¶ added in v0.1.0
type ProductVariaton struct {
ProductID string `json:"productID"`
Name string `json:"name"`
Code string `json:"code"`
Code2 string `json:"code2"`
Dimensions []ProductDimensions `json:"dimensions"`
}
type Project ¶ added in v0.1.0
type Project struct {
ProjectID uint `json:"projectID"`
Name string `json:"name"`
CustomerID uint `json:"customerID"`
CustomerName string `json:"customerName"`
EmployeeID uint `json:"employeeID"`
EmployeeName string `json:"employeeName"`
TypeID uint `json:"typeID"`
TypeName string `json:"typeName"`
StatusID uint `json:"statusID"`
StatusName string `json:"statusName"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Notes string `json:"notes"`
LastModified uint64 `json:"lastModified"`
}
type ProjectStatus ¶ added in v0.1.0
type PurchaseDocImportReport ¶
type PurchaseDocImportReports ¶
type PurchaseDocImportReports []PurchaseDocImportReport
type PurchaseDocumentConstructor ¶
type PurchaseDocumentConstructor struct {
DocumentData *DocumentData
PaymentParty *Customer
DeliveryParty *Customer
SellerParty *Customer
VatRates VatRates
}
type PurchaseDocumentConstructors ¶
type PurchaseDocumentConstructors []PurchaseDocumentConstructor
type SaleDocImportReport ¶
type SaleDocImportReports ¶
type SaleDocImportReports []SaleDocImportReport
type SessionInfo ¶
type SessionInfo struct {
SessionKey string `json:"sessionKey"`
}
type SessionKeyUser ¶ added in v0.3.0
type SessionKeyUser struct {
UserID string `json:"userID"`
UserName string `json:"userName"`
EmployeeName string `json:"employeeName"`
EmployeeID string `json:"employeeID"`
GroupID string `json:"groupID"`
GroupName string `json:"groupName"`
IPAddress string `json:"ipAddress"`
SessionKey string `json:"sessionKey"`
SessionLength int `json:"sessionLength"`
LoginUrl string `json:"loginUrl"`
BerlinPOSVersion string `json:"berlinPOSVersion"`
BerlinPOSAssetsURL string `json:"berlinPOSAssetsURL"`
EpsiURL string `json:"epsiURL"`
IdentityToken string `json:"identityToken"`
Token string `json:"token"`
}
func GetSessionKeyUser ¶ added in v0.3.0
func GetSessionKeyUser(sessionKey string, clientCode string, client HttpClient) (SessionKeyUser, error)
GetSessionKeyUser returns user information for the used session key
type SessionKeyUserResponse ¶ added in v0.3.0
type SessionKeyUserResponse struct {
Records []SessionKeyUser `json:"records"`
}
type Supplier ¶ added in v0.1.0
type Supplier struct {
SupplierId uint `json:"supplierID"`
SupplierType string `json:"supplierType"`
FullName string `json:"fullName"`
CompanyName string `json:"companyName"`
FirstName string `json:"firstName"`
LstName string `json:"lastName"`
GroupId uint `json:"groupID"`
GroupName string `json:"groupName"`
Phone string `json:"phone"`
Mobile string `json:"mobile"`
Email string `json:"email"`
Fax string `json:"fax"`
Code string `json:"code"`
IntegrationCode string `json:"integrationCode"`
VatrateID uint `json:"vatrateID"`
CurrencyCode string `json:"currencyCode"`
DeliveryTermsID uint `json:"deliveryTermsID"`
CountryId uint `json:"countryID"`
CountryName string `json:"countryName"`
CountryCode string `json:"countryCode"`
Address string `json:"address"`
Gln string `json:"GLN"`
Attributes []ObjAttribute `json:"attributes"`
// Detail fields
VatNumber string `json:"vatNumber"`
Skype string `json:"skype"`
Website string `json:"website"`
BankName string `json:"bankName"`
BankAccountNumber string `json:"bankAccountNumber"`
BankIBAN string `json:"bankIBAN"`
BankSWIFT string `json:"bankSWIFT"`
Birthday string `json:"birthday"`
CompanyID uint `json:"companyID"`
ParentCompanyName string `json:"parentCompanyName"`
SupplierManagerID uint `json:"supplierManagerID"`
SupplierManagerName string `json:"supplierManagerName"`
PaymentDays uint `json:"paymentDays"`
Notes string `json:"notes"`
LastModified string `json:"lastModified"`
Added uint64 `json:"added"`
}
type UserCredentials ¶
type UserRights ¶
type UserRights struct {
UserName string `json:"userName"`
}
type VerifyUserResponse ¶
type VerifyUserResponse struct {
Records []Records `json:"records"`
}
type Warehouse ¶
type Warehouse struct {
WarehouseID string `json:"warehouseID"`
PricelistID string `json:"pricelistID"`
PricelistID2 string `json:"pricelistID2"`
PricelistID3 string `json:"pricelistID3"`
PricelistID4 int `json:"pricelistID4"`
PricelistID5 int `json:"pricelistID5"`
Name string `json:"name"`
Code string `json:"code"`
AddressID int `json:"addressID"`
Address string `json:"address"`
Street string `json:"street"`
Address2 string `json:"address2"`
City string `json:"city"`
State string `json:"state"`
Country string `json:"country"`
ZIPcode string `json:"ZIPcode"`
StoreGroups string `json:"storeGroups"`
CompanyName string `json:"companyName"`
CompanyCode string `json:"companyCode"`
CompanyVatNumber string `json:"companyVatNumber"`
Phone string `json:"phone"`
Fax string `json:"fax"`
Email string `json:"email"`
Website string `json:"website"`
BankName string `json:"bankName"`
BankAccountNumber string `json:"bankAccountNumber"`
Iban string `json:"iban"`
Swift string `json:"swift"`
UsesLocalQuickButtons int `json:"usesLocalQuickButtons"`
DefaultCustomerGroupID int `json:"defaultCustomerGroupID"`
IsOfflineInventory int `json:"isOfflineInventory"`
TimeZone string `json:"timeZone"`
Attributes []struct {
AttributeName string `json:"attributeName"`
AttributeType string `json:"attributeType"`
AttributeValue string `json:"attributeValue"`
} `json:"attributes"`
}
type Warehouses ¶
type Warehouses []Warehouse
type WebshopClient ¶ added in v0.1.0
type WebshopClient struct {
ClientID string `json:"clientID"`
ClientUsername string `json:"clientUsername"`
ClientName string `json:"clientName"`
ClientFirstName string `json:"clientFirstName"`
ClientLastName string `json:"clientLastName"`
ClientGroupID string `json:"clientGroupID"`
ClientGroupName string `json:"clientGroupName"`
CompanyID string `json:"companyID"`
CompanyName string `json:"companyName"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.