Skip to content

nickbg321/documents-calculation-challenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clippings.com invoicing command challange

Clipping's challenges you to create a PHP console command, that lets you sum invoice documents in different currencies via a file.

This is a small task to evaluate potential hires.

Requirements

  • PHP >= 7.2

Installation

composer install

Usage

Command:

php calculator import data.csv USD EUR:1 USD:1.19057 GBP:0.891710 --vat=123456789

Class usage:

$calculator = (new CalculatorBuilder())
    ->setData($data)
    ->setCurrencies([
        new Currency('EUR', 1),        
        new Currency('USD', 1.19057),    
        new Currency('GBP', 0.891710),    
    ])
    ->setFilters([
        new Column('Vat number', 123456789)       
    ])
    ->setOutputCurrency(new Currency('EUR'))
    ->build();

$totals = $calculator->getTotals();

Example output:

Customer Test - 147.58 EUR
Customer Clippings - 180.89 ERU

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%