Download the PHP package bambamboole/gaeb without Composer

On this page you can find all versions of the php package bambamboole/gaeb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gaeb

gaeb-php

A small PHP library that parses GAEB DA XML 3.3 files (exchange phases X80–X87 plus X89 invoices) into a typed, readonly PHP object graph, and writes schema-valid X84 bids, X87 order confirmations, and X89 invoices back out. Reading is lenient — missing optional elements simply become null instead of throwing. Writing is strict — see "Writing a bid (X84)" and "Writing an X89 invoice from a contract" below.

Install

Requires PHP ^8.4 and the ext-dom extension (usually bundled) plus brick/math for decimal-exact money handling in the write path. No other runtime dependencies. Built on PHP 8.4's native Dom\XMLDocument API for lightweight XML processing.

Usage

All money and quantity fields in the object graph are Brick\Math\BigDecimal (?BigDecimal, never floats) — values stay decimal-exact end to end, and json_encode() emits them as strings ("45.50"). Non-numeric content in a numeric element reads as null (lenient), like every other unparseable field.

$gaeb->info exposes the GAEB version, exchange phase (80–89), date, and generating program. $gaeb->project exposes the project name, label, and currency. $gaeb->boq is null when the file has no bill of quantities; otherwise it holds the BoQ label/currency/totals plus the top-level category/item tree, and allItems() lazily yields every Item depth-first with its full position number (rNo, e.g. 01.02.0030) resolved. An item's descriptionXml holds the raw XML (the serialized Description element, self-contained with its own xmlns="…" declaration).

The read model covers the money-relevant LV elements beyond plain items: markup/surcharge positions (markupItems on BoQ/BoQCategory, with type, IDREF references, sub-quantities, and — on the priced side — percent and totals), remarks and performanceDescriptions, category totals and notApplicable (NotApplBoQ), unit-price components (Item->upComponents plus the BoQ->noUpComponents/upComponentLabels breakdown labels), item-level vat and discountPercent, per-rate Totals->vatParts, Totals->netUpComponents, and the notOffered/qtyToBeDetermined flags (a not-offered position is distinct from a 0.00 unit price).

X84/X86 files also expose the parties and award data:

Nachträge (change orders) are exposed on every level that carries them: $gaeb->award->changeOrders lists the AwardInfo/COInfo entries (ChangeOrder — number, phase, ChangeOrderStatus, initiator, reason, date), and BoQ, BoQCategory and Item each expose changeOrderNo/changeOrderStatus from their CONo/COStatus pair (null on main-contract elements). createInvoice() refuses to bill a Nachtrag position whose status is not Approved and carries the CONo/COStatus pair into the written X89.

Item classification & totals

Each Item also carries: provisional (Provisional::WithoutTotal|WithTotal — a Bedarfsposition, null when the item isn't one), hourlyWork (Stundenlohnarbeiten), notApplicable (a dropped/void position), and alternativeGroupNo/alternativeSerialNo (the ALNGroupNo/ALNSerNo pair linking a base position to its alternatives). Sum semantics are the caller's responsibility: for an alternative group only the awarded serial number counts, Provisional::WithoutTotal and notApplicable items are excluded from BoQ totals, and hourlyWork items are typically listed separately from the main sum.

$gaeb->boq->totals (?Totals) holds the full breakdown when present: total, discountPercent, discountAmount, totalAfterDiscount, vat, vatAmount, totalNet, totalGross.

Bid data

Each Item also carries three bid-related fields. textComplements (list<TextComplement>) are the Bieterlücken — gaps embedded in the short/long text that either the tendering office fills in (TextComplementKind::Owner) or the bidder must fill in (TextComplementKind::Bidder). bidderComment is every BidComm on the item flattened and joined with "\n" (null when absent). subDescriptions (list<SubDescription>) are the item's SubDescr children, each with its own subDNo, shortText/longText/ descriptionXml, qty, unit, and unitPrice.

Find the gaps a bidder still needs to fill:

Writing a bid (X84)

GaebDocument opens a received tender (X81/X83) and turns it into a new, schema-valid X84 bid — the source document is never mutated. Collect the bid's prices, filled bidder text gaps, and comments on a Bid builder, then transform:

The computed BoQ total sums each emitted item's IT, excluding Provisional::WithoutTotal items and non-base alternatives (alternativeGroupNo set with alternativeSerialNo !== 1); notApplicable items are never emitted at all. Reading tolerates schema deviations and wild-file spellings; writing refuses to guess — anything that would corrupt or invalidate the bid (a missing price, an unknown rNo) throws GaebWriteException instead of silently producing a bad file.

Writing an X89 invoice from a contract

Reading X89 files works through the same parser: $gaeb->invoice carries the header, parties (with tax number), payments and gross total; billed items appear in the BoQ with Item->billedQty.

E-invoice attachment (X86 → X89B)

Under Germany's e-invoicing mandate the commercial invoice travels as XRechnung/ZUGFeRD — the GAEB X89B ("Rechnungsbegründende Unterlage") is the audit attachment carrying the billed LV alongside it. It applies the same strict billing rules as createInvoice() (cumulative quantities, Nachtrag approval, exact money), but by design carries no commercial data: no recipient, shares, payments, or invoice-level TotalGross — those live in the e-invoice. Its header holds only RefInvoiceNo (the e-invoice's number, taken from Invoice::$invoiceNo) and the service period, so the same Invoice builder produces both documents:

Payments and invoice type/date on the Invoice are used by the X89 twin and simply have no representation in the X89B.

Confirming an order (X86 → X87)

The contractor's order confirmation is a re-stamp of the received contract — same content under the DA87 namespace with DP 87 and a fresh GAEBInfo:

Together with createBid() and createInvoice() this closes the contractor workflow: bid (X84) → confirm (X87) → invoice (X89).

GaebDocument::validate(?string $xsdDir = null): array schema-checks the document against the XSDs bundled in the package, resolved per DP token and phase family under docs/gaeb/3.3/ — 2021-05_Leistungsverzeichnis/ for X80–X87, 2021-05_Rechnung/ for X89/X89B; pass $xsdDir to validate against a different XSD set instead. An empty array means valid; otherwise it's the flattened list of libxml error strings.

Custom drivers / instance API

GaebParser::fromString() is a shortcut for new GaebParser. Use the instance API directly to inject your own driver(s):

The library performs no file I/O on documents: it takes XML strings (or an existing Dom\XMLDocument via GaebDocument::fromDocument()) and returns objects/strings — reading from and writing to disk is the caller's concern. The only files it touches are its own bundled XSDs in validate().

Drivers are tried in order; the first one whose supports(string $content): bool returns true handles the parse. Implement Bambamboole\Gaeb\Driver\Driver to add support for another format without touching this library.

Out of scope

These may be added later without breaking the public API.

Testing

All fixtures under tests/fixtures/ are synthetic, hand-crafted XML files written for this project to exercise specific parsing paths — see tests/fixtures/README.md.

License

MIT — see LICENSE.md.


All versions of gaeb with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-dom Version *
brick/math Version ^0.19.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bambamboole/gaeb contains the following files

Loading the files please wait ...