Download the PHP package justinholtweb/craft-holding without Composer

On this page you can find all versions of the php package justinholtweb/craft-holding. 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 craft-holding

Holding

Craft Commerce → Holded. Orders become invoices, customers become contacts, payments and refunds land where your accountant expects them — with Spanish and EU VAT handled properly.

Holded is the accounting and ERP platform most Spanish SMEs run their books on. Holding is the bridge from a Craft Commerce shop to it: every completed order arrives as a real document in Holded, numbered from your own series, addressed to a real contact, carrying the VAT treatment the sale actually calls for and the legal wording that treatment requires.

Requires Craft CMS 5.3+, Craft Commerce 5.0+ and PHP 8.2+. $149, one edition — everything below is in it.


What it does


Getting started

  1. Install the plugin and open Settings → Plugins → Holding.
  2. In Holded, go to Settings → Developers → Credentials and add an API token with invoicing permissions. Put it in your .env:

    and reference it in the settings screen as $HOLDED_API_KEY, so it never enters project config.

  3. Press Test the connection, then Re-read Holded's lists. That fills the numbering series, bank account, payment method, warehouse and tax dropdowns from your own account.
  4. Map your VAT rates to your Holded tax keys — 21 → s_iva_21 and so on. They are listed in Holded under Settings → Billing → Taxes.
  5. Send one order by hand from its order screen and look at what arrives in Holded before you switch Send orders automatically on.

How VAT is decided

Holding never changes what a customer was charged. Commerce already took the money, and an invoice that disagrees with the payment is worse than no invoice at all. What Holding decides is how the sale is classified, which controls the tax key on each line, the legal wording on the document, and whether you get told that the charge and the classification disagree.

The rules, in the order they are applied:

Situation Treatment VAT
Postcode in Canarias, Ceuta, Melilla (or Büsingen, Livigno, Åland, Mount Athos…) Excluded territory Exempt — art. 3 LIVA
Same country as the shop Domestic Whatever was charged
Another EU state, business, valid VAT number Reverse charge Exempt — art. 84 LIVA / art. 196 of the Directive
Another EU state, consumer, OSS on One Stop Shop Destination country's standard rate
Another EU state, consumer, OSS off Domestic Home rate
Outside the EU Export Exempt — art. 21 LIVA

The excluded-territory check runs first, deliberately: Canarias is in Spain and is not in Spanish VAT, and getting that ordering wrong is the most common way a Spanish shop invoices incorrectly.

Every order's classification, and the reasoning behind it, is shown on the order screen before anything is sent.

Tax identifiers

NIF, NIE and CIF are validated properly — check letter and all — and the VAT numbers of all 27 member states are format-checked before VIES is ever bothered. A tax id that does not check out is a warning on the document by default, not a refusal; turn on Refuse to sync an invalid Spanish tax id if you would rather the order waited for a human.

The tax id goes into Holded's contact code field. Holded has no vatnumber field on a contact — writing one is accepted and silently discarded.

VIES

VIES is the only thing that can tell you a VAT number is really registered, and it is regularly unavailable — individual member states' registers go down for hours at a time. So a VIES answer here is one of three things and never two: valid, invalid, or unknown. What happens on unknown is your decision (Charge VAT or Accept a well-formed number), because charging VAT you did not need to and not charging VAT you did are both expensive, in different directions.

One Stop Shop

Holding ships the EU standard rates, dated, and the settings screen tells you when they were last checked. Rates move; anything you put in the override table wins. Turning OSS on does not change what Commerce charges — set your Commerce tax rates to match, and Holding will tell you when they have drifted apart.


What ends up on the document

Lines come from the order's own adjustments, not from a recalculation:

The document then gets read back from Holded and its total compared with the order's. If they disagree, the document is flagged. That check is the single most useful thing this plugin does, and it is why the Line subtotal setting is safe to get wrong: you find out immediately.

Approving

Holded files a document as a draft unless it is told to approve it, and a draft is invisible in Sales → Invoices, on the contact and in search — it exists, but nobody can find it. Holding approves by default. The trade is that Holded locks an approved document permanently, so re-syncing one is refused with an explanation rather than attempted: issue a credit note, or delete it in Holded first.


Console

holding/sync/preview is the one to reach for when something looks wrong: it prints the VAT classification, the reasoning behind it, every line with its rate and tax key, and the document total against the order total, without touching Holded.

Worth putting on cron:


Templates

craft.holding.document(order, docType) the document Holding holds for an order
craft.holding.documents(order) all of them, credit notes included
craft.holding.invoiceNumber(order) the number Holded gave it, or null
craft.holding.isSynced(order) whether it made it
craft.holding.downloadUrl(order) the customer's own PDF link
craft.holding.treatment(order) how the sale is classified, and why

Every method takes the order element or its id, because an email template and an account page rarely have the same one to hand.

The customer PDF download is fetched from Holded on demand, so it is always the real document. It requires the order's full number and, by default, the email address on the order; failures are throttled per IP and every failure answers identically, because telling a stranger that an order number exists is itself a disclosure.


Extending it

EVENT_AFTER_PUSH_DOCUMENT fires once Holded has accepted it, with the document id and number filled in.


What it costs

$149, one edition. There is no free tier and no feature held back: a shop that needs the VAT engine needs the credit notes and the OSS rates too, and a plugin that files an accountant's documents is a poor place to discover which half you bought.

The licence covers one Craft site, with updates for a year. Craft's own licensing handles the rest.


Things worth knowing

Support

[email protected]


All versions of craft-holding with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
craftcms/cms Version ^5.3.0
craftcms/commerce Version ^5.0.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 justinholtweb/craft-holding contains the following files

Loading the files please wait ...