JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 368
  • Score
    100M100P100Q74899F
  • License MIT

Enhanced szamlazz.js with additional features like dijbekeroSzamlaszam support

Package Exports

  • @ribbery009/szamlazz-ts
  • @ribbery009/szamlazz-ts/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ribbery009/szamlazz-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

szamlazz-ts

Enhanced TypeScript version of szamlazz.js with additional features like dijbekeroSzamlaszam support.

Features

  • Full TypeScript support with type safety
  • Compatible with original szamlazz.js API
  • NEW: dijbekeroSzamlaszam field support for referencing proforma invoices
  • Support for multiple currencies, payment methods, and languages
  • Full XML generation for Szamlazz.hu API

Installation

npm install szamlazz-ts

Usage

Basic Invoice Creation

import { Invoice, Buyer, Item, Currencies, PaymentMethods, Languages, TaxSubjects } from 'szamlazz-ts'

// Create buyer
const buyer = new Buyer({
  name: 'Example Company Ltd.',
  country: 'Hungary',
  zip: '1234',
  city: 'Budapest',
  address: 'Example Street 1.',
  taxSubject: TaxSubjects.Company,
  taxNumber: '12345678-1-23'
})

// Create item
const item = new Item({
  label: 'Example Product',
  quantity: 2,
  unit: 'pcs',
  vat: 27,
  netUnitPrice: 1000
})

// Create invoice
const invoice = new Invoice({
  buyer: buyer,
  items: [item],
  currency: Currencies.HUF,
  paymentMethod: PaymentMethods.BankTransfer,
  language: Languages.Hungarian
})

Using dijbekeroSzamlaszam (NEW FEATURE!)

// Create prepayment invoice with reference to proforma
const prepaymentInvoice = new Invoice({
  buyer: buyer,
  items: [item],
  currency: Currencies.HUF,
  paymentMethod: PaymentMethods.BankTransfer,
  prepaymentInvoice: true,
  dijbekeroSzamlaszam: 'DIJB-2024-001' // Reference to proforma invoice
})

Advance Invoice → Final Invoice Workflow (NEW!)

// 1. Create advance invoice (előlegszámla)
const advanceInvoice = new Invoice({
  buyer: buyer,
  items: [advanceItem], // Partial work/payment
  prepaymentInvoice: true,
  currency: Currencies.HUF
})

// 2. Create final invoice (végszámla) referencing the advance invoice
const finalInvoice = new Invoice({
  buyer: buyer,
  items: [fullWorkItems], // Complete work items
  finalInvoice: true,
  elolegSzamlaszam: 'ELOLEG-2024-001', // Reference to advance invoice
  currency: Currencies.HUF
})

This implements the complete Hungarian invoicing workflow for advance payments and final settlements.

API Reference

Invoice Options

  • issueDate?: Date - Invoice issue date
  • fulfillmentDate?: Date - Service fulfillment date
  • dueDate?: Date - Payment due date
  • buyer: Buyer - Invoice buyer (required)
  • items: Item[] - Invoice items (required)
  • currency?: Currency - Invoice currency
  • paymentMethod?: PaymentMethod - Payment method
  • language?: Language - Invoice language
  • prepaymentInvoice?: boolean - Is prepayment invoice (előlegszámla)
  • finalInvoice?: boolean - NEW! Is final invoice (végszámla)
  • elolegSzamlaszam?: string - NEW! Reference to advance invoice number
  • dijbekeroSzamlaszam?: string - NEW! Reference to proforma invoice number

Constants

  • Currencies: Available currencies (HUF, EUR, USD, etc.)
  • PaymentMethods: Available payment methods
  • Languages: Available languages
  • TaxSubjects: Tax subject types

License

MIT

Migration from szamlazz.js

This package is fully compatible with the original szamlazz.js API. Simply replace:

// Old
import { Invoice } from 'szamlazz.js'

// New
import { Invoice } from 'szamlazz-ts'

// Everything works the same, plus you get TypeScript support and the new dijbekeroSzamlaszam field!