Skip to content

nocodelab/laravel-fatture-in-cloud

 
 

Repository files navigation

Laravel-Fatture-in-Cloud-DarkLaravel-Fatture-in-Cloud-Light

Laravel wrapper for Fatture in Cloud API v2

Latest Version on Packagist GitHub Code Style Action Status Total Downloads


This Laravel wrapper allows you to integrate Fatture in Cloud using Api v2.

Requirements

  • Laravel >= 8.37
  • PHP >= 8.1
  • ext-json

Installation

You can install the package via composer:

composer require datomatic/laravel-fatture-in-cloud

Optionally, you can publish the config file with:

php artisan vendor:publish --provider="Datomatic\FattureInCloud\FattureInCloudServiceProvider" --tag="laravel-fatture-in-cloud-config"

This is the contents of the published config file:

return [
    'access_token'  => env('FATTURE_IN_CLOUD_ACCESS_TOKEN'),
    'company_id'  => env('FATTURE_IN_CLOUD_COMPANY_ID'),
    'endpoint' => env('FATTURE_IN_CLOUD_ENDPOINT','https://api-v2.fattureincloud.it/'),
];

Usage

Get FattureInCloud class from service container or using FattureInCloud Facade.

use Datomatic\FattureInCloud\Facades\FattureInCloud;
//Facade
FattureInCloud::invoice()->...

use Datomatic\FattureInCloud\FattureInCloud;

//Automatic Injection
public function __construct(FattureInCloud $fic){}

//Resolve
$fic = App::make(FattureInCloud::class);
$fic = app(Datomatic\FattureInCloud\FattureInCloud::class);

Use the Fatture In CLoud utilities classes

$fic->clients()->create([... user array...]);

Please see the functionalities and the array to pass on Official Documentation

This is the utilities covered:

  • user()
  • info()
  • products()
  • clients()
  • suppliers()
  • invoices()
  • quotes()
  • proformas()
  • receipts()
  • deliveryNotes()
  • creditNotes()
  • orders()
  • work_reports()
  • supplierOrders()
  • expenses()
  • passiveCreditNotes()
  • passiveDeliveryNotes()
  • paymentAccounts()
  • paymentMethods()

Enums

To improve the use of api usage is included a comfortable list of utilities enums:

  • DocumentStatus
  • EntityType
  • IssuedDocumentType
  • ReceivedDocumentType
  • PaymentStatus

Utilities

The Fatture in CLoud API accept only a fullname on country field 🤦‍♂️ so i add a Datomatic\FattureInCloud\Utilities\CountryConverter utility class with fromAlpha2 and fromName methods.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Laravel wrapper for Fatture in Cloud API v2

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%