InvoiceLabor

The InvoiceLabor object represents a labor fee that can be added to an invoice. Labor fees usually represent the selling price of a product installation.

Add an Installation Charge to an Invoice


POST /invoicing/invoice/labor/add


This endpoint adds a labor fee to an open invoice. Labor fees can’t be added to EPASS without an existing open invoice to add them to.

Invoice Conditions

An invoice must meet this list of conditions before you can add a labor fee to it.

Condition Value
Invoice Status Invoice Status must be Open or Committed.
Branch Code Must be a valid Branch Code.
If not provided it will use the branch supplied during the login process, and if that is empty it uses the constant value DEFAULT.
Invoice JobStatus Any Job Status cascading that is configured in EPASS will be enforced through the API.
Bill To Customer BillToCustomer must be allowed to charge if the invoice is not estimate and the payment type is AR.
Credit Limits will be enforced in the following situation:
- The invoice is not an estimate
- Credit Limit is enabled for the Customer
- The Invoice Payment Type is AR
- Require Credit Approval is disabled
- Either the Job Status is dispatchable or Dispatching is disabled completely

Payload

Required Fields

The following fields are the absolute minimum fields that should be required to add a labor fee to an invoice.

Field Type Description Max Length
InvoiceCode string Must be a valid Invoice Code. 20
LaborRateCode string Required if the Invoice Variable option Require Labor Code is True.
Must be a valid LaborRate Code.
20
TechnicianCode string Must be a valid Technician Code. 5
UserCreated string Must be a valid User Code that is not Obsolete. If not provided it will use the Login User. 5

Optional Fields

The following fields are optional and not required.

Field Type Description Max Length
TripNo integer Used to identify each trip that is made to the service location.
TimeIn string The service call start time. 5
TimeInAM string AM or PM. 2
TimeOut string The service call end time. 5
TimeOutAM string AM or PM. 2
JobStatus string Must be a valid JobStatus code. Job Status is used to indicate the current state of the Invoice in relation to the sales or service process. 20
TechnicianInvoiceNumber string The technician’s invoice number. 250
TechnicianBillingNumber string The technician’s billing number. 250
BranchCode string Must be a valid BranchCode. BranchCode is configured in EPASS and is used to identify a specific store branch. 7
Rate integer The technician’s labor rate.
ServiceDate date Format: YYY-MM-DD. The date of the service call.
TechnicianDesc string The technician’s name. 30
TimeCharged integer The number of chargeable hours.
TripChargeAmt integer The amount charged for the service call.
TripChargeTime integer The service call length (in minutes).

LaborRateCode

If a valid LaborRateCode is provided then the following values will be defaulted from the LaborRate. You can override any of the values that would come from the LaborRate simply by providing your own value.

Key Type Value Max Length
Cost integer LaborRate -> Cost
GLRevenue string LaborRate -> GLRevenue 20
GLCostCr string LaborRate -> GLCostCredit 20
GLCostDb string LaborRate -> GLCostDebit 20
Tax1 bit LaborRate -> Tax1
Tax2 bit LaborRate -> Tax2
Tax3 bit LaborRate -> Tax3
ActualCost integer LaborRate -> ActualCost
StandardCost integer LaborRate -> StandardCost
TripCharge bit LaborRate -> TripCharge
FlatRate bit LaborRate -> FlatRate
Warranty string If LaborRate option “Warranty” is True, then “Yes” else “No” 4

Potentially Required Fields

These fields may be required depending on your EPASS configuration, or there is unique behavior that needs to be mentioned.

Field Type Description Max Length
SellingPrice integer If the BillTo customer has a valid project code, then the SellingPrice cannot be less than the project price.
If the Misc option Do Not Allow Price Reduction is True and Qty is greater than 0, then the SellingPrice cannot be less than the list price.
If the Misc option “Do Not Allow Price Change” is True, then the SellingPrice must be the list price.
HdthsMin string Default Hundredths 10
NardaCode string Default Demand 10
TimeRate string Default Regular 10

addRelatedLines

The adding of related detail lines can be controlled using the addRelatedLines object. If not provided then no related detail lines will be added.

Key Value Description
Comment Boolean Determines if related Comment lines are added

Sample: Adding a Labor Charge to an Invoice

 POST /invoicing/invoice/labor/add

{
    "userCreated": "CAPI",
    "tripNo": null,
    "timeIn": "10:00",
    "timeInAM": "am",
    "timeOut": "12:00",
    "timeOutAM": "pm",
    "jobStatus": null,
    "technicianInvoiceNumber": null,
    "technicianBillingNumber": null,
    "branchCode": null,
    "flatRate": null,
    "HdthsMin": null,
    "invoiceCode": "123456",
    "laborRateCode": "01",
    "nardaCode": null,
    "rate": 15,
    "ServiceDate": "2021-06-18",
    "tax2": true,
    "tax3": true,
    "technicianCode": "AM",
    "technicianDesc": "Alex Murphy",
    "timeCharged": 1.5,
    "timeRate": null,
    "tripCharge": true,
    "tripChargeAmt": 60,
    "tripChargeTime": 30
}

{
    "success": true,
    "warning": false,
    "httpStatusCode": 201,
    "generalMessage": null,
    "exceptionMessage": null,
    "keys": [
        {
            "table": "InvoiceLabor",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 7
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceAddress",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 123456
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceAudit",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 123456
                        }
                    ]
                }
            ]
        }
    ],
    "messages": [],
    "warnings": []
}

 {
    "success": false,
    "message": "One or more of the fields has an invalid or missing value.",
    "lastException": null,
    "recordId": 0,
    "code": null,
    "httpStatusCode": 422,
    "messageDetails": [
        "TechnicianCode does not exist.",
        "LaborRateCode code does not exist."
    ]
}