Skip to content

Construction Work Documents (E12)

The E12 forms are used for construction work (oikodomiko ergo / techniko ergo) personnel declarations. There are two variants:

  • E12: Daily personnel declaration for construction work
  • E12Apogr: Census (periodic summary) declaration for construction work

Overview

FormAction CodeContainer ModelEmployee ModelUse Case
E12E12ConstructionWorkConstructionEmployeeDaily personnel declaration
E12ApogrE12ApogrConstructionCensusConstructionCensusEmployeePeriodic census declaration

E12 vs E12Apogr

FeatureE12E12Apogr
GranularityPer-day, per-employeeMonthly summary
Employee TimeDate + from/to timesDays worked count
CancellationPer-entry cancellation flagNot applicable
Year/MonthNot included (implicit from dates)Required fields

E12: Construction Work Declaration

Basic Usage

php
use OxygenSuite\OxygenErgani\Http\Documents\Construction\ConstructionWorkDeclaration;
use OxygenSuite\OxygenErgani\Models\Construction\ConstructionWork;
use OxygenSuite\OxygenErgani\Models\Construction\ConstructionEmployee;

$employee = ConstructionEmployee::make()
    ->setAfm('123456789')
    ->setAmka('15038512345')
    ->setAma('12345678')
    ->setLastName('ΠΑΠΑΔΟΠΟΥΛΟΣ')
    ->setFirstName('ΙΩΑΝΝΗΣ')
    ->setFatherName('ΝΙΚΟΛΑΟΣ')
    ->setDate('15/01/2025')
    ->setTimeFrom('07:00')
    ->setTimeTo('15:00')
    ->setCancellation(false)
    ->setSpecialtyCode('123456')
    ->setHireDate('01/01/2024')
    ->setGrossDailyWage(80.00);

$declaration = ConstructionWork::make()
    ->setBranchCode(0)
    ->setAmoe('ΑΜΟΕ123456')
    ->setDateFrom('15/01/2025')
    ->setDateTo('15/01/2025')
    ->setLaborInspectionCode('12345')
    ->setMunicipalityCode('0101')
    ->addEmployee($employee);

$response = (new ConstructionWorkDeclaration())->handle($declaration);

Via Ergani Facade

php
use OxygenSuite\OxygenErgani\Ergani;

$ergani = new Ergani($accessToken);
$responses = $ergani->sendConstructionWork($declaration);

Container Fields (ConstructionWork)

MethodAPI FieldTypeRequiredDescription
setBranchCode()f_aa_pararthmatosint|stringYesBranch sequence number
setAmoe()f_amoestringYesAMOE registration number
setRelatedProtocol()f_rel_protocolstringNoRelated submission protocol
setRelatedDate()f_rel_dateDateTime|stringNoRelated submission date
setDateFrom()f_date_fromDateTime|stringYesPeriod start date (DD/MM/YYYY)
setDateTo()f_date_toDateTime|stringYesPeriod end date (DD/MM/YYYY)
setPhase()f_phasestringNoConstruction phase
setLaborInspectionCode()f_ypiresia_sepestringYesSEPE service code
setMunicipalityCode()f_kallikratis_pararthmatosstringNoMunicipality code
setComments()f_commentsstringNoAdditional comments

Employee Fields (ConstructionEmployee)

MethodAPI FieldTypeRequiredDescription
setAfm()f_afmstringYesEmployee tax ID
setAmka()f_amkastringYesSocial security number
setAma()f_amastringNoIKA insurance number
setLastName()f_eponymostringYesLast name
setFirstName()f_onomastringYesFirst name
setFatherName()f_onoma_paterastringYesFather's name
setDate()f_dateDateTime|stringYesWork date (DD/MM/YYYY)
setTimeFrom()f_fromstringYesShift start time (HH:MM)
setTimeTo()f_tostringYesShift end time (HH:MM)
setCancellation()f_cancellationstring|boolNoCancel this entry (0/1)
setSpecialtyCode()f_stepstringYesSpecialty code
setWorkPermitNumber()f_ar_adeiasstringNoWork permit number
setHireDate()f_hire_dateDateTime|stringYesHire date (DD/MM/YYYY)
setGrossDailyWage()f_apodoxesfloatYesGross daily wage (Greek float)
setNotes()f_notesstringNoNotes

Managing Employees

php
// Add one at a time
$declaration->addEmployee($employee1);
$declaration->addEmployee($employee2);

// Or set all at once
$declaration->setEmployees([$employee1, $employee2]);

// Access employees
$employees = $declaration->getEmployees();
$first = $declaration->getEmployee(0);

E12Apogr: Construction Work Census

Basic Usage

php
use OxygenSuite\OxygenErgani\Http\Documents\Construction\ConstructionWorkCensus;
use OxygenSuite\OxygenErgani\Models\Construction\ConstructionCensus;
use OxygenSuite\OxygenErgani\Models\Construction\ConstructionCensusEmployee;

$employee = ConstructionCensusEmployee::make()
    ->setAfm('123456789')
    ->setAmka('15038512345')
    ->setAma('12345678')
    ->setLastName('ΠΑΠΑΔΟΠΟΥΛΟΣ')
    ->setFirstName('ΙΩΑΝΝΗΣ')
    ->setFatherName('ΝΙΚΟΛΑΟΣ')
    ->setDaysWorked(22)
    ->setSpecialtyCode('123456')
    ->setHireDate('01/01/2024')
    ->setGrossEarnings(1500.00);

$declaration = ConstructionCensus::make()
    ->setBranchCode(0)
    ->setAmoe('ΑΜΟΕ123456')
    ->setDateFrom('01/01/2025')
    ->setDateTo('31/01/2025')
    ->setYear(2025)
    ->setMonth(1)
    ->setLaborInspectionCode('12345')
    ->setMunicipalityCode('0101')
    ->addEmployee($employee);

$response = (new ConstructionWorkCensus())->handle($declaration);

Via Ergani Facade

php
$ergani = new Ergani($accessToken);
$responses = $ergani->sendConstructionWorkCensus($declaration);

Container Fields (ConstructionCensus)

Same as ConstructionWork plus:

MethodAPI FieldTypeRequiredDescription
setYear()f_yearstring|intYesCensus year
setMonth()f_monthstring|intYesCensus month

Employee Fields (ConstructionCensusEmployee)

MethodAPI FieldTypeRequiredDescription
setAfm()f_afmstringYesEmployee tax ID
setAmka()f_amkastringYesSocial security number
setAma()f_amastringNoIKA insurance number
setLastName()f_eponymostringYesLast name
setFirstName()f_onomastringYesFirst name
setFatherName()f_onoma_paterastringYesFather's name
setDaysWorked()f_days_workedint|stringYesTotal days worked in period
setSpecialtyCode()f_stepstringYesSpecialty code
setWorkPermitNumber()f_ar_adeiasstringNoWork permit number
setHireDate()f_hire_dateDateTime|stringYesHire date (DD/MM/YYYY)
setGrossEarnings()f_apodoxesfloatYesGross earnings for period (Greek float)
setNotes()f_notesstringNoNotes

Response Handling

php
// E12
$response = (new ConstructionWorkDeclaration())->handle($declaration);

// E12Apogr
$response = (new ConstructionWorkCensus())->handle($declaration);

foreach ($response as $result) {
    echo $result->id;              // Unique submission ID
    echo $result->protocol;        // Protocol number
    echo $result->submissionDate->format('d/m/Y H:i:s');
}

Retrieve PDF

php
$pdfBase64 = (new ConstructionWorkDeclaration())->pdf(
    $response[0]->protocol,
    $response[0]->submissionDate
);

file_put_contents('construction-work.pdf', base64_decode($pdfBase64));

Best Practices

  1. AMOE Number: Always provide the correct AMOE registration number for the construction site.

  2. Municipality Code: Use the Kallikratis code for the construction site location, not the company's registered address.

  3. Daily vs Census: Use E12 for daily personnel tracking and E12Apogr for monthly summary reports.

  4. Cancellation: To cancel an individual employee entry in E12, resubmit with setCancellation(true) rather than cancelling the entire declaration.

  5. Greek Float: Wage fields (f_apodoxes) are automatically formatted as Greek floats (e.g., 1.500,00).

Testing with Factories

All construction models support factories for generating test data:

php
use OxygenSuite\OxygenErgani\Models\Construction\ConstructionWork;
use OxygenSuite\OxygenErgani\Models\Construction\ConstructionCensus;

// E12 - Construction Work Declaration
$work = ConstructionWork::factory()->make();

// With state methods
$work = ConstructionWork::factory()
    ->mainBranch()
    ->withPhase('Foundation')
    ->withEmployees(3)
    ->make();

// E12Apogr - Construction Work Census
$census = ConstructionCensus::factory()
    ->forPeriod(1, 2026)
    ->withEmployees(5)
    ->make();

// Employee factories
$employee = ConstructionEmployee::factory()
    ->withDailyWage(120.00)
    ->withHours('07:00', '15:00')
    ->make();

$censusEmployee = ConstructionCensusEmployee::factory()
    ->withDaysWorked(22)
    ->withGrossEarnings(1760.00)
    ->make();

See Also

Released under the MIT License.