Completed
Push — master ( d5813d...c092e1 )
by Giancarlos
02:48
created

DocumentFilter::getNameCurrency()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 6.9849

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
ccs 3
cts 7
cp 0.4286
rs 9.2
cc 4
eloc 6
nc 4
nop 1
crap 6.9849
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Administrador
5
 * Date: 20/01/2018
6
 * Time: 12:27 PM.
7
 */
8
9
namespace Greenter\Report\Filter;
10
11
/**
12
 * Class DocumentFilter.
13
 */
14
class DocumentFilter
15
{
16
    /**
17
     * @var array
18
     */
19
    private $store;
20
21
    /**
22
     * DocumentFilter constructor.
23
     */
24 20
    public function __construct()
25
    {
26 20
        $this->store = [
27
            '01' => [
28 20
              '01' => 'FACTURA',
29 20
              '03' => 'BOLETA',
30 20
              '07' => 'NOTA DE CRÉDITO',
31 20
              '08' => 'NOTA DE DÉBITO',
32 20
              '09' => 'GUÍA DE REMISIÓN',
33 20
              '20' => 'RETENCIÓN',
34 20
              '40' => 'PERCEPCIÓN',
35 20
            ],
36
            '02' => [
37 20
                'PEN' => 'S/',
38 20
                'USD' => '$',
39 20
                'EUR' => '€',
40 20
            ],
41
            '021' => [
42 20
                'PEN' => 'SOLES',
43 20
                'USD' => 'DÓLARES AMERICANOS',
44 20
                'EUR' => 'EUROS',
45 20
            ],
46
            '06' => [
47 20
                '0' => 'N/D',
48 20
                '1' => 'DNI',
49 20
                '6' => 'RUC',
50 20
            ],
51
        ];
52 20
    }
53
54 20
    public function getValueCatalog($value, $code)
55
    {
56 20
        if (!isset($this->store[$code])) {
57 4
            return '';
58
        }
59
60 16
        $items = $this->store[$code];
61
62 16
        return isset($items[$value]) ? $items[$value] : '';
63
    }
64
}
65