Skip to main content

EMaC Weekly Invoice Export

Introduction

EMaC requires a weekly CSV export of invoices raised in ViSN for a specific lease company.
Each invoice produces multiple CSV lines (Parts, Labour, and optionally MOT), and the export job compiles all such lines over a configurable “lookback” window (default: last 7 days).

Purpose

EMaC will import the generated CSV file into their downstream accounting/processing systems.

File format

CSV - *.csv (comma separated, first row is a header row).

Fields

Column PositionHeader NameDescriptionRulesMandatory
ABookingIDViSN Enquiry NumberstringY
BProductName

hard coded to

  • Parts
  • Labour
  • MOT
stringY
CJobDate

Vehicle Checked-In Date on the enquiry

date

[DDMMYYYY]

Y
DAssetID

Policy Details > Policy Number

stringY
EVehicleRegNumberVehicle RegstringY
FSuppliedByName

Policy Details > Purchase Location Site (Dealer)

stringY
GSiteName

Name of Supplier on the Enquiry

stringY
H1LinkSNInvoiceNo

Supplier Invoice Number

stringY
IClaimAuthorisationCode

Purchase Order Number entered on the enquiry (if available)

stringN
JInvoiceNumber

Sequential Invoice number

EMaC{sequenceNumber}

stringY
KInvoiceDate

Invoice file generation date

date

[DDMMYYYY]

Y
LNetAmountSN

Net amount from SN amounts (line-type specific aggregation)

  • Parts

    • for catalogue adjustedPrice or subTotal
    • for non catalogue part line total
    • Ex: The value would be 18.90 + 0.00 + 76.00 = 94.90 for the below invoice

  • Labour

    • for catalogue always 0
    • for non catalogue labourRate x labourTime
    • Ex: The value would be (20.30 x 1) + (20.30 x 0.1) + (20.30 x 1) = 42.63 for the below invoice

  • MOT

    • mot cost
    • Ex: The value would be 49.99 for the below invoice

numberY
MVATAmountSN

VAT amount from SN amounts (line-type specific aggregation)

  • Parts - Use the VAT rate associated with the Parts value / catalogue value from the invoice drawer

    • for catalogue Catalogue job line total × VAT rate / 100
    • for non-catalogue Parts price × VAT rate / 100
    • Ex: The value would be (18.90 x 20/100) + (0.00 x 20/100) + (76.00 x 20/100) = 18.98 for the below invoice

  • Labour - Use the VAT rate associated with the Labour value from the invoice drawer

    • for catalogue always 0
    • for non-catalogue (Labour rate × Labour time) × VAT rate / 100
    • Ex: The value would be ((20.30 x 1) x 20/100)) + ((20.30 x 0.1) x 20/100)) + ((20.30 x 1) x 20/100)) = 8.53 for the below invoice

  • MOT - Use the VAT rate associated with MOT from the invoice drawer

    • MOT cost × VAT rate / 100
    • Ex: The value would be 49.99 x (0/100) = 0.00 for the below invoice

numberY
NLineTotalSN

NetAmountSN + VATAmountSN

numberY
OUplift %

Uplift percent applied for Invoice Allstar values

  • Parts - 5%
  • Labour - 5%
  • MOT - 0%
numberY
PNetValueInvoiceAllstar

Net value for Invoice Allstar

  • Parts

    • NetValueInvoiceAllstar = NetAmountSN × 1.05
    • Uplift applied: 5%
    • Ex: The value would be (18.90 x 1.05) + (0.00 x 1.05) + (76.00 x 1.05) = 99.65 for the below invoice

  • Labour

    • NetValueInvoiceAllstar = NetAmountSN × 1.05
    • Uplift applied: 5%
    • Ex: The value would be ((20.30 x 1) x 1.05)) + ((20.30 x 0.1) x 1.05)) + ((20.30 x 1) x 1.05)) = 44.76 for the below invoice

  • MOT

    • NetValueInvoiceAllstar = NetAmountSN × 1.00
    • Uplift applied: 0%
    • Ex: The value would be 49.99 x 1 = 49.99 for the below invoice

numberY
QVATValueInvoiceAllstar

VAT value for Invoice Allstar

  • Parts

    • Use the VAT rate associated with the Parts value / catalogue value from the invoice drawer
    • VAT is calculated using the uplifted net value
    • Ex: The value would be ((18.90 x 1.05) x 20/100)) + ((0.00 x 1.05) x 20/100)) + ((76.00 x 1.05) x 20/100)) = 19.93 for the below invoice

  • Labour

    • Use the VAT rate associated with the Labour value from the invoice drawer
    • VAT is calculated using the uplifted net value
    • Ex: The value would be (((20.30 x 1) x 1.05))x 20/100) + (((20.30 x 0.1) x 1.05)) x 20/100) + (((20.30 x 1) x 1.05)) x 20/100) = 8.96 for the below invoice

  • MOT

    • Use the VAT rate associated with MOT from the invoice drawer
    • No uplift is applied for MOT (multiplier 1.00)
    • Ex: The value would be (49.99 x 1) x (0/100) = 0.00 for the below invoice

numberY
RLineTotalInvoiceAllstar

NetValueInvoiceAllstar + VATValueInvoiceAllstar

numberY

Data source

At the time of invoicing, an EMaC weekly export record is generated and kept ready for export

doc: /accounts/[AccountId]/serviceUnits/[ServiceUnitId]/enquiries/[EnquiryId]/invoices/emacWeeklyExportRecord
attribute: records

Sequence number

Sequence numbers are derived from a base reference date and base sequence number stored under the lease company exports settings:

doc: /leasecompany/[LeaseId]/exports/settings
attribute: emacInvoiceExportsSequenceNumber

{
"emacInvoiceExportsSequenceNumber": {
"baseReferenceDate": "2026-01-05T00:00:00.000Z",
"baseSequenceNumber": 1
}
}

Setup Required

Database Configuration

This export is targeted for EMaC lease companies alone, Hence storing these records for other companies is not required.

To prevent the records generated for non-EMaC customers, A flag needs to be enabled in the lease company's export configuration to restrict the data export to EMaC customers only

location: /leasecompany/[leaseId]/config/exportsConfig
attribute: createEmacInvoiceCSV
value: true

Generate Export

A Scheduler should be created cloud scheduler with the following parameters

  • Name : GenerateEmacWeeklyExportCSV
  • Region : europe-west2
  • Frequency : 59 23 * * 7
  • TimeZone : GMT London
  • Topic : projects/biddirect-2/topics/generateEmacWeeklyExportCSV
  • Message body : a JSON object including the following parameters

    • dateTimeStamp : in format yyyy-MMM-dd ex 2022-Sep-30 , when skipped it will default to current date

    • leaseCompanyId : id that needs to be considered for emac lease

    • forNoOfPreviousDays : No.of.days the export should go back from the date mentioned, when skipped defaults to 7 i. e., a week

    • destinationFolder : folder which the export file must be placed in, when skipped defaults to emac-weekly-exports

Status: Accepted
Category: Protected
Revisions
11 Feb, 2026 - Add EMaC weekly invoice export documentation