InvoiceMisc

The InvoiceMisc object contains the attributes of an additional charge, credit, or promotion that has been defined in ePASS. Examples of miscellanous items are delivery charges, instant rebates, and ‘“price matching”’ discounts.

Add a Miscellaneous Item to an Invoice

POST api/v1/invoicing/invoice/misc/add

This endpoint adds a miscellaneous item to an existing invoice. Miscellaneous items can’t be added to ePASS without an existing invoice to add them to.

Invoice Conditions

The following Invoice conditions must be satisfied in order to add any InvoiceMisc record.

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

Required Fields

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

Field Value
InvoiceCode Must be a valid Invoice Code.
Qty If not provided, defaults to 1.
MiscCode Must be a valid MiscCode that is not obsolete and Model Discount is false.
Misc or MiscType must be valid sales divisions as Invoice Type
If the current date is not between Misc.StartDate and Misc.EndDate, we will return a warning message.
Misc Code cannot be Tax1Included, Tax2Included and Tax3Included.
UserCreated Must be a valid User Code that is not Obsolete. If not provided it will use the Login User.

MiscCode

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

Key Value
MiscDesc Misc -> Description
UpdateHistory Misc -> History
GLRevenue Misc -> GLRevenue
GLCostCr Misc -> GLCostCr
GLCostDb Misc -> GLCostDb
Tax2 Misc -> Tax2
Tax3 Misc -> Tax3
Comment Misc -> CommentCode -> Comment.Description
Warranty If Misc.Warranty is Always Yes, then Yes.
If Misc.Warranty is Always No, then No.
If Misc.Warranty is From Invoice Type and Invoice.SvcInWarranty is No Warranty or Labor Warranty Only, then No, otherwiseYes.
UnitCost Misc -> Cost if Misc -> CostIsPercentageSellingPrice is True then UnitCost will be = Misc.List * Misc.Cost / 100

Potentially Required Fields

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

Field Value
SellingPrice If the Misc option Do Not Allow Price Reduction is True and 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 Misc list price.
If the Misc option Do Not Allow Price Change is True, then the SellingPrice must match the Misc list price.
Comment If the VarINV option Special Order Comment Required is True and option Special Order Misc Code is the provided MiscCode.
If the Misc option Require Note on Invoice is True.

addRelatedLines

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

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

Sample: Add a Misc. Charge to an Invoice

 {
    "tripNo": null,
    "comment": "Add Cool Device",
    "commissionCode": null,
    "branchCode": null,
    "glCostCr": null,
    "glCostDb": null,
    "glRevenue": null,
    "invoiceCode": "S03346734",
    "miscCode": "SERVICE",
    "miscDesc": null,
    "qty": null,
    "sellingPrice": null,
    "tax1": null,
    "tax2": null,
    "tax3": null,
    "unitCost": null,
    "userCreated": null,
    "warranty": null
}
 {
    "success": true,
    "message": null,
    "lastException": null,
    "recordId": 2751994,
    "code": null,
    "httpStatusCode": 201,
    "messageDetails": []
}

{
    "success": false,
    "warning": false,
    "httpStatusCode": 422,
    "generalMessage": "One or more of the fields has an invalid or missing value.",
    "exceptionMessage": null,
    "keys": [],
    "messages": [
        {
            "code": "INV-040021",
            "message": "Miscs are not allowed on Finished Invoices."
        }
    ],
    "warnings": []
}