qbwcGo

package
v0.0.0-...-04dc92c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2022 License: AGPL-3.0 Imports: 21 Imported by: 0

README

QuickBooks Web Connector Programmers Guide: https://developer-static.intuit.com/qbSDK-current/doc/PDF/QBWC_proguide.pdf

QuickBookds IDN Unified On Screen Reference: https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html

CommerceV3 Prezi describing the CV3 integration service - https://prezi.com/view/YvGSjnefni3pkLZaracf/

The CV3 integration service for QuickBooks Web Connector handles communication betwwen CommerceV3 stores and QuickBooks. All messages to and from the QuickBooks Web Connector flow through the URL set in the field in wsdl/QBWebConnect.qwc

The Intuit Web Connector sessions consists of several calls to the CV3 integration server. All roundtrip messages begin within Intuit's web connector, and every message sent from the CV3 integration service to Intuit's web connector is a response to a request:

  1. ServerVersion
    1. Asks the server for its version information
  2. ClientVersion
    1. Intuit Web Connector sends its versioning information to the server
  3. Authenticate
    1. Performs basic authentication
    2. Starts the NoOp holding patter to tell the Intuit Web Connector to wait for work
    3. Starts the order success tracking system
    4. Gets the work from CV3 via the InitWork() function which calls the GetCV3Orders() function
      1. A call to the CV3 webservice to retrieve orders
      2. Map the CV3 order information to the correct qbXML order type as set in the config
      3. Send the qbXML to the work channel
      4. Send order data to the order success tracking system
  4. SendRequestXML
    1. Check for work in the work channel, otherwise continue the NoOp holding pattern
    2. Add work context to the sendRequestXML template
    3. Send the work back to the Intuit Web Connector
  5. ReceiveResponseXML
    1. Receives the response from the preceeding SendRequestXML call
    2. Checks for what type of response via the CheckNode function and routs the the corresponding handler function
      1. Checks for success or error status codes
      2. If success, the order success tracker will be updated to allow for an order confirmation to be sent to CV3
      3. If errors are found, the service will trigger the creation of more work to be sent to Intuit's Web Connector
    3. Intuit's Web Connector will then call sendRequestXML to start a new work loop
  6. CloseConnection
    1. Ends the session when work is done

ReceiveResponseXML handlers:

  1. SalesOrderAddRs
    1. Check StatusCode
      1. "0" OK, send the order tracking system a success signal
      2. "3140" Element not found in QuickBooks
        1. Check StatusMessage to potentially:
          1. Add new Customer
          2. Add new CustomerMSG
      3. "3180" occurs when quickbooks thinks the list is being accessed from another location
        1. May only happen in Enterprise version
        2. Resend the work to the work channel
      4. "3270" occurs when using SalesOrderAdds with an unsupported version of QuickBooks
        1. If this occurs, the config may be set to use SalesOrders, and instead should use SalesReceipts
  2. SalesReceiptAddRs
    1. Check StatusCode
      1. "0" OK, send the order tracking system a success signal
      2. "3140" Element not found in QuickBooks
        1. Check StatusMessage to potentially:
          1. Add new Customer
          2. Add new CustomerMSG
      3. "3180" occurs when quickbooks thinks the list is being accessed from another location
        1. May only happen in Enterprise version
        2. Resend the work to the work channel
  3. CustomerAddRs
    1. Check StatusCode
      1. "0" OK, Customer added successfully
      2. "3100" Element already exists in QuickBooks
        1. Check StatusMsg to potentially
          1. Customer name already exists as a vendor or employee
            1. Append "Cust" to the end of the customer name and re attempt customer add
            2. Update the order to match the new customer name These calls are routed using a string match on the incoming XML. A recursive CheckNodes function is used to get a match on any XML node desired, then the corresponding function will be called.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CfgPath = "./config/qbwcConfig.json"

CfgPath is the path to the config file, used first in qbwcServer.go then in SendAuthenticateResponse() to reload the config

View Source
var ErrLog *logrus.Logger

ErrLog is specifically for logging error level events

Log is the normal logger

Functions

func AddTestItemsToQB

func AddTestItemsToQB()

AddTestItemsToQB will add test items to the QB DB

func AutoImportItemsToQB

func AutoImportItemsToQB(checkWork WorkCTX)

AutoImportItemsToQB will automatically import any items in a CV3 order, that do not exist in quickbooks

func CheckNodes

func CheckNodes(nodes []Node, parentNode Node, f func(Node, Node) bool)

CheckNodes will recursively check xml nodes, and run the passed in funcion f

func CheckPath

func CheckPath(path string, o *gabs.Container) string

CheckPath checks if a gabs path exists and then returns the value as a string

func CheckPayMethod

func CheckPayMethod(o *gabs.Container, s string)

CheckPayMethod checks the payMethod and additionalPayMethod fields and maaps the proper fields

func ConfirmCV3Order

func ConfirmCV3Order(orderID string)

ConfirmCV3Order will let CV3 know the order information has been received

func ConvertColonPairsToNewlines

func ConvertColonPairsToNewlines(incoming string) string

ConvertColonPairsToNewlines for use with stores that use :: as delimiters between newlines

func ConvertColonsToSpaces

func ConvertColonsToSpaces(incoming string) string

ConvertColonsToSpaces is to remove colons from qbxml as colons indicate parent/child relationships to quickbooks

func ConvertCustomerMsgRef

func ConvertCustomerMsgRef(s string) string

ConvertCustomerMsgRef will check for the cv3 elimiter :: and replace single colons with a space

func CustomerAddQB

func CustomerAddQB(workCTX WorkCTX)

CustomerAddQB will add a customer to the quickbooks database

func CustomerAddRsHandler

func CustomerAddRsHandler(parentNode Node, checkWork WorkCTX)

CustomerAddRsHandler will handle the response from a CustomerAddRq

func CustomerModQB

func CustomerModQB(order, shipTo *gabs.Container, customerRecord CustomerRet)

CustomerModQB will modify a customer record

func CustomerModRsHandler

func CustomerModRsHandler(parentNode Node, checkWork WorkCTX)

CustomerModRsHandler is used in SendResponseXML to handle a CustomerModRs

func CustomerMsgAddQB

func CustomerMsgAddQB(workCTX WorkCTX)

CustomerMsgAddQB will add a customerMsgRef to the quickbooks database

func CustomerMsgQueryQB

func CustomerMsgQueryQB(order, shipTo *gabs.Container, name string) (string, int, error)

CustomerMsgQueryQB will query for customer messages, then return the list id, or add a new messages

func CustomerMsgQueryRsHandler

func CustomerMsgQueryRsHandler(parentNode Node, checkWork WorkCTX)

CustomerMsgQueryRsHandler is used in SendResponseXML to handle a CustomerMsgQueryRs

func CustomerQueryQB

func CustomerQueryQB(order, shipTo *gabs.Container, name, email string) (string, int, error)

CustomerQueryQB will query for customers, attempt to match the email from the order if the email matches, the listID will be returned to be used in the addOrder, and the customers info will be updated, excluding the the email if the name exists but the email does not match, a new customer record will be created with the new email appended to the customer name if there is no matching name a new customer will be created.

func CustomerQueryRsHandler

func CustomerQueryRsHandler(parentNode Node, checkWork WorkCTX)

CustomerQueryRsHandler is used in SendResponseXML to handle a CustomerQueryRs

func DataExtAddQB

func DataExtAddQB(TxnID string) string

DataExtAddQB will add a custom field value to a quickbooks object

func EscapeField

func EscapeField(s string) string

EscapeField takes a string and returns an escaped string

func EscapeName

func EscapeName(s string) string

EscapeName will check the name field for sizee requirements then escape it

func FieldCharLimit

func FieldCharLimit(s string, limit int) string

FieldCharLimit wil truncate characters past the passed in limit

func GetCV3Orders

func GetCV3Orders()

GetCV3Orders will recieve a qb itemQueryRs with items to be converted and sent to CV3

func ImportCV3ItemsToQB

func ImportCV3ItemsToQB(prod cv3go.Product)

ImportCV3ItemsToQB will recieve a cv3 product and add a qb itemQueryRs to the work queue

func InitChannels

func InitChannels()

InitChannels Resets the go channels to prevent data being left in the buffers

func InitLog

func InitLog() *logrus.Logger

InitLog initialized the log

func InitQBItems

func InitQBItems()

InitQBItems adds certian items to Quick Books, to prepare it for the qbwc/cv3 intigration

func InitWork

func InitWork()

InitWork will go get work to be done

func ItemGroupAddRsHandler

func ItemGroupAddRsHandler(parentNode Node, checkWork WorkCTX)

ItemGroupAddRsHandler asdf

func ItemInventoryAddRsHandler

func ItemInventoryAddRsHandler(parentNode Node, checkWork WorkCTX)

ItemInventoryAddRsHandler is used in SendResponseXML to handle a ItemInventoryAddRs

func ItemMapping

func ItemMapping(itemInterface interface{}, checkSKU *[]string, cv3Items *cv3go.Products, mapPath string)

ItemMapping set the cv3 product fields with the QB data Load the field mapping, convert itemInterface into a gabs container, then use the fieldMap to set the desired fields

func ItemQueryRsHandler

func ItemQueryRsHandler(parentNode Node, checkWork WorkCTX)

ItemQueryRsHandler asdf

func LoadDataExtFile

func LoadDataExtFile() *[]DataExtAddRq

LoadDataExtFile will load the data ext set in the dataExtConfig file

func LoadTemplate

func LoadTemplate(tPath *string, ctx interface{}, requestBody *bytes.Buffer)

LoadTemplate accepts a path to a template, a struct for the temmplates context, and the request body to fill

func MakeSalesOrder

func MakeSalesOrder(workCount *int, workCTX *WorkCTX, ordersMapper *gabs.Container)

MakeSalesOrder takes the cv3 order and turns it into a qbxml salesOrderAdd

func MakeSalesReceipt

func MakeSalesReceipt(workCount *int, workCTX *WorkCTX, ordersMapper *gabs.Container)

MakeSalesReceipt takes the cv3 order and turns it into a qbxml salesReceiptAdd

func MatchAttributeCombinations

func MatchAttributeCombinations(at *gabs.Container, pAttributes map[string]string) int

MatchAttributeCombinations loops through all the returned attribute combinations, and matches them against what was sent in the order information. This will return an int value to be compared with the length of attributes from the origional order information

func ParseFloat

func ParseFloat(s string) float64

ParseFloat is a wrapper for strconv.ParseFloat, and will parse a string into a float

func QBItemQuery

func QBItemQuery()

QBItemQuery readies a qbwc ItemQuery QBXML

func QBWCHandler

func QBWCHandler(w http.ResponseWriter, r *http.Request)

QBWCHandler is the only handler, to handle qbwc soap requests by switching on xml node names

func ReadDictFile

func ReadDictFile(mapPath string) map[string]string

ReadDictFile reads the json dictionary file and returns a map[string]string

func ReadFieldMapping

func ReadFieldMapping(path string) map[string]MappingObject

ReadFieldMapping will load a map[string]MappingObject from a json file

func RecursiveMapCheck

func RecursiveMapCheck(mapObj MappingObject, cv3Data ...*gabs.Container) string

RecursiveMapCheck will traverse the recursive mapping objects and return data as a string

func SalesOrderAddRsHandler

func SalesOrderAddRsHandler(parentNode Node, checkWork WorkCTX)

SalesOrderAddRsHandler is used in SendResponseXML to handle a SalesOrderAddRs

func SalesReceiptAddRsHandler

func SalesReceiptAddRsHandler(parentNode Node, checkWork WorkCTX)

SalesReceiptAddRsHandler is used in SendResponseXML to handle a SalesReceiptAddRs

func SaveConfig

func SaveConfig()

SaveConfig saves the config

func SendAuthenticateResponse

func SendAuthenticateResponse(parentNode Node, w http.ResponseWriter)

SendAuthenticateResponse will send the response to authenticate This function will authenticate the credentials sent by QBWC. Start storing session information, the NoOp holding pattern, the order success tracker, and start "getting" work

func SendClientVersionResponse

func SendClientVersionResponse(parentNode Node, w http.ResponseWriter)

SendClientVersionResponse sends the response to the client version call

func SendCloseConnectionResponse

func SendCloseConnectionResponse(parentNode Node, w http.ResponseWriter)

SendCloseConnectionResponse sends the response to the close connection call. This function will signal the order success tracker to end, this will be the last call from QBWC

func SendConnectionErrorResponse

func SendConnectionErrorResponse(parentNode Node, w http.ResponseWriter)

SendConnectionErrorResponse sends the response to QBWC's connectionError call, when the QuickBooks Web Connector has an issue connecting to QuickBooks, and logs the error

func SendGetLastErrorResponse

func SendGetLastErrorResponse(parentNode Node, w http.ResponseWriter)

SendGetLastErrorResponse sends the response to getLastError call. This call is send when QBWC thinks this server has an error, or is in the NoOp holding pattern

func SendReceiveResponseXMLResponse

func SendReceiveResponseXMLResponse(parentNode Node, w http.ResponseWriter)

SendReceiveResponseXMLResponse sends the response to QBWC's receiveResponseXML call this function receives the workCTX used in SendSendRequestXML on one of the checkWork channels. Then determines what type of response has been received by switching on the xml node name, then runs the corresponding function, Next determines if there is more work to be done, then sends its response

func SendSendRequestXMLResponse

func SendSendRequestXMLResponse(parentNode Node, w http.ResponseWriter)

SendSendRequestXMLResponse sends the response to SendRequestXLM call from QBWC. This function first checks if there is work ready to be done. Adds this work to the queue and sends its workCTX on the checkWork channel to be used in SendReceiveResponseXMLResponse Then sends the desired work to be done

func SendServerVersionResponse

func SendServerVersionResponse(parentNode Node, w http.ResponseWriter)

SendServerVersionResponse sends the server version information to QBWC

func SetLogFile

func SetLogFile(path string, l *logrus.Logger) *logrus.Logger

SetLogFile sets the file location to store the log

func SetLogLevel

func SetLogLevel(level string, l *logrus.Logger) *logrus.Logger

SetLogLevel sets the logging level

func StartOrderTracker

func StartOrderTracker()

StartOrderTracker starts the order confirmation tracking

func StrExtract

func StrExtract(sExper, sAdelim, sCdelim string, nOccur int) string

StrExtract Retrieves a string between two delimiters. sExper: Specifies the expression to search. cAdelim: Specifies the character that delimits the beginning of sExper. cCdelim: Specifies the character that delimits the end of sExper. nOccur: Specifies at which occurrence of cAdelim in sExper to start the extraction.

func StripBlanksAndNewlines

func StripBlanksAndNewlines(incoming string) string

StripBlanksAndNewlines returns an empty string "" if the incoming string contains nothing but spaces and newlines. Otherwise, return the string as it was received.

func UpdateCV3Items

func UpdateCV3Items(items ItemQueryRs) error

UpdateCV3Items will recieve a qb itemQueryRs with items to be converted and sent to CV3

Types

type AccountRef

type AccountRef struct {
	ListID   string `xml:"ListID,omitempty"`
	FullName string `xml:"FullName,omitempty"`
}

AccountRef Income, Expense, child of QBXML Items

type AdditionalContactRef

type AdditionalContactRef struct {
	ContactName  string `xml:"ContactName"`
	ContactValue string `xml:"ContactValue"`
}

AdditionalContactRef is a unique ref struct to hold contact information

type AdditionalNotes

type AdditionalNotes struct {
	NoteID string `xml:"NoteID,omitempty"`
	Note   string `xml:"Note,omitempty"`
}

AdditionalNotes is the struct to hold data for the additional notes node

type Address

type Address struct {
	Name          string `xml:"Name,omitempty"`
	Addr1         string `xml:"Addr1"`
	Addr2         string `xml:"Addr2,omitempty"`
	Addr3         string `xml:"Addr3,omitempty"`
	Addr4         string `xml:"Addr4,omitempty"`
	Addr5         string `xml:"Addr5,omitempty"`
	City          string `xml:"City"`
	State         string `xml:"State"`
	PostalCode    string `xml:"PostalCode"`
	Country       string `xml:"Country"`
	Note          string `xml:"Note,omitempty"`
	DefaultShipTo string `xml:"DefaultShipTo,omitempty"`
}

Address holds the billing addressss

type AuthReturn

type AuthReturn struct {
	Auth []string
}

AuthReturn is the return struct for authentication calls

type AuthenticateCTX

type AuthenticateCTX struct {
	XMLName  xml.Name `xml:"http://developer.intuit.com/ authenticate"`
	UserName string   `xml:"strUserName,omitempty"`
	Password string   `xml:"strPassword,omitempty"`
}

AuthenticateCTX is the struct used when qbwc sends authentication information

type AuthenticateResponseCTX

type AuthenticateResponseCTX struct {
	Ticket                  string //Session string: a string, none, nvu, or busy //TODO EXPEREMENT: QBWC talks about company file name, yet I don't believe it is correct. Origionally used 123a
	DelayUpdate             string //Can be a blank string. QBWC will pause for this many seconds
	EveryMinLowerLimit      string //Optional: Set the lower limit, in seconds, that the client can shoose to run updates
	MinimumRunEveryNSeconds string //Optional: TODO I'm not sure the difference
}

AuthenticateResponseCTX holds the data to fill the authenticate response

type BarCode

type BarCode struct {
	BarCodeValue     string `xml:"BarCodeValue"`
	AssignEvenIfUsed string `xml:"AssignEvenIfUsed"`
	AllowOverride    string `xml:"AllowOverride"`
}

BarCode holds BarCode information for items

type CV3Credentials

type CV3Credentials struct {
	Credentials
	ServiceID string `json:"serviceID"`
}

CV3Credentials holds the credentials for cv3 authentication

type ClassFilter

type ClassFilter struct {
	ListID               []string `xml:"ListID,omitempty"`
	FullName             []string `xml:"FullName,omitempty"`
	ListIDWithChildren   string   `xml:"ListIDWithChildren,omitempty"`
	FullNameWithChildren string   `xml:"FullNameWithChildren,omitempty"`
}

ClassFilter is the struct to hold data for customer quries

type ClientVersionCTX

type ClientVersionCTX struct {
	StrVersion string `xml:"strVersion"`
}

ClientVersionCTX holds the client version information sent by QBWC

type ClientVersionResponseCTX

type ClientVersionResponseCTX struct {
	Result string //blank string, or string witha preceeding E:, W: or O: to indicate Error, Warning or OK
}

ClientVersionResponseCTX holds the context to fill the ClientVersion response

type CloseConnectionCTX

type CloseConnectionCTX struct {
	Ticket string `xml:"ticket"`
}

CloseConnectionCTX holds the information sent by QBWC in the closeConnection soap request

type CloseConnectionResponseCTX

type CloseConnectionResponseCTX struct {
	CloseConnectionResult string //message to send when connection is closed
}

CloseConnectionResponseCTX holds the context to fill the closeConnection response

type Config

type Config struct {
	OrderType              string         `json:"orderType"`   //SalesReceipt, or SalesOrder are current options, case insensitive
	InitQBItems            bool           `json:"initQBItems"` //adds the Shipping item to QuickBooks
	AutoImportCV3Items     bool           `json:"autoImportCV3Items"`
	ItemUpdates            ItemUpdates    `json:"itemUpdates"`
	ListenPort             string         `json:"listenPort"`
	Logging                Logging        `json:"logging"`
	CV3Credentials         CV3Credentials `json:"cv3Credentials"`
	QBWCCredentials        Credentials    `json:"qbwcCredentials"`
	ServerVersion          string         `json:"serverVersion"`
	QBWCVersion            string         `json:"qbwcVersion"`
	CloseConnectionMessage string         `json:"closeConnectionMessage"`
	MaxWorkAttempts        int            `json:"maxWorkAttempts"`
	ConfirmOrders          bool           `json:"confirmOrders"`
	DataExtActive          bool           `json:"dataExtActive"`
	NameArrangement        struct {
		First           string `json:"first"`
		SeperatorString string `json:"seperatorString"`
		Last            string `json:"last"`
	} `json:"nameArrangement"`
}

Config is the struct to hold the config data

func LoadConfig

func LoadConfig(cfgPath string) *Config

LoadConfig loads the configuration file

type ConnectionErrorCTX

type ConnectionErrorCTX struct {
	Ticket  string `xml:"ticket,omitempty"`
	HResult string `xml:"hresult,omitempty"`
	Message string `xml:"message,omitempty"`
}

ConnectionErrorCTX holds the data send by QBWC's connectionError call

type ConnectionErrorResponseCTX

type ConnectionErrorResponseCTX struct {
	Result string //empty string //TODO what are valid values
}

ConnectionErrorResponseCTX holds the context to fill the connectionError Response

type Contacts

type Contacts struct {
	Salutation           string                 `xml:"Salutation"`
	FirstName            string                 `xml:"FirstName"`
	MiddleName           string                 `xml:"MiddleName"`
	LastName             string                 `xml:"LastName"`
	JobTitle             string                 `xml:"JobTitle"`
	AdditionalContactRef []AdditionalContactRef `xml:"AdditionalContactRef"`
}

Contacts is a struct to hold contact information when adding a customer

type ContactsRet

type ContactsRet struct {
	ListID               string                  `xml:"ListID,omitempty"`
	TimeCreated          string                  `xml:"TimeCreated,omitempty"`
	TimeModified         string                  `xml:"TimeModified,omitempty"`
	EditSequence         string                  `xml:"EditSequence,omitempty"`
	Contact              string                  `xml:"Contact,omitempty"`
	Salutation           string                  `xml:"Salutation,omitempty"`
	FirstName            string                  `xml:"FirstName,omitempty"`
	MiddleName           string                  `xml:"MiddleName,omitempty"`
	LastName             string                  `xml:"LastName,omitempty"`
	JobTitle             string                  `xml:"JobTitle,omitempty"`
	AdditionalContactRef *[]AdditionalContactRef `xml:"AdditionalContactRef,omitempty"`
}

ContactsRet is the struct to hold data for customer query responses

type Credentials

type Credentials struct {
	User string `json:"user"`
	Pass string `json:"pass"`
}

Credentials holds the credential information for cv3

type CreditCardInfo

type CreditCardInfo struct {
	CreditCardNumber     string `xml:"CreditCardNumber"`
	ExpirationMonth      string `xml:"ExpirationMonth"`
	ExpirationYear       string `xml:"ExpirationYear"`
	NameOnCard           string `xml:"NameOnCard"`
	CreditCardAddress    string `xml:"CreditCardAddress"`
	CreditCardPostalCode string `xml:"CreditCardPostalCode"`
}

CreditCardInfo is to hold the credit card info whwen adding a customer

type CreditCardTxnInfo

type CreditCardTxnInfo struct {
	CreditCardTxnInputInfo  CreditCardTxnInputInfo  `xml:"CreditCardTxnInputInfo"`
	CreditCardTxnResultInfo CreditCardTxnResultInfo `xml:"CreditCardTxnResultInfo"`
}

CreditCardTxnInfo holds credit card txn info

type CreditCardTxnInputInfo

type CreditCardTxnInputInfo struct {
	CreditCardNumber     string `xml:"CreditCardNumber"`
	ExpirationMonth      string `xml:"ExpirationMonth"`
	ExpirationYear       string `xml:"ExpirationYear"`
	NameOnCard           string `xml:"NameOnCard"`
	CreditCardAddress    string `xml:"CreditCardAddress"`
	CreditCardPostalCode string `xml:"CreditCardPostalCode"`
	CommercialCardCode   string `xml:"CommercialCardCode"`
	TransactionMode      string `xml:"TransactionMode"`   //TransactionMode may have one of the following values: CardNotPresent [DEFAULT], CardPresent
	CreditCardTxnType    string `xml:"CreditCardTxnType"` //CreditCardTxnType may have one of the following values: Authorization, Capture, Charge, Refund, VoiceAuthorization
}

CreditCardTxnInputInfo holds the credit card input information for CreditCardTxnInfo

type CreditCardTxnResultInfo

type CreditCardTxnResultInfo struct {
	ResultCode            int    `xml:"ResultCode"`
	ResultMessage         string `xml:"ResultMessage"`
	CreditCardTransID     string `xml:"CreditCardTransID"`
	MerchantAccountNumber string `xml:"MerchantAccountNumber"`
	AuthorizationCode     string `xml:"AuthorizationCode"`
	AVSStreet             string `xml:"AVSStreet"`             //AVSStreet may have one of the following values: Pass, Fail, NotAvailable
	AVSZip                string `xml:"AVSZip"`                //AVSZip may have one of the following values: Pass, Fail, NotAvailable
	CardSecurityCodeMatch string `xml:"CardSecurityCodeMatch"` //CardSecurityCodeMatch may have one of the following values: Pass, Fail, NotAvailable
	ReconBatchID          string `xml:"ReconBatchID"`
	PaymentGroupingCode   int    `xml:"PaymentGroupingCode"`
	PaymentStatus         string `xml:"PaymentStatus"` //PaymentStatus may have one of the following values: Unknown, Completed
	TxnAuthorizationTime  string `xml:"TxnAuthorizationTime"`
	TxnAuthorizationStamp int    `xml:"TxnAuthorizationStamp"`
	ClientTransID         string `xml:"ClientTransID"`
}

CreditCardTxnResultInfo holds the results from the credit card txn

type CurrencyFilter

type CurrencyFilter struct {
	ListID   []string `xml:"ListID,omitempty"`
	FullName []string `xml:"FullName,omitempty"`
}

CurrencyFilter is the struct to hold data for customer queries

type CustomerAddRq

type CustomerAddRq struct {
	Name                      string                 `xml:"Name"`
	IsActive                  string                 `xml:"IsActive"`
	ClassRef                  AccountRef             `xml:"ClassRef"`
	ParentRef                 AccountRef             `xml:"ParentRef"`
	CompanyName               string                 `xml:"CompanyName"`
	Salutation                string                 `xml:"Salutation"`
	FirstName                 string                 `xml:"FirstName"`
	MiddleName                string                 `xml:"MiddleName"`
	LastName                  string                 `xml:"LastName"`
	JobTitle                  string                 `xml:"JobTitle"`
	BillAddress               Address                `xml:"BillAddress"`
	ShipAddress               Address                `xml:"ShipAddress"`
	ShipToAddress             []QBShipToAddress      `xml:"ShipToAddress"`
	Phone                     string                 `xml:"Phone"`
	AltPhone                  string                 `xml:"AltPhone"`
	Fax                       string                 `xml:"Fax"`
	Email                     string                 `xml:"Email"`
	Cc                        string                 `xml:"Cc"`
	Contact                   string                 `xml:"Contact"`
	AltContact                string                 `xml:"AltContact"`
	AdditionalContactRef      []AdditionalContactRef `xml:"AdditionalContactRef"`
	Contacts                  []Contacts             `xml:"Contacts"`
	CustomerTypeRef           AccountRef             `xml:"CustomerTypeRef"`
	TermsRef                  AccountRef             `xml:"TermsRef"`
	SalesRepRef               AccountRef             `xml:"SalesRepRef"`
	OpenBalance               string                 `xml:"OpenBalance"`
	OpenBalanceDate           string                 `xml:"OpenBalanceDate"`
	SalesTaxCodeRef           AccountRef             `xml:"SalesTaxCodeRef"`
	ItemSalesTaxRef           AccountRef             `xml:"ItemSalesTaxRef"`
	ResaleNumber              string                 `xml:"ResaleNumber"`
	AccountNumber             string                 `xml:"AccountNumber"`
	CreditLimit               string                 `xml:"CreditLimit"`
	PreferredPaymentMethodRef AccountRef             `xml:"PreferredPaymentMethodRef"`
	CreditCardInfo            CreditCardInfo         `xml:"CreditCardInfo"`
	JobStatus                 string                 `xml:"JobStatus"`
	JobStartDate              string                 `xml:"JobStartDate"`
	JobProjectedEndDate       string                 `xml:"JobProjectedEndDate"`
	JobEndDate                string                 `xml:"JobEndDate"`
	JobDesc                   string                 `xml:"JobDesc"`
	JobTypeRef                AccountRef             `xml:"JobTypeRef"`
	Notes                     string                 `xml:"Notes"`
	AdditionalNotes           []struct {
		Note string `xml:"Note"`
	} `xml:"AdditionalNotes"`
	PreferredDeliveryMethod string     `xml:"PreferredDeliveryMethod"`
	PriceLevelRef           AccountRef `xml:"PriceLevelRef"`
	ExternalGUID            string     `xml:"ExternalGUID"`
	CurrencyRef             AccountRef `xml:"CurrencyRef"`
}

CustomerAddRq is the top level struct for holding the CustomerAddRq data

type CustomerAddRs

type CustomerAddRs struct {
	ResponseStatus
}

CustomerAddRs hods the data from the response to CustomerAddRq

type CustomerModRq

type CustomerModRq struct {
	XMLName     xml.Name `xml:"CustomerModRq"`
	CustomerMod struct {
		ListID                    string                  `xml:"ListID,omitempty"`
		EditSequence              string                  `xml:"EditSequence,omitempty"`
		Name                      string                  `xml:"Name,omitempty"`
		IsActive                  string                  `xml:"IsActive,omitempty"`
		ClassRef                  *AccountRef             `xml:"ClassRef,omitempty"`
		ParentRef                 *AccountRef             `xml:"ParentRef,omitempty"`
		CompanyName               string                  `xml:"CompanyName,omitempty"`
		Salutation                string                  `xml:"Salutation,omitempty"`
		FirstName                 string                  `xml:"FirstName,omitempty"`
		MiddleName                string                  `xml:"MiddleName,omitempty"`
		LastName                  string                  `xml:"LastName,omitempty"`
		JobTitle                  string                  `xml:"JobTitle,omitempty"`
		BillAddress               *Address                `xml:"BillAddress,omitempty"`
		ShipAddress               *Address                `xml:"ShipAddress,omitempty"`
		ShipToAddress             *[]Address              `xml:"ShipToAddress,omitempty"`
		Phone                     string                  `xml:"Phone,omitempty"`
		AltPhone                  string                  `xml:"AltPhone,omitempty"`
		Fax                       string                  `xml:"Fax,omitempty"`
		Email                     string                  `xml:"Email,omitempty"`
		Cc                        string                  `xml:"Cc,omitempty"`
		Contact                   string                  `xml:"Contact,omitempty"`
		AltContact                string                  `xml:"AltContact,omitempty"`
		AdditionalContactRef      *[]AdditionalContactRef `xml:"AdditionalContactRef,omitempty"`
		ContactsMod               *[]ContactsRet          `xml:"ContactsMod,omitempty"`
		CustomerTypeRef           *AccountRef             `xml:"CustomerTypeRef,omitempty"`
		TermsRef                  *AccountRef             `xml:"TermsRef,omitempty"`
		SalesRepRef               *AccountRef             `xml:"SalesRepRef,omitempty"`
		SalesTaxCodeRef           *AccountRef             `xml:"SalesTaxCodeRef,omitempty"`
		ItemSalesTaxRef           *AccountRef             `xml:"ItemSalesTaxRef,omitempty"`
		ResaleNumber              string                  `xml:"ResaleNumber,omitempty"`
		AccountNumber             string                  `xml:"AccountNumber,omitempty"`
		CreditLimit               string                  `xml:"CreditLimit,omitempty"`
		PreferredPaymentMethodRef *AccountRef             `xml:"PreferredPaymentMethodRef,omitempty"`
		CreditCardInfo            *CreditCardInfo         `xml:"CreditCardInfo,omitempty"`
		JobStatus                 string                  `xml:"JobStatus,omitempty"` //may have one of the following values: Awarded, Closed, InProgress, None [DEFAULT], NotAwarded, Pending
		JobStartDate              string                  `xml:"JobStartDate,omitempty"`
		JobProjectedEndDate       string                  `xml:"JobProjectedEndDate,omitempty"`
		JobEndDate                string                  `xml:"JobEndDate,omitempty"`
		JobDesc                   string                  `xml:"JobDesc,omitempty"`
		JobTypeRef                *AccountRef             `xml:"JobTypeRef,omitempty"`
		Notes                     string                  `xml:"Notes,omitempty"`
		AdditionalNotesMod        *AdditionalNotes        `xml:"AdditionalNotesMod,omitempty"`
		PreferredDeliveryMethod   string                  `xml:"PreferredDeliveryMethod,omitempty"` //may have one of the following values: None [Default], Email, Fax
		PriceLevelRef             *AccountRef             `xml:"PriceLevelRef,omitempty"`
		CurrencyRef               *AccountRef             `xml:"CurrencyRef,omitempty"`
	} `xml:"CustomerMod,omitempty"`
	IncludeRetElement []string `xml:"IncludeRetElement,omitempty"`
}

CustomerModRq isis the struct to hold data for the customerModRq call

type CustomerModRs

type CustomerModRs struct {
	XMLName xml.Name `xml:"CustomerModRs"`
	ResponseStatus
	CustomerRet struct {
		ListID                    string               `xml:"ListID"`
		TimeCreated               string               `xml:"TimeCreated"`
		TimeModified              string               `xml:"TimeModified"`
		EditSequence              string               `xml:"EditSequence"`
		Name                      string               `xml:"Name"`
		FullName                  string               `xml:"FullName"`
		IsActive                  string               `xml:"IsActive"`
		ClassRef                  AccountRef           `xml:"ClassRef"`
		ParentRef                 AccountRef           `xml:"ParentRef"`
		Sublevel                  string               `xml:"Sublevel"`
		CompanyName               string               `xml:"CompanyName"`
		Salutation                string               `xml:"Salutation"`
		FirstName                 string               `xml:"FirstName"`
		MiddleName                string               `xml:"MiddleName"`
		LastName                  string               `xml:"LastName"`
		JobTitle                  string               `xml:"JobTitle"`
		BillAddress               Address              `xml:"BillAddress"`
		BillAddressBlock          Address              `xml:"BillAddressBlock"`
		ShipAddress               Address              `xml:"ShipAddress"`
		ShipAddressBlock          Address              `xml:"ShipAddressBlock"`
		ShipToAddress             []Address            `xml:"ShipToAddress"`
		Phone                     string               `xml:"Phone"`
		AltPhone                  string               `xml:"AltPhone"`
		Fax                       string               `xml:"Fax"`
		Email                     string               `xml:"Email"`
		Cc                        string               `xml:"Cc"`
		Contact                   string               `xml:"Contact"`
		AltContact                string               `xml:"AltContact"`
		AdditionalContactRef      AdditionalContactRef `xml:"AdditionalContactRef"`
		ContactsRet               ContactsRet          `xml:"ContactsRet"`
		CustomerTypeRef           AccountRef           `xml:"CustomerTypeRef"`
		TermsRef                  AccountRef           `xml:"TermsRef"`
		SalesRepRef               AccountRef           `xml:"SalesRepRef"`
		Balance                   string               `xml:"Balance"`
		TotalBalance              string               `xml:"TotalBalance"`
		SalesTaxCodeRef           AccountRef           `xml:"SalesTaxCodeRef"`
		ItemSalesTaxRef           AccountRef           `xml:"ItemSalesTaxRef"`
		ResaleNumber              string               `xml:"ResaleNumber"`
		AccountNumber             string               `xml:"AccountNumber"`
		CreditLimit               string               `xml:"CreditLimit"`
		PreferredPaymentMethodRef AccountRef           `xml:"PreferredPaymentMethodRef"`
		CreditCardInfo            CreditCardInfo       `xml:"CreditCardInfo"`
		JobStatus                 string               `xml:"JobStatus"`
		JobStartDate              string               `xml:"JobStartDate"`
		JobProjectedEndDate       string               `xml:"JobProjectedEndDate"`
		JobEndDate                string               `xml:"JobEndDate"`
		JobDesc                   string               `xml:"JobDesc"`
		JobTypeRef                AccountRef           `xml:"JobTypeRef"`
		Notes                     string               `xml:"Notes"`
		AdditionalNotesRet        AdditionalNotes      `xml:"AdditionalNotesRet"`
		PreferredDeliveryMethod   string               `xml:"PreferredDeliveryMethod"`
		PriceLevelRef             AccountRef           `xml:"PriceLevelRef"`
		ExternalGUID              string               `xml:"ExternalGUID"`
		CurrencyRef               AccountRef           `xml:"CurrencyRef"`
		DataExtRet                DataExtRet           `xml:"DataExtRet"`
	} `xml:"CustomerRet"`
	ErrorRecovery *ErrorRecovery `xml:"ErrorRecovery"`
}

CustomerModRs is the struct to hold data from the customer mod response

type CustomerMsgAddRq

type CustomerMsgAddRq struct {
	Name     string `xml:"Name"`
	IsActive string `xml:"IsActive"`
}

CustomerMsgAddRq is the struct to hold the information to add a customer message reference

type CustomerMsgQueryRq

type CustomerMsgQueryRq struct {
	XMLName           xml.Name         `xml:"CustomerMsgQueryRq,omitempty"`
	MetaData          string           `xml:"metaData,attr,omitempty"`
	ListID            string           `xml:"ListID,omitempty"`
	FullName          string           `xml:"FullName,omitempty"`
	MaxReturned       string           `xml:"MaxReturned,omitempty"`
	ActiveStatus      string           `xml:"ActiveStatus,omitempty"` //ActiveStatus may have one of the following values: ActiveOnly [DEFAULT], InactiveOnly, All
	FromModifiedDate  string           `xml:"FromModifiedDate,omitempty"`
	ToModifiedDate    string           `xml:"ToModifiedDate,omitempty"`
	NameFilter        *NameFilter      `xml:"NameFilter,omitempty"`
	NameRangeFilter   *NameRangeFilter `xml:"NameRangeFilter,omitempty"`
	IncludeRetElement []string         `xml:"IncludeRetElement,omitempty"`
}

CustomerMsgQueryRq is the struct to hold data for querying for customer messages

type CustomerMsgQueryRs

type CustomerMsgQueryRs struct {
	XMLName xml.Name `xml:"CustomerMsgQueryRs"`
	ResponseStatus
	CustomerMsgRet []struct {
		ListID       string `xml:"ListID"`
		TimeCreated  string `xml:"TimeCreated"`
		TimeModified string `xml:"TimeModified"`
		EditSequence string `xml:"EditSequence"`
		Name         string `xml:"Name"`
		IsActive     string `xml:"IsActive"`
	} `xml:"CustomerMsgRet"`
}

CustomerMsgQueryRs is the struct to hold data for the response to the customerMsgQuery call

type CustomerQueryRq

type CustomerQueryRq struct {
	XMLName            xml.Name            `xml:"CustomerQueryRq"`
	MetaData           string              `xml:"metaData,attr,omitempty"`
	Iterator           string              `xml:"iterator,attr,omitempty"`
	IteratorID         string              `xml:"iteratorID,attr,omitempty"`
	ListID             []string            `xml:"ListID,omitempty"`
	FullName           []string            `xml:"FullName,omitempty"`
	MaxReturned        int                 `xml:"MaxReturned,omitempty"`
	ActiveStatus       string              `xml:"ActiveStatus,omitempty"` //ActiveStatus may have one of the following values: ActiveOnly [DEFAULT], InactiveOnly, All
	FromModifiedDate   string              `xml:"FromModifiedDate,omitempty"`
	ToModifiedDate     string              `xml:"ToModifiedDate,omitempty"`
	NameFilter         *NameFilter         `xml:"NameFilter,omitempty"`
	NameRangeFilter    *NameRangeFilter    `xml:"NameRangeFilter,omitempty"`
	TotalBalanceFilter *TotalBalanceFilter `xml:"TotalBalanceFilter,omitempty"`
	CurrencyFilter     *CurrencyFilter     `xml:"CurrencyFilter,omitempty"`
	ClassFilter        *ClassFilter        `xml:"ClassFilte,omitempty"`
	IncludeRetElement  []string            `xml:"IncludeRetElement,omitempty"`
	OwnerID            []string            `xml:"OwnerID,omitempty"`
}

CustomerQueryRq is the struct to hold data for the customerQueryRq call

type CustomerQueryRs

type CustomerQueryRs struct {
	ResponseStatus
	RetCount               int           `xml:"retCount,attr"`
	IteratorRemainingCount int           `xml:"iteratorRemainingCount,attr"`
	IteratorID             string        `xml:"iteratorID,attr"`
	CustomerRet            []CustomerRet `xml:"CustomerRet"`
}

CustomerQueryRs aaa

type CustomerRet

type CustomerRet struct {
	ListID                    string                 `xml:"ListID"`
	TimeCreated               string                 `xml:"TimeCreated"`
	TimeModified              string                 `xml:"TimeModified"`
	EditSequence              string                 `xml:"EditSequence"`
	Name                      string                 `xml:"Name"`
	FullName                  string                 `xml:"FullName"`
	IsActive                  string                 `xml:"IsActive"`
	ClassRef                  AccountRef             `xml:"ClassRef"`
	ParentRef                 AccountRef             `xml:"ParentRef"`
	Sublevel                  string                 `xml:"Sublevel"`
	CompanyName               string                 `xml:"CompanyName"`
	Salutation                string                 `xml:"Salutation"`
	FirstName                 string                 `xml:"FirstName"`
	MiddleName                string                 `xml:"MiddleName"`
	LastName                  string                 `xml:"LastName"`
	JobTitle                  string                 `xml:"JobTitle"`
	BillAddress               Address                `xml:"BillAddress"`
	BillAddressBlock          Address                `xml:"BillAddressBlock"`
	ShipAddress               Address                `xml:"ShipAddress"`
	ShipAddressBlock          Address                `xml:"ShipAddressBlock"`
	ShipToAddress             []QBShipToAddress      `xml:"ShipToAddress"`
	Phone                     string                 `xml:"Phone"`
	AltPhone                  string                 `xml:"AltPhone"`
	Fax                       string                 `xml:"Fax"`
	Email                     string                 `xml:"Email"`
	CC                        string                 `xml:"Cc"`
	Contact                   string                 `xml:"Contact"`
	AltContact                string                 `xml:"AltContact"`
	AdditionalContactRef      []AdditionalContactRef `xml:"AdditionalContactRef"`
	ContactsRet               []ContactsRet          `xml:"ContactsRet"`
	CustomerTypeRef           AccountRef             `xml:"CustomerTypeRef"`
	TermsRef                  AccountRef             `xml:"TermsRef"`
	SalesRepRef               AccountRef             `xml:"SalesRepRef"`
	Balance                   string                 `xml:"Balance"`
	TotalBalance              string                 `xml:"TotalBalance"`
	SalesTaxCodeRef           AccountRef             `xml:"SalesTaxCodeRef"`
	ItemSalesTaxRef           AccountRef             `xml:"ItemSalesTaxRef"`
	ResaleNumber              string                 `xml:"ResaleNumber"`
	AccountNumber             string                 `xml:"AccountNumber"`
	CreditLimit               string                 `xml:"CreditLimit"`
	PreferredPaymentMethodRef AccountRef             `xml:"PreferredPaymentMethodRef"`
	CreditCardInfo            CreditCardInfo         `xml:"CreditCardInfo"`
	JobStatus                 string                 `xml:"JobStatus"`
	JobStartDate              string                 `xml:"JobStartDate"`
	JobProjectedEndDate       string                 `xml:"JobProjectedEndDate"`
	JobEndDate                string                 `xml:"JobEndDate"`
	JobDesc                   string                 `xml:"JobDesc"`
	JobTypeRef                AccountRef             `xml:"JobTypeRef"`
	Notes                     string                 `xml:"Notes"`
	AdditionalNotesRet        []AdditionalNotes      `xml:"AdditionalNotesRet"`
	PreferredDeliveryMethod   string                 `xml:"PreferredDeliveryMethod"`
	PriceLevelRef             AccountRef             `xml:"PriceLevelRef"`
	CurrencyRef               AccountRef             `xml:"CurrencyRef"`
}

CustomerRet is the struct to hold data for the customer query response

type DataExt

type DataExt struct {
	OwnerID      string `xml:"OwnerID"`
	DataExtName  string `xml:"DataExtName"`
	DataExtValue string `xml:"DataExtValue"`
}

DataExt Is part of the SalesReceiptLine items

type DataExtAddRq

type DataExtAddRq struct {
	OwnerID     string `xml:"OwnerID"`
	DataExtName string `xml:"DataExtName"`
	//<!-- BEGIN OR -->
	ListDataExtType string     `xml:"ListDataExtType"` //may have one of the following values: Account, Customer, Employee, Item, OtherName, Vendor
	ListObjRef      AccountRef `xml:"ListObjRef"`
	//<!-- OR -->
	TxnDataExtType string `xml:"TxnDataExtType"` //may have one of the following values: ARRefundCreditCard, Bill, BillPaymentCheck, BillPaymentCreditCard, BuildAssembly, Charge, Check, CreditCardCharge, CreditCardCredit, CreditMemo, Deposit, Estimate, InventoryAdjustment, Invoice, ItemReceipt, JournalEntry, PurchaseOrder, ReceivePayment, SalesOrder, SalesReceipt, SalesTaxPaymentCheck, VendorCredit -->
	TxnID          string `xml:"TxnID"`
	UseMacro       string `xml:"UserMacro,attr"`
	TxnLineID      string `xml:"TxnLineID"`
	//<!-- OR -->
	OtherDataExtType string `xml:"OtherDataExtType"` //may have one of the following values: Company -->
	//<!-- END OR -->
	DataExtValue string `xml:"DataExtValue"`
}

DataExtAddRq is the sruct to add custom data fields to a quick books object

type DataExtRet

type DataExtRet struct {
	DataExt
	DataExtType string `xml:"DataExtType"`
}

DataExtRet is part of some receipt line item returns

type DiscountCTX

type DiscountCTX struct {
	Type              string
	TotalDiscount     float64
	Discount          float64
	RemainingDiscount float64
	SubTotal          float64
}

DiscountCTX holds an orders discount contenxt

type ErrorRecovery

type ErrorRecovery struct {
	ListID       string `xml:"ListID"`
	OwnerID      string `xml:"OwnerID"`
	TxnID        string `xml:"TxnID"`
	TxnNumber    string `xml:"TxnNumber"`
	EditSequence string `xml:"EditSequence"`
	ExternalGUID string `xml:"ExternalGUID"`
}

ErrorRecovery hold information on tthe error that occoured

type GetLastErrorCTX

type GetLastErrorCTX struct {
	Ticket string `xml:"ticket"`
}

GetLastErrorCTX holds the information sent by QBWC in the GetLastError soap request

type GetLastErrorResponseCTX

type GetLastErrorResponseCTX struct {
	LastError string //blank if no error, string to indicate the error that occoured
}

GetLastErrorResponseCTX holds the context to fill the getLastError response

type ItemBaseRet

type ItemBaseRet struct {
	Name         string `xml:"Name"`
	FullName     string `xml:"FullName"`
	ListID       string `xml:"ListID"`
	TimeCreated  string `xml:"TimeCreated"`
	TimeModified string `xml:"TimeModified"`
	EditSequence string `xml:"EditSequence"`
	IsActive     string `xml:"IsActive"`
	Sublevel     string `xml:"Sublevel"`
}

ItemBaseRet has fields commont to all QBXML item return types

type ItemDiscountRet

type ItemDiscountRet struct {
	ItemBaseRet
	ItemDesc        string     `xml:"ItemDesc"`
	SalesTaxCodeRef AccountRef `xml:"SalesTaxCodeRef"`
	DiscountRate    string     `xml:"DiscountRate"`
	AccountRef      AccountRef `xml:"AccountRef"`
}

ItemDiscountRet is for the QBXML return type of ItemDiscountRet

type ItemGroupAdd

type ItemGroupAdd struct {
	Name                string          `xml:"Name"`
	BarCode             BarCode         `xml:"Barcode"`
	IsActive            string          `xml:"IsActive"`
	ItemDesc            string          `xml:"ItemDesc"`
	UnitOfMeasureSetRef AccountRef      `xml:"UnitOfMeasureSetRef"`
	IsPrintItemsInGroup string          `xml:"IsPrintItemsInGroup"`
	ExternalGUID        string          `xml:"ExternalGUID"`
	ItemGroupLine       []ItemGroupLine `xml:"ItemGroupLine"`
}

ItemGroupAdd holds the information for adding a group item

type ItemGroupAddRs

type ItemGroupAddRs struct {
	ResponseStatus
	ItemGroupRet  ItemGroupRet  `xml:"ItemGroupRet"`
	ErrorRecovery ErrorRecovery `xml:"ErrorRecovery"`
}

ItemGroupAddRs is the struct to hold the information from ItemGroupAdd responses

type ItemGroupLine

type ItemGroupLine struct {
	ItemRef       AccountRef `xml:"ItemRef"`
	Quantity      string     `xml:"Quantity"`
	UnitOfMeasure string     `xml:"UnitOfMeasure"`
}

ItemGroupLine is a piece of the ItemGroupRet

type ItemGroupRet

type ItemGroupRet struct {
	ItemBaseRet
	ItemDesc            string          `xml:"ItemDesc"`
	IsPrintItemsInGroup string          `xml:"IsPrintItemsInGroup"`
	ItemGroupLInes      []ItemGroupLine `xml:"ItemGroupLine"`
	BarCodeValue        string          `xml:"BarCodeValue"`
	UnitOfMeasureRef    AccountRef      `xml:"UnitOfMeasureRef"`
	SpecialItemType     string          `xml:"SpecialItemType"` //may have one of the following values: FinanceCharge, ReimbursableExpenseGroup, ReimbursableExpenseSubtotal
	ExternalGUID        string          `xml:"ExternalGUID"`
}

ItemGroupRet is for the QBXML return type of ItemGroupRet

type ItemInventoryAdd

type ItemInventoryAdd struct {
	Name                   string     `xml:"Name"`
	BarCode                BarCode    `xml:"BarCode"`
	IsActive               string     `xml:"IsActive"`
	ClassRef               AccountRef `xml:"ClassRef"`
	ParentRef              AccountRef `xml:"ParentRef"`
	ManufacturerPartNumber string     `xml:"ManufacturerPartNumber"`
	UnitOfMeasureSetRef    AccountRef `xml:"UnitOfMeasureSetRef"`
	SalesTaxCodeRef        AccountRef `xml:"SalesTaxCodeRef"`
	SalesDesc              string     `xml:"SalesDesc"`
	SalesPrice             string     `xml:"SalesPrice"`
	IncomeAccountRef       AccountRef `xml:"IncomeAccountRef"`
	PurchaseDesc           string     `xml:"PurchaseDesc"`
	PurchaseCost           string     `xml:"PurchaseCost"`
	COGSAccountRef         AccountRef `xml:"COGSAccountRef"`
	PrefVendorRef          AccountRef `xml:"PrefVendorRef"`
	AssetAccountRef        AccountRef `xml:"AssetAccountRef"`
	ReorderPoint           string     `xml:"ReorderPoint"`
	Max                    string     `xml:"Max"`
	QuantityOnHand         string     `xml:"QuantityOnHand"`
	TotalValue             string     `xml:"TotalValue"`
	InventoryDate          string     `xml:"InventoryDate"`
	ExternalGUID           string     `xml:"ExternalGUID"`
}

ItemInventoryAdd is for the QBXML request to add an item to QB

type ItemInventoryAddRs

type ItemInventoryAddRs struct {
	ResponseStatus
	ItemIventoryRet ItemIventoryRet `xml:"ItemInventoryRet"`
	ErrorRecovery   ErrorRecovery   `xml:"ErrorRecovery"`
}

ItemInventoryAddRs holds the information returned by Quick Books from and itemInventoryAdd request

type ItemIventoryRet

type ItemIventoryRet struct {
	ItemBaseRet
	SalesDesc            string     `xml:"SalesDesc"`
	SalesPrice           string     `xml:"SalesPrice"`
	IncomeAccountRef     AccountRef `xml:"IncomeAccountRef"`
	PurchaseCost         string     `xml:"PurchaseCost"`
	COGSAccountRef       AccountRef `xml:"COGSAccountRef"`
	AssetAccountRef      AccountRef `xml:"AssetAccountRef"`
	QuantityOnHand       int        `xml:"QuantityOnHand"`
	AverageCost          string     `xml:"AverageCost"`
	QuantityOnOrder      int        `xml:"QuantityOnOrder"`
	QuantityOnSalesOrder int        `xml:"QuantityOnSalesOrder"`
}

ItemIventoryRet is for the QBXML return type of ItemInventoryRet

type ItemNonInventoryRet

type ItemNonInventoryRet struct {
	ItemBaseRet
	ManufacturerPartNumber string          `xml:"ManufacturerPartNumber"`
	SalesOrPurchase        SalesOrPurchase `xml:"SalesOrPurchase"`
}

ItemNonInventoryRet is for the QBXML return type of ItemNonInventory

type ItemOtherChargeRet

type ItemOtherChargeRet struct {
	ItemBaseRet
	SalesOrPurchase SalesOrPurchase `xml:"SalesOrPurchase"`
}

ItemOtherChargeRet is for the QBXML return type ItemOtherCharge

type ItemQueryCTX

type ItemQueryCTX struct {
	//BEGIN OR
	ListID []string `xml:"ListID"`
	//OR
	FullName []string `xml:"FullName"`
	//OR
	MaxReturned      int    `xml:"MaxReturned"`
	ActiveStatus     string `xml:"ActiveStatus"` //ActiveStatus may have one of the following values: ActiveOnly [DEFAULT], InactiveOnly, All
	FromModifiedDate string `xml:"FromModifiedDate"`
	ToModifiedDate   string `xml:"ToModifiedDate"`
	//BEGIN OR 2
	NameFilter NameFilter `xml:"NameFilter"`
	//OR 2
	NameRangeFilter NameRangeFilter `xml:"NameRangeFilter"`
	//END OR & END OR 2
	IncludeRetElement []string `xml:"IncludeRetElement"`
	OwnerID           []string `xml:"OwnderID"`
}

ItemQueryCTX is the struct that holds the data for the qbxml ItemQuery request

type ItemQueryRs

type ItemQueryRs struct {
	ResponseStatus
	RequestID              string                `xml:"requestID,attr"`
	IteratorRemainingCount int                   `xml:"iteratorRemainingCount,attr,omitempty"`
	IteratorID             string                `xml:"iteratorID,attr,omitempty"`
	ItemServiceRets        []ItemServiceRet      `xml:"ItemServiceRet"`
	ItemInventoryRets      []ItemIventoryRet     `xml:"ItemInventoryRet"`
	ItemNonInventoryRets   []ItemNonInventoryRet `xml:"ItemNonInventoryRet"`
	ItemOtherChargeRets    []ItemOtherChargeRet  `xml:"ItemOtherChargeRet"`
	ItemSubtotalRets       []ItemSubtotalRet     `xml:"ItemSubtotalRet"`
	ItemDiscountRets       []ItemDiscountRet     `xml:"ItemDiscountRet"`
	ItemGroupRets          []ItemGroupRet        `xml:"ItemGroupRet"`
}

ItemQueryRs is the struct for Quickbooks Items

type ItemServiceAdd

type ItemServiceAdd struct {
	Name                string           `xml:"Name"`
	BarCode             BarCode          `xml:"Barcode"`
	IsActive            string           `xml:"IsActive"`
	ClassRef            AccountRef       `xml:"ClassRef"`
	ParentRef           AccountRef       `xml:"ParentRef"`
	UnitOfMeasureSetRef AccountRef       `xml:"UnitOfMeasureSetRef"`
	SalesTaxCodeRef     AccountRef       `xml:"SalesTaxCodeRef"`
	SalesOrPurchase     SalesOrPurchase  `xml:"SalesOrPurchase"`
	SalesAndPurchase    SalesAndPurchase `xml:"SalesAndPurchase"`
	ExternalGUID        string           `xml:"ExternalGUID"`
}

ItemServiceAdd is the struct that holds the item date when adding a service item to quickbooks

type ItemServiceAddRs

type ItemServiceAddRs struct {
	ResponseStatus
	ItemServiceRet ItemServiceRet `xml:"ItemServiceRet"`
	ErrorRecovery  ErrorRecovery  `xml:"ErrorRecovery"`
}

ItemServiceAddRs holds the information returned by Quick Books from and itemServiceAdd request

type ItemServiceRet

type ItemServiceRet struct {
	ItemBaseRet
	/*
		ListID               string     `xml:"ListID"`
		TimeCreated          string     `xml:"TimeCreated"`
		TimeModified         string     `xml:"TimeModified"`
		EditSequence         string     `xml:"EditSequence"`
		Name                 string     `xml:"Name"`
		FullName             string     `xml:"FullName"`
		IsActive             string     `xml:"IsActive"`
		Sublevel             string     `xml:"Sublevel"`
	*/
	SalesOrPurchase SalesOrPurchase `xml:"SalesOrPurchase"`
}

ItemServiceRet is for the QBXML return type of ItemServiceRet

type ItemSubtotalRet

type ItemSubtotalRet struct {
	ItemBaseRet
	ItemDesc string `xml:"ItemDesc"`
}

ItemSubtotalRet is for the QBXML return type of ItemSubtotalRet

type ItemUpdates

type ItemUpdates struct {
	UpdateCV3Items bool   `json:"updateCV3Items"` //if set to true, QB items will be uploaded to V3
	LastUpdate     string `json:"lastUpdate"`
	UpdateNewOnly  bool   `json:"updateNewOnly"`
}

ItemUpdates is part of the config to keep track of item updates

type LinkedTxn

type LinkedTxn struct {
	TxnID     string `xml:"TxnID"`
	TxnType   string `xml:"TxnType"` //TxnType may have one of the following values: ARRefundCreditCard, Bill, BillPaymentCheck, BillPaymentCreditCard, BuildAssembly, Charge, Check, CreditCardCharge, CreditCardCredit, CreditMemo, Deposit, Estimate, InventoryAdjustment, Invoice, ItemReceipt, JournalEntry, LiabilityAdjustment, Paycheck, PayrollLiabilityCheck, PurchaseOrder, ReceivePayment, SalesOrder, SalesReceipt, SalesTaxPaymentCheck, Transfer, VendorCredit, YTDAdjustment
	TxnDate   string `xml:"TxnDate"`
	RefNumber string `xml:"RefNumber"`
	LinkType  string `xml:"LinkType"` //LinkType may have one of the following values: AMTTYPE, QUANTYPE
	Amount    string `xml:"Amount"`
}

LinkedTxn is the struct to hold the data returned in a salesOrderAdd's LinkedTxnRet

type Logging

type Logging struct {
	Level      string `json:"Level"` //debug info warn error
	OutputPath string `json:"outputPath"`
}

Logging holds the logging data for the config

type MapData

type MapData struct {
	Data        string                   `json:"data"`        //the cv3 field name or the data to be hardcoded
	MappedField bool                     `json:"mappedField"` //indicates whether or not the data field is a hardcoded value or a cv3 field name
	SubMappings map[string]MappingObject `json:"subMappings"` //used to map the value found from the top level mapping to yet another value
}

MapData is one piece of a mapping object

type MappingObject

type MappingObject []MapData

MappingObject is the struct to hold all the information for a single field mapping

func (MappingObject) Display

func (mapObj MappingObject) Display(cv3Data ...*gabs.Container) string

Display will display the data in the MappingObject in its desired format

type NameFilter

type NameFilter struct {
	MatchCriterion string `xml:"MatchCriterion"` //REQUIRED MatchCriterion may have one of the following values: StartsWith, Contains, EndsWith
	Name           string `xml:"Name"`
}

NameFilter holds name filter data for ItemQueryCTX

type NameRangeFilter

type NameRangeFilter struct {
	FromName string `xml:"FromName"`
	ToName   string `xml:"ToName"`
}

NameRangeFilter holds name range data for ItemQueryCTX

type Node

type Node struct {
	XMLName xml.Name
	Content []byte `xml:",innerxml"`
	Nodes   []Node `xml:",any"`
}

Node is the struct used to recursively read the xml

type OrderOrReceiptAdd

type OrderOrReceiptAdd interface {
	BuildLineItems()
}

OrderOrReceiptAdd Interface for SalesOrders or SalesReceiptsAdds

type OrderSuccessTracker

type OrderSuccessTracker struct {
	OrderID               string //cv3 orderID
	ShipToLength          int    //how many shipTos in the order
	SuccessCount          int    //how many successful shipTos in the order
	ShipToSuccessTrackers map[int]ShipToSuccessTracker
}

OrderSuccessTracker is used as a map to keep track of what orders were impored successfully

type QBShipToAddress

type QBShipToAddress struct {
	Address
	Name          string `xml:"Name"`
	DefaultShipTo string `xml:"DefaultShipTo"`
}

QBShipToAddress holds a quickbooks customer's shipTo addresses

type QBXMLWork

type QBXMLWork []string

QBXMLWork is the slice of finished templates to be added to the top level template

func (*QBXMLWork) AppendWork

func (qbxmlWork *QBXMLWork) AppendWork(w string)

AppendWork checks if this is the first piece of work, as every piece of work after the first should have an extra newline character

type ReceiveResponseXMLCTX

type ReceiveResponseXMLCTX struct {
	Ticket   string `xml:"ticket,omitempty"`
	Response []byte `xml:"response,omitempty"`
	HResult  string `xml:"hresult,omitempty"`
	Message  string `xml:"message,omitempty"`
}

ReceiveResponseXMLCTX will hold the data send from QBWC's receiveResponseXML call

type ReceiveResponseXMLResponseCTX

type ReceiveResponseXMLResponseCTX struct {
	Complete int //the % of completed work.  100 means all work is done
}

ReceiveResponseXMLResponseCTX holds the context to fill the receiveResponseXML response

type ResponseStatus

type ResponseStatus struct {
	StatusCode     string `xml:"statusCode,attr"`
	StatusSeverity string `xml:"statusSeverity,attr"`
	StatusMessage  string `xml:"statusMessage,attr"`
}

ResponseStatus is a struct shared across multiple responses, holding status information

type SalesAndPurchase

type SalesAndPurchase struct {
	SalesDesc         string     `xml:"SalesDesc"`
	SalesPrice        string     `xml:"SalesPrice"`
	IncomeAccountRef  AccountRef `xml:"IncomeAccountRef"`
	PurchaseDesc      string     `xml:"PurchaseDesc"`
	PurchaseCost      string     `xml:"PurchaseCost"`
	ExpenseAccountRef AccountRef `xml:"ExpenseAccountRef"`
	PrefVendorRef     AccountRef `xml:"PrefVendorRef"`
}

SalesAndPurchase is the struct for the QBXML return item node SalesAndPurchase

type SalesOrPurchase

type SalesOrPurchase struct {
	Desc         string     `xml:"Desc"`
	Price        string     `xml:"Price"`
	PricePercent string     `xml:"PricePercent"`
	AccountRef   AccountRef `xml:"AccountRef"`
}

SalesOrPurchase is the struct for the QBXML return item node SalesOrPurchase

type SalesOrderAdd

type SalesOrderAdd struct {
	DiscountCTX             *DiscountCTX
	DefMacro                string `xml:"defmacro,attr"`
	CV3OrderID              string //to keep track of order success
	ShipToIndex             int
	CustomerRef             AccountRef               `xml:"CustomerRef"`
	ClassRef                AccountRef               `xml:"ClassRef"`
	TemplateRef             AccountRef               `xml:"TemplateRef"`
	TxnDate                 string                   `xml:"TxnDate"`
	RefNumber               string                   `xml:"RefNumber"`
	BillAddress             Address                  `xml:"BillAddress"`
	ShipAddress             Address                  `xml:"ShipAddress"`
	PONumber                string                   `xml:"PONumber"`
	TermsRef                AccountRef               `xml:"TermsRef"`
	DueDate                 string                   `xml:"DueDate"`
	SalesRepRef             AccountRef               `xml:"SalesRepRef"`
	FOB                     string                   `xml:"FOB"`
	ShipDate                string                   `xml:"ShipDate"`
	ShipMethodRef           AccountRef               `xml:"ShipMethodRef"`
	ItemSalesTaxRef         AccountRef               `xml:"ItemSalesTaxRef"`
	IsManuallyClosed        string                   `xml:"IsManuallyClosed"`
	Memo                    string                   `xml:"Memo"`
	CustomerMsgRef          AccountRef               `xml:"CustomerMsgRef"`
	IsToBePrinted           string                   `xml:"IsToBePrinted"`
	IsToBeEmailed           string                   `xml:"IsToBeEmailed"`
	CustomerSalesTaxCodeRef AccountRef               `xml:"CustomerSalesTaxCodeRef"`
	Other                   string                   `xml:"Other"`
	ExchangeRate            string                   `xml:"ExchangeRate"`
	ExternalGUID            string                   `xml:"ExternalGUID"`
	SalesOrderLineAdds      []SalesOrderLineAdd      `xml:"SalesOrderLineAdds"`
	SalesOrderLineGroupAdds []SalesOrderLineGroupAdd `xml:"SalesOrderLineGroupAdd"`
}

SalesOrderAdd is the struct to hold the variables for the qbxml call

func (*SalesOrderAdd) AddDiscount

func (orderAdd *SalesOrderAdd) AddDiscount(o *gabs.Container, shipToIndex int)

AddDiscount Adds a discount line item when a totalOrderDiscount exists

func (*SalesOrderAdd) AddOrderItem

func (orderAdd *SalesOrderAdd) AddOrderItem(sku string, prod interface{}, item, o *gabs.Container, skus map[string]interface{}, workCTX *WorkCTX, itemFieldMap map[string]MappingObject) interface{}

AddOrderItem will add the cv3 product data to the quickbooks return object

func (*SalesOrderAdd) AddShipping

func (orderAdd *SalesOrderAdd) AddShipping(shipTo *gabs.Container)

AddShipping will add a shipping line item

func (*SalesOrderAdd) AddTax

func (orderAdd *SalesOrderAdd) AddTax(o, shipTo *gabs.Container)

AddTax will add a tax item

type SalesOrderAddRs

type SalesOrderAddRs struct {
	ResponseStatus
	SalesOrderRet SalesReceiptRet `xml:"SalesOrderRet"`
	ErrorRecovery ErrorRecovery   `xml:"ErrorRecovery"`
}

SalesOrderAddRs is the top level struct for holding the information returned for a salesOrderAddRq

type SalesOrderLineAdd

type SalesOrderLineAdd struct {
	ItemRef                    AccountRef        `xml:"ItemRef"`
	Desc                       string            `xml:"Desc"`
	Quantity                   string            `xml:"Quantity"`
	UnitOfMeasure              string            `xml:"UnitOfMeasure"`
	Rate                       string            `xml:"Rate"`
	RatePercent                string            `xml:"RatePercent"`
	PriceLevelRef              AccountRef        `xml:"PriceLevelRef"`
	ClassRef                   AccountRef        `xml:"ClassRef"`
	Amount                     string            `xml:"Amount"`
	OptionForPriceRuleConflict string            `xml:"OptionForPriceRuleConflict"` //OptionForPriceRuleConflict may have one of the following values: Zero, BasePrice -->
	InventorySiteRef           AccountRef        `xml:"InventorySiteRef"`
	InventorySiteLocationRef   AccountRef        `xml:"InventorySiteLocationRef"`
	SerialNumber               string            `xml:"SerialNumber"`
	LotNumber                  string            `xml:"LotNumber"`
	SalesTaxCodeRef            AccountRef        `xml:"SalesTaxCodeRef"`
	IsManuallyClosed           string            `xml:"IsManuallyClosed"`
	Other1                     string            `xml:"Other1"`
	Other2                     string            `xml:"Other2"`
	DataExt                    []DataExt         `xml:"DataExt"`
	Attributes                 map[string]string //holds the cv3 attribute descriptions
}

SalesOrderLineAdd holds the information about the items in the sales order

type SalesOrderLineGroupAdd

type SalesOrderLineGroupAdd struct {
	ItemGroupRef             AccountRef `xml:"ItemGroupRef"`
	Quantity                 string     `xml:"Quantity"`
	UnitOfMeasure            string     `xml:"UnitOfMeasure"`
	InventorySiteRef         AccountRef `xml:"InventorySiteRef"`
	InventorySiteLocationRef AccountRef `xml:"InventorySiteLocationRef"`
	DataExt                  []DataExt  `xml:"DataExt"`
}

SalesOrderLineGroupAdd hold the information for the group items in a salesOrder

type SalesOrderLineGroupRet

type SalesOrderLineGroupRet struct {
	TxnLineID           string                `xml:"TxnLineID"`
	ItemGroupRef        AccountRef            `xml:"ItemGroupRef"`
	Desc                string                `xml:"Desc"`
	Quantity            string                `xml:"Quantity"`
	UnitOfMeasure       string                `xml:"UnitOfMeasure"`
	OverrideUOMSetRef   AccountRef            `xml:"OverrideUOMSetRef"`
	IsPrintItemsInGroup string                `xml:"IsPrintItemsInGroup"`
	TotalAmount         string                `xml:"TotalAmount"`
	SalesOrderLineRet   []SalesReceiptLineRet `xml:"SalesReceiptLineRet"`
	DataExtRet          DataExtRet            `xml:"DataExtRet"`
}

SalesOrderLineGroupRet hold the returned information from a sales order line group item

type SalesOrderLineRet

type SalesOrderLineRet struct {
	TxnLineID                string     `xml:"TxnLineID"`
	ItemRef                  AccountRef `xml:"ItemFef"`
	Desc                     string     `xml:"Desc"`
	Quantity                 string     `xml:"Quantity"`
	UnitOfMeasure            string     `xml:"UnitOfMeasure"`
	OverrideUOMSetRef        AccountRef `xml:"OverrideUOMSetRef"`
	Rate                     string     `xml:"Rate"`
	RatePercent              string     `xml:"RatePercent"`
	ClassRef                 AccountRef `xml:"ClassRef"`
	Amount                   string     `xml:"Amount"`
	InventorySiteRef         AccountRef `xml:"InventorySiteRef"`
	InventorySiteLocationRef AccountRef `xml:"InventorySiteLocationRef"`
	SerialNumber             string     `xml:"SerialNumber"`
	LotNumber                string     `xml:"LotNumber"`
	SalesTaxCodeRef          AccountRef `xml:"SalesTaxCodeRef"`
	Invoiced                 string     `xml:"Invoiced"`
	IsManuallyClosed         string     `xml:"IsManuallyClosed"`
	Other1                   string     `xml:"Other1"`
	Other2                   string     `xml:"Other2"`
	DataExtRet               DataExtRet `xml:"DataExtRet"`
}

SalesOrderLineRet hold the returned information from a sales order line item

type SalesOrderRet

type SalesOrderRet struct {
	TxnID                     string                 `xml:"TxnID"`
	TimeCreated               string                 `xml:"TimeCreated"`
	TimeModified              string                 `xml:"TimeModified"`
	EditSequence              string                 `xml:"EditSequence"`
	TxnNumber                 string                 `xml:"TxnNumber"`
	CustomerRef               AccountRef             `xml:"CustomerRef"`
	ClassRef                  AccountRef             `xml:"ClassRef"`
	TemplateRef               AccountRef             `xml:"TemplateRef"`
	TxnDate                   string                 `xml:"TxnDate"`
	RefNumber                 string                 `xml:"RefNumber"`
	BillAddress               Address                `xml:"BillAddress"`
	BillAddressBlock          Address                `xml:"BillAddressBlock"`
	ShipAddress               Address                `xml:"ShipAddress"`
	ShipAddressBlock          Address                `xml:"ShipAddressBlock"`
	PONumber                  string                 `xml:"PONumber"`
	TermsRef                  AccountRef             `xml:"TermsRef"`
	DueDate                   string                 `xml:"DueDate"`
	SalesRepRef               AccountRef             `xml:"SalesRepRef"`
	FOB                       string                 `xml:"FOB"`
	ShipDate                  string                 `xml:"ShipDate"`
	ShipMethodRef             AccountRef             `xml:"ShipMethodRef"`
	SubTotal                  string                 `xml:"SubTotal"`
	ItemSalesTaxRef           AccountRef             `xml:"ItemSalesTaxRef"`
	SalesTaxPercentage        string                 `xml:"SalesTaxPercentage"`
	SalesTaxTotal             string                 `xml:"SalesTaxTotal"`
	TotalAmount               string                 `xml:"TotalAmount"`
	CurrencyRef               AccountRef             `xml:"CurrencyRef"`
	ExchangeRate              string                 `xml:"ExchangeRate"`
	TotalAmountInHomeCurrency string                 `xml:"TotalAmountInHomeCurrency"`
	IsManuallyClosed          string                 `xml:"IsManUallyClosed"`
	IsFullyInvoiced           string                 `xml:"IsFullyInvoiced"`
	Memo                      string                 `xml:"Memo"`
	CustomerMsgRef            AccountRef             `xml:"CustomerMsgRef"`
	IsToBePrinted             string                 `xml:"IsToBePrinted"`
	IsToBeEmailed             string                 `xml:"IsToBeEmailed"`
	CustomerSalesTaxCodeRef   AccountRef             `xml:"CustomerSalesTaxCodeRef"`
	Other                     string                 `xml:"Other"`
	ExternalGUID              string                 `xml:"ExternalGUID"`
	LinkedTxn                 []LinkedTxn            `xml:"LinkedTxn"`
	SalesOrderLineRet         SalesOrderLineRet      `xml:"SalesReceiptLineRet"`
	SalesOrderLineGroupRet    SalesOrderLineGroupRet `xml:"SalesReceiptLineGroupRet"`
	DataExtRet                DataExtRet             `xml:"DataExtRet"`
}

SalesOrderRet holds the information from the sales Order add

type SalesReceiptAdd

type SalesReceiptAdd struct {
	DiscountCTX             *DiscountCTX
	DefMacro                string            `xml:"defmacro,attr"`
	CV3OrderID              string            //to keep track of order success
	ShipToIndex             int               //to keep track of orders with multiple shiptos
	CustomerRef             AccountRef        `xml:"CustomerRef,omitempty"`
	ClassRef                AccountRef        `xml:"ClassRef,omitempty"`
	TemplateRef             AccountRef        `xml:"TemplateRef,omitempty"`
	TxnDate                 string            `xml:"TxnDate,ommitempty"`
	RefNumber               string            `xml:"RefNumber,ommitempty"`
	BillAddress             Address           `xml:"BillAddress"`
	ShipAddress             Address           `xml:"ShipAddress"`
	IsPending               string            `xml:"IsPending,ommitempty"`
	CheckNumber             string            `xml:"CheckNumber,ommitempty"`
	PaymentMethodRef        AccountRef        `xml:"PaymentMethodRef,ommitempty"`
	DueDate                 string            `xml:"DueDate,ommitempty"`
	SalesRepRef             AccountRef        `xml:"SalesRepRef,ommitempty"`
	ShipDate                string            `xml:"ShipDate,ommitempty"`
	ShipMethodRef           AccountRef        `xml:"ShipMethodRef,ommitempty"`
	FOB                     string            `xml:"FOB,ommitempty"`
	ItemSalesTaxRef         AccountRef        `xml:"ItemSalesTaxRef,ommitempty"`
	Memo                    string            `xml:"Memo,ommitempty"`
	CustomerMsgRef          AccountRef        `xml:"CustomerMsgRef,ommitempty"`
	IsToBePrinted           bool              `xml:"IsToBePrinted,ommitempty"`
	IsToBeEmailed           bool              `xml:"IsToBeEmailed,ommitempty"`
	CustomerSalesTaxCodeRef AccountRef        `xml:"CustomerSalesTaxCodeRef,ommitempty"`
	DepositToAccountRef     AccountRef        `xml:"DepositToAccountRef,ommitempty"`
	CreditCardTxnInfo       CreditCardTxnInfo `xml:"CreditCardTxnInfo,ommitempty"`
	Other                   string            `xml:"Other,ommitempty"`
	ExchangeRate            float64           `xml:"ExchangeRate,ommitempty"`
	ExternalGUID            string            `xml:"ExternalGUID"` //ExternalGUID ragex = "0|(\{[0-9a-fA-F]{8}(\-([0-9a-fA-F]{4})){3}\-[0-9a-fA-F]{12}\})"
	//1<!-- BEGIN OR --> <<<probably
	SalesReceiptLineAdds []SalesReceiptLineAdd `xml:"SalesReceiptLineAdd,ommitempty"`
	//1<!-- OR -->
	SalesReceiptLineGroupAdd []SalesReceiptLineGroupAdd `xml:"SalesReceiptLineGroupAdd,ommitempty"`
	//1<!-- END OR -->
	IncludeRetElement string `xml:"IncludeRetElement,ommitempty"`
}

SalesReceiptAdd is the struct for added sales receipts from cv3 to qb

func (*SalesReceiptAdd) AddDiscount

func (receiptAdd *SalesReceiptAdd) AddDiscount(o *gabs.Container, shipToIndex int)

AddDiscount Adds a discount line item when a totalOrderDiscount exists

func (*SalesReceiptAdd) AddReceiptItem

func (receiptAdd *SalesReceiptAdd) AddReceiptItem(sku string, prod interface{}, item *gabs.Container, skus map[string]interface{}, workCTX *WorkCTX, itemFieldMap map[string]MappingObject) interface{}

AddReceiptItem will add the cv3 product data to the quickbooks return object

func (*SalesReceiptAdd) AddShipping

func (receiptAdd *SalesReceiptAdd) AddShipping(shipTo *gabs.Container)

AddShipping will add a shipping line item

func (*SalesReceiptAdd) AddTax

func (receiptAdd *SalesReceiptAdd) AddTax(o, shipTo *gabs.Container)

AddTax will add a tax item

type SalesReceiptAddRs

type SalesReceiptAddRs struct {
	ResponseStatus
	SalesReceiptRet SalesReceiptRet `xml:"SalesReciptRet"`
	ErrorRecovery   ErrorRecovery   `xml:"ErrorRecovery"`
}

SalesReceiptAddRs is the top level struct for holding the information returned for a salesReceiptAddRq

type SalesReceiptLineAdd

type SalesReceiptLineAdd struct {
	ItemRef       AccountRef `xml:"ItemRef"`
	Desc          string     `xml:"Desc,ommitempty"`
	Quantity      string     `xml:"Quantity,ommitempty"`
	UnitOfMeasure string     `xml:"UnitOfMeasure,ommitempty"`
	//2<!-- BEGIN OR -->
	Rate string `xml:"Rate,ommitempty"`
	//2<!-- OR -->
	RatePercent string `xml:"RatePercent,ommitempty"`
	//2<!-- OR -->
	PriceLevelRef AccountRef `xml:"PriceLevelRef,ommitempty"`
	//2<!-- END OR -->
	ClassRef                   AccountRef `xml:"ClassRef,ommitempty"`
	Amount                     string     `xml:"Amount,ommitempty"`
	OptionForPriceRuleConflict string     `xml:"OptionForPriceRuleConflict,ommitempty"`
	InventorySiteRef           AccountRef `xml:"InventorySiteRef,ommitempty"`
	InventorySiteLocationRef   AccountRef `xml:"InventorySiteLocationRef,ommitempty"`
	//2a<!-- BEGIN OR -->
	SerialNumber string `xml:"SerialNumber,ommitempty"`
	//2a<!-- OR -->
	LotNumber string `xml:"LotNumber,ommitempty"`
	//2a<!-- END OR -->
	ServiceDate            string            `xml:"ServiceDate,ommitempty"`
	SalesTaxCodeRef        AccountRef        `xml:"SalesTaxCodeRef,ommitempty"`
	OverrideItemAccountRef AccountRef        `xml:"OverrideItemAccount,ommitempty"`
	Other1                 string            `xml:"Other1,ommitempty"`
	Other2                 string            `xml:"Other2,ommitempty"`
	CreditCardTxnInfo      CreditCardTxnInfo `xml:"CreditCardTxnInfo,ommitempty"`
	DataExt                []DataExt         `xml:"DataExt,ommitempty"`
	Attributes             map[string]string //holds the cv3 attribute descriptions
}

SalesReceiptLineAdd one of the line item types for customerReceiptAdd

type SalesReceiptLineGroupAdd

type SalesReceiptLineGroupAdd struct {
	ItemGroupRef             AccountRef `xml:"ItemGroupRef"`
	Quantity                 string     `xml:"Quantity"`
	UnitOfMeasure            string     `xml:"UnitOfMeasure"`
	InventorySiteRef         AccountRef `xml:"InventorySiteRef"`
	InventorySiteLocationRef AccountRef `xml:"InventorySiteLocationRef"`
	DataExt                  []DataExt  `xml:"DataExt"`
}

SalesReceiptLineGroupAdd one of the line item types for customerReceiptAdd

type SalesReceiptLineGroupRet

type SalesReceiptLineGroupRet struct {
	TxnLineID           string                `xml:"TxnLineID"`
	ItemGroupRef        AccountRef            `xml:"ItemGroupRef"`
	Desc                string                `xml:"Desc"`
	Quantity            string                `xml:"Quantity"`
	UnitOfMeasure       string                `xml:"UnitOfMeasure"`
	OverrideUOMSetRef   AccountRef            `xml:"OverrideUOMSetRef"`
	IsPrintItemsInGroup string                `xml:"IsPrintItemsInGroup"`
	TotalAmount         string                `xml:"TotalAmount"`
	SalesReceiptLineRet []SalesReceiptLineRet `xml:"SalesReceiptLineRet"`
	DataExtRet          DataExtRet            `xml:"DataExtRet"`
}

SalesReceiptLineGroupRet hold the returned information from a sales receipt line group item

type SalesReceiptLineRet

type SalesReceiptLineRet struct {
	TxnLineID                string            `xml:"TxnLineID"`
	ItemRef                  AccountRef        `xml:"ItemFef"`
	Desc                     string            `xml:"Desc"`
	Quantity                 string            `xml:"Quantity"`
	UnitOfMeasure            string            `xml:"UnitOfMeasure"`
	OverrideUOMSetRef        AccountRef        `xml:"OverrideUOMSetRef"`
	Rate                     string            `xml:"Rate"`
	RatePercent              string            `xml:"RatePercent"`
	ClassRef                 AccountRef        `xml:"ClassRef"`
	Amount                   string            `xml:"Amount"`
	InventorySiteRef         AccountRef        `xml:"InventorySiteRef"`
	InventorySiteLocationRef AccountRef        `xml:"InventorySiteLocationRef"`
	SerialNumber             string            `xml:"SerialNumber"`
	LotNumber                string            `xml:"LotNumber"`
	ServiceDate              string            `xml:"ServiceDate"`
	SalesTaxCodeRef          AccountRef        `xml:"SalesTaxCodeRef"`
	Other1                   string            `xml:"Other1"`
	Other2                   string            `xml:"Other2"`
	CreditCardTxnInfo        CreditCardTxnInfo `xml:"CreditCardTxnInfo"`
	DataExtRet               DataExtRet        `xml:"DataExtRet"`
}

SalesReceiptLineRet hold the returned information from a sales receipt line item

type SalesReceiptPart

type SalesReceiptPart struct {
	Amount   string
	Quantity string
}

SalesReceiptPart is an itermediate struct used before we know if the cv3 item is a group or single

type SalesReceiptRet

type SalesReceiptRet struct {
	TxnID                     string                   `xml:"TxnID"`
	TimeCreated               string                   `xml:"TimeCreated"`
	TimeModified              string                   `xml:"TimeModified"`
	EditSequence              string                   `xml:"EditSequence"`
	TxnNumber                 string                   `xml:"TxnNumber"`
	CustomerRef               AccountRef               `xml:"CustomerRef"`
	ClassRef                  AccountRef               `xml:"ClassRef"`
	TemplateRef               AccountRef               `xml:"TemplateRef"`
	TxnDate                   string                   `xml:"TxnDate"`
	RefNumber                 string                   `xml:"RefNumber"`
	BillAddress               Address                  `xml:"BillAddress"`
	BillAddressBlock          Address                  `xml:"BillAddressBlock"`
	ShipAddress               Address                  `xml:"ShipAddress"`
	ShipAddressBlock          Address                  `xml:"ShipAddressBlock"`
	IsPending                 string                   `xml:"IsPending"`
	CheckNumber               string                   `xml:"CheckNumber"`
	PaymentMethodRef          AccountRef               `xml:"PaymentMethodRef"`
	DueDate                   string                   `xml:"DueDate"`
	SalesRepRef               AccountRef               `xml:"SalesRepRef"`
	ShipDate                  string                   `xml:"ShipDate"`
	ShipMethodRef             AccountRef               `xml:"ShipMethodRef"`
	FOB                       string                   `xml:"FOB"`
	SubTotal                  string                   `xml:"SubTotal"`
	ItemSalesTaxRef           AccountRef               `xml:"ItemSalesTaxRef"`
	SalesTaxPercentage        string                   `xml:"SalesTaxPercentage"`
	SalesTaxTotal             string                   `xml:"SalesTaxTotal"`
	TotalAmount               string                   `xml:"TotalAmount"`
	CurrencyRef               AccountRef               `xml:"CurrencyRef"`
	ExchangeRate              string                   `xml:"ExchangeRate"`
	TotalAmountInHomeCurrency string                   `xml:"TotalAmountInHomeCurrency"`
	Memo                      string                   `xml:"Memo"`
	CustomerMsgRef            AccountRef               `xml:"CustomerMsgRef"`
	IsToBePrinted             string                   `xml:"IsToBePrinted"`
	IsToBeEmailed             string                   `xml:"IsToBeEmailed"`
	CustomerSalesTaxCodeRef   AccountRef               `xml:"CustomerSalesTaxCodeRef"`
	DepositToAccountRef       AccountRef               `xml:"DepositToAccountRef"`
	CreditCardTxnInfo         CreditCardTxnInfo        `xml:"CreditCardTxnInfo"`
	Other                     string                   `xml:"Other"`
	ExternalGUID              string                   `xml:"ExternalGUID"`
	SalesReceiptLineRet       SalesReceiptLineRet      `xml:"SalesReceiptLineRet"`
	SalesReceiptLineGroupRet  SalesReceiptLineGroupRet `xml:"SalesReceiptLineGroupRet"`
	DataExtRet                DataExtRet               `xml:"DataExtRet"`
}

SalesReceiptRet holds the information from the sales receipt add

type SendRequestXMLResponseCTX

type SendRequestXMLResponseCTX struct {
	QBXML string //an escaped string of xml, that acts as insructions to Quick Books
}

SendRequestXMLResponseCTX holds the context to fill the sendRequestXML response

type ServerVersionResponseCTX

type ServerVersionResponseCTX struct {
	Version string //a string representing the version of this server
}

ServerVersionResponseCTX holts the context to fill the serverVersion response

type SessionCTX

type SessionCTX struct {
	Ticket            string      `xml:"ticket,omitempty"` //session id returned in the authenticate response
	HCPResponse       []byte      `xml:"strHCPResponse,omitempty"`
	CompanyFileName   string      `xml:"strCompanyFileName,omitempty"`
	QBXMLCountry      string      `xml:"qbXMLCountry,omitempty"`
	QBXMLMajorVersion string      `xml:"qbXMLMajorVers,omitempty"`
	QBXMLMinorVersion string      `xml:"qbXMLMinorVers,omitempty"`
	QBXMLWorkQueue    []string    `xml:",omitempty"`
	QBXMLWorkChan     chan string `xml:",omitempty"`
}

SessionCTX holds the session information

type ShipToSuccessTracker

type ShipToSuccessTracker struct {
	OrderID        string
	Index          int
	Success        bool
	QBErrorCode    string
	QBErrorMessage string
}

ShipToSuccessTracker is used as a slice in of OrderSuccessTracker, to keep track of which shipTos have been successfully added to Quick Bookis

type TotalBalanceFilter

type TotalBalanceFilter struct {
	Operator string `xml:"Operator,omitempty"` //Operator may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual
	Amount   string `xml:"Amount,omitempty"`
}

TotalBalanceFilter is the struct to hold data for customer queries

type WorkCTX

type WorkCTX struct {
	Attempted int    //keeps track of how many times this work was attempted
	Work      string //holds the excaped qbxml
	DataExts  []DataExtAddRq
	//TODO refactor Data to not be confused with DataExt
	Data          interface{}     //holds the struct that created the qbxml
	Order         *gabs.Container //holds the origional order information
	CV3Products   []cv3go.Product //holds the cv3 products used to make the qbxml
	Type          string          //type of qbxml request
	NoCustomer    bool            //set to true if there are problems with adding a customer name
	NoResendOrder bool            //used to teell CustomerAdd to not resent the order
}

WorkCTX is a struct that will hold both the work to be done, and the data used to create it

Directories

Path Synopsis
BACKUP YOUR FILES FIRST This is a tool to convert the old style maps into a more robust mapping style.
BACKUP YOUR FILES FIRST This is a tool to convert the old style maps into a more robust mapping style.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL