convenia / dominio-payslip-import
Installs: 17 287
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 1
Open Issues: 2
Requires
- php: >=7.0
- tightenco/collect: ^5.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^1.11
- mockery/mockery: ^0.9.4
- phpunit/phpunit: ^4.0|^5.0
This package is auto-updated.
Last update: 2024-11-14 17:08:40 UTC
README
Requisitos
- PHP >= 7.0
Instale usando o composer Composer
composer require convenia/dominio-payslip-import
Uso
<?php use Convenia\Dominio\Payslip\Payslip; $filePath = 'PATH/TO/TXT/FILE'; $payslip = new Payslip; $payslip->importFromFile($filePath); $events = $payslip->getEvents(); // Exemplo de retorno Array ( [0] => Array ( [company_code] => 412 [employee_code] => 50 [employee_name] => GANDALF THE GREY [company_name] => THE LORD OF THE RINGS [company_reg] => 22924567000158 [role] => LEADER OF THE FELLOWSHIP [cost_center] => BR23 SALES QUALIFYING OUT [company_department] => 1,000000 [company_branch] => 1 [admission_date] => 24/08/2015 [rubrik_name] => DESCONTO PLANO DE SAÚDE [rubrik_code] => 8111 [reference] => 1,00 [event_value] => 1,00 [event_type] => D [salary] => 2616,75 [base_inss] => 2616,75 [base_irrf] => 2328,91 [base_fgts] => 2616,75 [month_fgts] => 209,340000 [level_irrf] => 7,50 ) )
Retornar todos os eventos de um único funcionário
Após importar um arquivo você poderá retornar todos os eventos encontrados no arquivo com o método getEvents() ou retornar apenas os eventos de um determinado funcionário com o método find()
<?php use Convenia\Dominio\Payslip\Payslip; $filePath = 'PATH/TO/TXT/FILE'; $payslip = new Payslip; $payslip->importFromFile($filePath); $events = $payslip->query()->find(13); // Exemplo de retorno Array ( [0] => Array ( [company_code] => 412 [employee_code] => 50 [employee_name] => GANDALF THE GREY [company_name] => THE LORD OF THE RINGS [company_reg] => 22924567000158 [role] => LEADER OF THE FELLOWSHIP [cost_center] => BR23 SALES QUALIFYING OUT [company_department] => 1,000000 [company_branch] => 1 [admission_date] => 24/08/2015 [rubrik_name] => DESCONTO PLANO DE SAÚDE [rubrik_code] => 8111 [reference] => 1,00 [event_value] => 1,00 [event_type] => D [salary] => 2616,75 [base_inss] => 2616,75 [base_irrf] => 2328,91 [base_fgts] => 2616,75 [month_fgts] => 209,340000 [level_irrf] => 7,50 ) [1] => Array ( [company_code] => 412 [employee_code] => 50 [employee_name] => THORIN [company_name] => THE LORD OF THE RINGS [company_reg] => 22924567000158 [role] => DWARF [cost_center] => BR23 SALES QUALIFYING OUT [company_department] => 1,000000 [company_branch] => 1 [admission_date] => 24/08/2015 [rubrik_name] => DESCONTO PLANO DE SAÚDE [rubrik_code] => 8111 [reference] => 1,00 [event_value] => 1,00 [event_type] => P [salary] => 2616,75 [base_inss] => 2616,75 [base_irrf] => 2328,91 [base_fgts] => 2616,75 [month_fgts] => 209,340000 [level_irrf] => 7,50 ) )