quickbooks-0.5.0.1: QuickBooks API binding.

LicenseMaintainer :
StabilityPortability :
Safe HaskellNone
LanguageHaskell2010

QuickBooks.Types

Description

 

Synopsis

Documentation

data AppConfig Source

QuickBooks Application Keys

type APIEnv = (?apiConfig :: APIConfig, AppEnv, NetworkEnv) Source

type AppEnv = (?appConfig :: AppConfig, NetworkEnv) Source

type NetworkEnv = (?manager :: Manager, ?logger :: Logger) Source

salesItemLineDetail :: ItemRef -> SalesItemLineDetail Source

Create a sales item line detail with a reference to an item.

Example:

>>> let aSalesItemLineDetail = salesItemLineDetail ((reference "1") {referenceName = Just "Services"})
>>> salesItemLineDetailItemRef aSalesItemLineDetail
Just (Reference {referenceName = Just "Services", referenceType = Nothing, referenceValue = "1"})

salesItemLine :: Double -> SalesItemLineDetail -> Line Source

Create a sales item line with amount and details.

Example:

>>> let aSalesItemLineDetail = salesItemLineDetail ((reference "1") {referenceName = Just "Services"})
>>> let aSalesItemLine = salesItemLine 100.0 aSalesItemLineDetail

emptySalesItemLine :: Line Source

if you are using a salesItemLineDetail that has a Qty and a price it generates amount automatically

data Reference Source

A reference. In order to create a reference, use reference.

reference :: Text -> Reference Source

Create a reference with a value.

Example:

>>> reference "21"
Reference {referenceName = Nothing, referenceType = Nothing, referenceValue = "21"}

type CustomerRef = Reference Source

A reference to a customer or a job.

Example:

>>> (reference "21") {referenceName = Just "John Doe"} :: CustomerRef
Reference {referenceName = Just "John Doe", referenceType = Nothing, referenceValue = "21"}

data Invoice Source

An invoice transaction entity, that is, a sales form where the customer pays for a product or service later.

Business rules:

  • An invoice must have at least one Line that describes an item.
  • An invoice must have a CustomerRef.

In order to create an invoice, use defaultInvoice.

Constructors

Invoice 

defaultInvoice Source

Arguments

:: [Line]

The line items of a transaction

-> CustomerRef

Reference to a customer or a job

-> Invoice 

Create an Invoice with the minimum elements.

Example:

>>> let customer21 = reference "21" :: CustomerRef
>>> let aSalesItemLineDetail = salesItemLineDetail ((reference "1") {referenceName = Just "Services"})
>>> let aSalesItemLine = salesItemLine 100.0 aSalesItemLineDetail
>>> let anInvoice = defaultInvoice [aSalesItemLine] customer21

data Customer Source