PHPackages                             ahmeti/ubl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ahmeti/ubl

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ahmeti/ubl
==========

UBL (Universal Business Language) for PHP

2.8(1mo ago)01131MITPHPPHP &gt;=8.0

Since Jun 22Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ahmeti/ubl)[ Packagist](https://packagist.org/packages/ahmeti/ubl)[ Docs](https://github.com/ahmeti/ubl)[ RSS](/packages/ahmeti-ubl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (11)Used By (1)

UBL (Universal Business Language)
=================================

[](#ubl-universal-business-language)

Evrensel İş Dili (UBL), ISO/IEC 19845, tedarik zinciri, tedarik ve nakliye için satın alma emirleri, faturalar, nakliye lojistiği ve irsaliyeler gibi standart elektronik iş belgeleri ve bilgi modellerinin açık bir kütüphanesidir.

[https://en.wikipedia.org/wiki/Universal\_Business\_Language](https://en.wikipedia.org/wiki/Universal_Business_Language)

Fatura UBL Oluşturma
--------------------

[](#fatura-ubl-oluşturma)

```
$invoice = new Ahmeti\Ubl\Invoice(
    UBLVersionID: '2.1', // Uluslararası fatura standardı 2.1
    CustomizationID: 'TR1.2', // GİB UBLTR olarak isimlendirdiği Türkiye'ye özgü 1.2 efatura formatını kullanıyor.
    ProfileID: 'TICARIFATURA', // Ticari, temel vb. çeşitleri var. Ticari faturalarda sistem yanıtı (application response) döner.
    ID: 'FIT2017000000021', // Fatura seri numarası
    CopyIndicator: 'false', // Kopyası mı, asıl süret mi olduğu belirlenir
    UUID: '1d7f3f8b-0b0b-4c8b-8b1f-7f6b1f6b1f6b', // Fatura UUID
    IssueDate: '2021-09-01', // Fatura tarihi Y-m-d
    IssueTime: '12:00:00', // Fatura saati H:i:s
    InvoiceTypeCode: 'SATIS', // Gönderilecek fatura çeşidi, satış, iade vs.
    Note: ['Test not'], // İsteğe bağlı not alanı
    DocumentCurrencyCode: 'TRY', // Efatura para birimi
    LineCountNumeric: 1, // Fatura kalemlerinin sayısı
    AdditionalDocumentReference: [
        // Fatura ID otomatik oluşacak ise bu alanı göndermelisiniz.
        new Ahmeti\Ubl\DocumentReference(
            ID: '000000000000001', // ERP Fatura ID
            IssueDate: '2021-09-01', // Fatura tarihi Y-m-d
            DocumentTypeCode: 'CUST_INV_ID' // Fatura tipi
        ),
    ],
    AccountingSupplierParty: new Ahmeti\Ubl\AccountingSupplierParty(
        Party: new Ahmeti\Ubl\Party(
            WebsiteURI: 'https://ahmeti.com.tr',
            PartyIdentification: new Ahmeti\Ubl\PartyIdentification(
                ID: ['val' => '12345678901', 'attrs' => ['schemeID="VKN"']]
            ),
            PartyName: new Ahmeti\Ubl\PartyName(
                Name: 'Ahmet İmamoğlu'
            ),
            Person: new Ahmeti\Ubl\Person(
                FirstName: 'Ahmet',
                FamilyName: 'İmamoğlu'
            ),
            PostalAddress: new Ahmeti\Ubl\PostalAddress(
                Room: 'kapi no',
                StreetName: 'cadde',
                BuildingName: 'bina',
                BuildingNumber: 'bina no',
                CitySubdivisionName: 'mahalle',
                CityName: 'şehir',
                PostalZone: 'posta kodu',
                Region: 'bölge',
                Country: new Ahmeti\Ubl\Country(
                    Name: 'Türkiye'
                )
            ),
            PartyTaxScheme: new Ahmeti\Ubl\PartyTaxScheme(
                TaxScheme: new Ahmeti\Ubl\TaxScheme(
                    Name: 'Nilüfer'
                )
            ),
            Contact: new Ahmeti\Ubl\Contact(
                Telephone: 'telefon',
                Telefax: 'faks',
                ElectronicMail: 'mail adresi'
            )
        )
    ),
    AccountingCustomerParty: new Ahmeti\Ubl\AccountingCustomerParty(
        Party: new Ahmeti\Ubl\Party(
            WebsiteURI: 'https://ahmeti.com.tr',
            PartyIdentification: new Ahmeti\Ubl\PartyIdentification(
                ID: ['val' => '12345678901', 'attrs' => ['schemeID="VKN"']]
            ),
            PartyName: new Ahmeti\Ubl\PartyName(
                Name: 'GIB'
            ),
            Person: new Ahmeti\Ubl\Person(
                FirstName: 'ADI',
                FamilyName: 'SOYADI'
            ),
            PostalAddress: new Ahmeti\Ubl\PostalAddress(
                Room: 'kapi no',
                StreetName: 'cadde',
                BuildingName: 'bina',
                BuildingNumber: 'bina no',
                CitySubdivisionName: 'mahalle',
                CityName: 'şehir',
                PostalZone: 'posta kodu',
                Region: 'asd',
                Country: new Ahmeti\Ubl\Country(
                    Name: 'Türkiye'
                )
            ),
            PartyTaxScheme: new Ahmeti\Ubl\PartyTaxScheme(
                TaxScheme: new Ahmeti\Ubl\TaxScheme(
                    Name: 'Nilüfer'
                )
            ),
            Contact: new Ahmeti\Ubl\Contact(
                Telephone: 'telefon',
                Telefax: 'faks',
                ElectronicMail: 'mail adresi'
            )
        )
    ),
    AllowanceCharge: new Ahmeti\Ubl\AllowanceCharge(
        ChargeIndicator: false,
        Amount: ['val' => '0.01', 'attrs' => ['currencyID="TRY"']]
    ),
    TaxTotal: new Ahmeti\Ubl\TaxTotal(
        TaxAmount: ['val' => '0.01', 'attrs' => ['currencyID="TRY"']],
        TaxSubtotal: new Ahmeti\Ubl\TaxSubtotal(
            TaxableAmount: ['val' => '0.99', 'attrs' => ['currencyID="TRY"']],
            TaxAmount: ['val' => '0.01', 'attrs' => ['currencyID="TRY"']],
            TaxCategory: new Ahmeti\Ubl\TaxCategory(
                TaxScheme: new Ahmeti\Ubl\TaxScheme(
                    Name: 'KDV',
                    TaxTypeCode: '0015'
                )
            )
        )
    ),
    LegalMonetaryTotal: new Ahmeti\Ubl\LegalMonetaryTotal(
        LineExtensionAmount: ['val' => '1', 'attrs' => ['currencyID="TRY"']],
        TaxExclusiveAmount: ['val' => '0.99', 'attrs' => ['currencyID="TRY"']],
        TaxInclusiveAmount: ['val' => '1', 'attrs' => ['currencyID="TRY"']],
        AllowanceTotalAmount: ['val' => '0.01', 'attrs' => ['currencyID="TRY"']],
        PayableAmount: ['val' => '1', 'attrs' => ['currencyID="TRY"']]
    ),
    InvoiceLine: [
        new Ahmeti\Ubl\InvoiceLine(
            ID: '1',
            InvoicedQuantity: ['val' => '1', 'attrs' => ['unitCode="CMT"']],
            LineExtensionAmount: ['val' => '0.99', 'attrs' => ['currencyID="TRY"']],
            AllowanceCharge: new Ahmeti\Ubl\AllowanceCharge(
                ChargeIndicator: false,
                MultiplierFactorNumeric: '0.01',
                Amount: ['val' => '0.01', 'attrs' => ['currencyID="TRY"']],
                BaseAmount: ['val' => '1', 'attrs' => ['currencyID="TRY"']],
            ),
            TaxTotal: new Ahmeti\Ubl\TaxTotal(
                TaxAmount: ['val' => '0.01', 'attrs' => ['currencyID="TRY"']],
                TaxSubtotal: new Ahmeti\Ubl\TaxSubtotal(
                    TaxableAmount: ['val' => '0.99', 'attrs' => ['currencyID="TRY"']],
                    TaxAmount: ['val' => '0.01', 'attrs' => ['currencyID="TRY"']],
                    Percent: 18,
                    TaxCategory: new Ahmeti\Ubl\TaxCategory(
                        TaxScheme: new Ahmeti\Ubl\TaxScheme(
                            Name: 'KDV',
                            TaxTypeCode: '0015'
                        )
                    )
                )
            ),
            Item: new Ahmeti\Ubl\Item(
                Name: 'Test Ürün',
                Description: 'Test Ürün Açıklaması',
            ),
            Price: new Ahmeti\Ubl\Price(
                PriceAmount: ['val' => '1', 'attrs' => ['currencyID="TRY"']]
            )
        ),
    ]
);

$xml = (new Ahmeti\Ubl\Utils\UblInvoice($invoice))->getXML();
```

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance98

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~72 days

Recently: every ~117 days

Total

10

Last Release

37d ago

Major Versions

1.0 → 2.02024-12-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc658445844c864a8f57f4a8aa9f71db79bb686fa90f1a59b14c30aea8531a5c?d=identicon)[ahmeti](/maintainers/ahmeti)

---

Top Contributors

[![ahmeti](https://avatars.githubusercontent.com/u/5817450?v=4)](https://github.com/ahmeti "ahmeti (16 commits)")

---

Tags

languagebusinessubluniversal

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ahmeti-ubl/health.svg)

```
[![Health](https://phpackages.com/badges/ahmeti-ubl/health.svg)](https://phpackages.com/packages/ahmeti-ubl)
```

###  Alternatives

[phpoption/phpoption

Option Type for PHP

2.7k541.2M157](/packages/phpoption-phpoption)[patrickschur/language-detection

A language detection library for PHP. Detects the language from a given text string.

8513.2M18](/packages/patrickschur-language-detection)[wapmorgan/morphos

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time.

8351.3M7](/packages/wapmorgan-morphos)[coderello/laravel-nova-lang

Language support for Laravel Nova.

4251.2M2](/packages/coderello-laravel-nova-lang)[snipe/banbuilder

Library to easily handle profanity filtering in PHP projects.

3371.5M3](/packages/snipe-banbuilder)[florianv/business

DateTime calculations in business hours

359775.9k1](/packages/florianv-business)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
