ItalianYearlyFilingExportHandler
extends AbstractExportHandler
in package
implements
ItalianYearlyFilingExportHeaders
uses
ItalianYearlyFilingExportCalculatorTrait
Table of Contents
Interfaces
Constants
- ACTIVE_HANDLERS = [\Vatjar\Export\Component\TransactionVolumeExportHandler::class, \Vatjar\Export\Component\VatReportSummaryExportHandler::class, \Vatjar\Export\Component\MovementMissingCountryExportHandler::class, \Vatjar\Export\Component\StorageDetectionExportHandler::class, \Vatjar\Export\Component\TransactionToGbAfterBrexitExportHandler::class, \Vatjar\Export\Component\GermanYearlyFilingExportHandler::class, \Vatjar\Export\Component\ArrangedUserExportHandler::class, \Vatjar\Export\Component\YearlyTransactionCountExportHandler::class, \Vatjar\Export\Component\ItalianYearlyFilingExportHandler::class]
- COLOR_BLUE = 'C8DAF9'
- COLOR_GREEN = "92C47C"
- COLOR_RED = "FF0000"
- COLOR_YELLOW = 'FFE599'
- EMPTY_STRING = ""
Properties
- $fileComponent : mixed
- $client : Client|null
- $clientCreditRepository : ClientCreditRepository
- $clientRepository : ClientRepository
- $difference : mixed
- $entryReportRepository : EntryReportRepository
- $entryReportsForPeriod : array<string|int, EntryReport>
- $entryReportsSummaries : array<string|int, mixed>|null
- $fields : mixed
- $governmentCreditsForPeriod : array<string|int, ClientCredit>
- $itUserVat : UserVat
- $preliminary : mixed
- $preliminaryReportsForPeriod : array<string|int, Report>
- $preliminaryReportsSummaries : array<string|int, mixed>
- $reportIntentionRepository : ReportIntentionRepository
- $reportObligationRepository : ReportObligationRepository
- $reportRepository : ReportRepository
- $totalFiled : mixed
- $userReportObligations : array<string|int, ReportObligation>
- $userVatRepository : UserVatRepository
- $versioned : mixed
Methods
- __construct() : mixed
- calculateAll() : mixed
- calculateAllDifferences() : mixed
- calculateDifferenceBetweenFields() : string
- createJob() : mixed
- customRound() : mixed
- filterParams() : array<string|int, mixed>
- filterSummaries() : array<string|int, mixed>
- getAllowedFilters() : array<string|int, mixed>
- getBucketName() : string
- getClient() : Client
- getExportTypes() : array<string|int, mixed>
- getFileComponent() : AbstractExportFile
- getHeaders() : array<string|int, mixed>
- getLastRowsNumber() : array<string|int, mixed>
- getLine() : mixed
- Get the value of line
- getLines() : Generator<string|int, array<string|int, string>>
- getType() : string
- handle() : mixed
- markAsInProgress() : mixed
- validateParams() : void
- validatePositiveInteger() : mixed
- cloudPath() : mixed
- createFile() : resource
- filename() : string|null
- generateFile() : void
- getCloudStorageComponent() : mixed
- localPath() : mixed
- markAsDone() : mixed
- registerShutdownFunction() : mixed
- remoteUri() : mixed
- removeFile() : mixed
- saveError() : mixed
- saveToCloud() : mixed
- validateBool() : bool
- validateDate() : bool
- validateRequired() : bool
- validateString() : bool
- calculateAllDifferencesBetweenTotalFiledAndTotalVJFields() : mixed
- calculateAllDifferencesBetweenVersionedAndPreliminaryFields() : mixed
- calculateAllLatestPreliminaryReportFields() : void
- calculateAllLatestVersionedReportFields() : void
- calculateDifferenceBetweenGrossValueAndNetValue() : mixed
- calculateNetValue() : mixed
- calculateVP14() : string
- calculateVP6() : string
- convertToNumber() : float
- getDifferenceBetweenLatestReportVersionSubmittedLineValuesAndLatestPreliminaryReportLineValues() : array<string|int, mixed>
- getEntryReportsForPeriod() : mixed
- getGovernmentCreditForPeriod() : array<string|int, mixed>
- getItReportObligations() : array<string|int, mixed>
- getItUserVat() : UserVat
- getLatestPreliminaryReportLineValues() : array<string|int, mixed>
- getLatestReportVersionSubmittedLineValues() : array<string|int, mixed>
- getLineDifferenceBetweenTotalFiledAndTotalVJ() : array<string|int, mixed>
- getLinesValues() : array<string|int, mixed>
- getLineTotalFiled() : array<string|int, mixed>
- getLineTotalVJ() : array<string|int, mixed>
- getPreliminaryReportsForPeriod() : array<string|int, mixed>|null
- getPreliminaryYearlyReport() : mixed
- getReportObligationPeriodMonthsDiff() : mixed
- getReportsSummaries() : array<string|int, mixed>
- getUserReportConfigurations() : array<string|int, mixed>
- Returns array combined of ReportIntention if exists, or an array of ReportObligation.
- getUserReportIntentions() : array<string|int, mixed>
- validateEntryReportsForUserReportConfiguration() : mixed
- validatePreliminaryReportsForUserReportConfiguration() : mixed
Constants
ACTIVE_HANDLERS
public
mixed
ACTIVE_HANDLERS
= [\Vatjar\Export\Component\TransactionVolumeExportHandler::class, \Vatjar\Export\Component\VatReportSummaryExportHandler::class, \Vatjar\Export\Component\MovementMissingCountryExportHandler::class, \Vatjar\Export\Component\StorageDetectionExportHandler::class, \Vatjar\Export\Component\TransactionToGbAfterBrexitExportHandler::class, \Vatjar\Export\Component\GermanYearlyFilingExportHandler::class, \Vatjar\Export\Component\ArrangedUserExportHandler::class, \Vatjar\Export\Component\YearlyTransactionCountExportHandler::class, \Vatjar\Export\Component\ItalianYearlyFilingExportHandler::class]
COLOR_BLUE
private
mixed
COLOR_BLUE
= 'C8DAF9'
COLOR_GREEN
private
mixed
COLOR_GREEN
= "92C47C"
COLOR_RED
private
mixed
COLOR_RED
= "FF0000"
COLOR_YELLOW
private
mixed
COLOR_YELLOW
= 'FFE599'
EMPTY_STRING
private
mixed
EMPTY_STRING
= ""
Properties
$fileComponent
protected
mixed
$fileComponent
$client
private
Client|null
$client
$clientCreditRepository
private
ClientCreditRepository
$clientCreditRepository
$clientRepository
private
ClientRepository
$clientRepository
$difference
private
mixed
$difference
= []
$entryReportRepository
private
EntryReportRepository
$entryReportRepository
$entryReportsForPeriod
private
array<string|int, EntryReport>
$entryReportsForPeriod
$entryReportsSummaries
private
array<string|int, mixed>|null
$entryReportsSummaries
$fields
private
mixed
$fields
= ['VP2' => ['vatTypes' => ['DOMV', 'DST', 'DSF', 'ECS', 'EXP', 'DOMREV', 'DEEM'], 'rates' => [], 'calculate' => 'calculateNetValue', 'roundValue' => false, 'roundEveryItem' => false], 'VP3' => ['vatTypes' => ['ECA', 'PUR', 'IMP'], 'rates' => [], 'calculate' => 'calculateNetValue', 'roundValue' => false, 'roundEveryItem' => false], 'VP4' => ['vatTypes' => ['DOMV', 'DST', 'DSF', 'ECS', 'ECA', 'DOMREV'], 'rates' => [4, 10, 22], 'calculate' => 'calculateDifferenceBetweenGrossValueAndNetValue', 'roundValue' => false, 'roundEveryItem' => false], 'VP5' => ['vatTypes' => ['ECA', 'PUR', 'IMP'], 'rates' => [], 'calculate' => 'calculateDifferenceBetweenGrossValueAndNetValue', 'roundValue' => false, 'roundEveryItem' => false], 'VP6' => ['vatTypes' => [], 'rates' => [], 'calculate' => 'calculateVP6', 'roundValue' => false, 'roundEveryItem' => false], 'VP14' => ['vatTypes' => [], 'rates' => [], 'calculate' => 'calculateVP14', 'roundValue' => false, 'roundEveryItem' => false]]
$governmentCreditsForPeriod
private
array<string|int, ClientCredit>
$governmentCreditsForPeriod
$itUserVat
private
UserVat
$itUserVat
$preliminary
private
mixed
$preliminary
= []
$preliminaryReportsForPeriod
private
array<string|int, Report>
$preliminaryReportsForPeriod
$preliminaryReportsSummaries
private
array<string|int, mixed>
$preliminaryReportsSummaries
$reportIntentionRepository
private
ReportIntentionRepository
$reportIntentionRepository
$reportObligationRepository
private
ReportObligationRepository
$reportObligationRepository
$reportRepository
private
ReportRepository
$reportRepository
$totalFiled
private
mixed
$totalFiled
= []
$userReportObligations
private
array<string|int, ReportObligation>
$userReportObligations
$userVatRepository
private
UserVatRepository
$userVatRepository
$versioned
private
mixed
$versioned
= []
Methods
__construct()
public
__construct(UserVatRepository $userVatRepository, ClientRepository $clientRepository, ReportObligationRepository $reportObligationRepository, ReportIntentionRepository $reportIntentionRepository, ReportRepository $reportRepository, EntryReportRepository $entryReportRepository, ClientCreditRepository $clientCreditRepository) : mixed
Parameters
- $userVatRepository : UserVatRepository
- $clientRepository : ClientRepository
- $reportObligationRepository : ReportObligationRepository
- $reportIntentionRepository : ReportIntentionRepository
- $reportRepository : ReportRepository
- $entryReportRepository : EntryReportRepository
- $clientCreditRepository : ClientCreditRepository
calculateAll()
public
calculateAll(mixed &$property, mixed $summary[, mixed $calculateTotal = false ]) : mixed
Parameters
- $property : mixed
- $summary : mixed
- $calculateTotal : mixed = false
calculateAllDifferences()
public
calculateAllDifferences(mixed &$property, mixed $differenceLeftPart, mixed $differenceRightPart) : mixed
Parameters
- $property : mixed
- $differenceLeftPart : mixed
- $differenceRightPart : mixed
calculateDifferenceBetweenFields()
public
calculateDifferenceBetweenFields(mixed $field1, mixed $field2) : string
Parameters
- $field1 : mixed
- $field2 : mixed
Return values
stringcreateJob()
public
final static createJob(Export $export) : mixed
Parameters
- $export : Export
Tags
customRound()
public
customRound(mixed $value) : mixed
Parameters
- $value : mixed
filterParams()
public
static filterParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>filterSummaries()
public
filterSummaries(mixed $array, mixed $vatTypes, mixed $vatRates) : array<string|int, mixed>
Parameters
- $array : mixed
- $vatTypes : mixed
- $vatRates : mixed
Return values
array<string|int, mixed>getAllowedFilters()
public
getAllowedFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>getBucketName()
public
getBucketName() : string
Return values
stringgetClient()
public
getClient(mixed $clientId, mixed $vatNumber, mixed $taxId) : Client
Parameters
- $clientId : mixed
- $vatNumber : mixed
- $taxId : mixed
Tags
Return values
ClientgetExportTypes()
public
static getExportTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>getFileComponent()
public
getFileComponent() : AbstractExportFile
Return values
AbstractExportFilegetHeaders()
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getLastRowsNumber()
public
getLastRowsNumber() : array<string|int, mixed>
Return values
array<string|int, mixed>getLine()
Get the value of line
public
getLine() : mixed
getLines()
public
getLines(array<string|int, mixed> $parameters) : Generator<string|int, array<string|int, string>>
Parameters
- $parameters : array<string|int, mixed>
Tags
Return values
Generator<string|int, array<string|int, string>>getType()
public
static getType() : string
Return values
stringhandle()
public
final handle(Export &$export) : mixed
Parameters
- $export : Export
Tags
markAsInProgress()
public
markAsInProgress(Export &$export) : mixed
Parameters
- $export : Export
validateParams()
public
static validateParams(array<string|int, mixed> $params) : void
Parameters
- $params : array<string|int, mixed>
Tags
validatePositiveInteger()
public
static validatePositiveInteger(mixed $value) : mixed
Parameters
- $value : mixed
cloudPath()
protected
cloudPath(Export $export) : mixed
Parameters
- $export : Export
createFile()
protected
createFile() : resource
Tags
Return values
resourcefilename()
protected
filename(Export $export) : string|null
Parameters
- $export : Export
Return values
string|nullgenerateFile()
protected
generateFile(resource $file, array<string|int, mixed> $parameters) : void
Parameters
- $file : resource
- $parameters : array<string|int, mixed>
Tags
getCloudStorageComponent()
protected
getCloudStorageComponent(string $bucket) : mixed
Parameters
- $bucket : string
localPath()
protected
localPath(resource $file) : mixed
Parameters
- $file : resource
markAsDone()
protected
markAsDone(resource $file, Export &$export) : mixed
Parameters
- $file : resource
- $export : Export
registerShutdownFunction()
protected
registerShutdownFunction(Export &$export, mixed &$file) : mixed
Parameters
- $export : Export
- $file : mixed
remoteUri()
protected
remoteUri(Export $export) : mixed
Parameters
- $export : Export
removeFile()
protected
removeFile(resource $file) : mixed
Parameters
- $file : resource
saveError()
protected
saveError(Export $export, Throwable $e) : mixed
Parameters
- $export : Export
- $e : Throwable
saveToCloud()
protected
saveToCloud(resource $file, Export $export) : mixed
Parameters
- $file : resource
- $export : Export
validateBool()
protected
static validateBool(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateDate()
protected
static validateDate(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateRequired()
protected
static validateRequired(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateString()
protected
static validateString(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolcalculateAllDifferencesBetweenTotalFiledAndTotalVJFields()
private
calculateAllDifferencesBetweenTotalFiledAndTotalVJFields() : mixed
calculateAllDifferencesBetweenVersionedAndPreliminaryFields()
private
calculateAllDifferencesBetweenVersionedAndPreliminaryFields() : mixed
calculateAllLatestPreliminaryReportFields()
private
calculateAllLatestPreliminaryReportFields() : void
calculateAllLatestVersionedReportFields()
private
calculateAllLatestVersionedReportFields() : void
calculateDifferenceBetweenGrossValueAndNetValue()
private
calculateDifferenceBetweenGrossValueAndNetValue(array<string|int, mixed> $summaries[, mixed $roundValue = false ][, mixed $roundEveryItem = true ]) : mixed
Parameters
- $summaries : array<string|int, mixed>
- $roundValue : mixed = false
- $roundEveryItem : mixed = true
calculateNetValue()
private
calculateNetValue(array<string|int, mixed> $summaries[, mixed $roundValue = false ][, mixed $roundEveryItem = true ]) : mixed
Parameters
- $summaries : array<string|int, mixed>
- $roundValue : mixed = false
- $roundEveryItem : mixed = true
calculateVP14()
private
calculateVP14(array<string|int, mixed> $summaries[, mixed $roundValue = false ][, mixed $roundEveryItem = true ][, mixed $summaryType = null ]) : string
Parameters
- $summaries : array<string|int, mixed>
- $roundValue : mixed = false
- $roundEveryItem : mixed = true
- $summaryType : mixed = null
Return values
stringcalculateVP6()
private
calculateVP6(array<string|int, mixed> $summaries[, mixed $roundValue = false ][, mixed $roundEveryItem = true ][, mixed $summaryType = null ]) : string
Parameters
- $summaries : array<string|int, mixed>
- $roundValue : mixed = false
- $roundEveryItem : mixed = true
- $summaryType : mixed = null
Return values
stringconvertToNumber()
private
convertToNumber(mixed $stringNumber) : float
Parameters
- $stringNumber : mixed
Return values
floatgetDifferenceBetweenLatestReportVersionSubmittedLineValuesAndLatestPreliminaryReportLineValues()
private
getDifferenceBetweenLatestReportVersionSubmittedLineValuesAndLatestPreliminaryReportLineValues(DateTime $date) : array<string|int, mixed>
Parameters
- $date : DateTime
Return values
array<string|int, mixed>getEntryReportsForPeriod()
private
getEntryReportsForPeriod(DateTime $date, array<string|int, mixed> $includedPeriods) : mixed
Parameters
- $date : DateTime
- $includedPeriods : array<string|int, mixed>
getGovernmentCreditForPeriod()
private
getGovernmentCreditForPeriod(DateTime $date) : array<string|int, mixed>
Parameters
- $date : DateTime
Return values
array<string|int, mixed>getItReportObligations()
private
getItReportObligations() : array<string|int, mixed>
Return values
array<string|int, mixed>getItUserVat()
private
getItUserVat(Client $client) : UserVat
Parameters
- $client : Client
Tags
Return values
UserVatgetLatestPreliminaryReportLineValues()
private
getLatestPreliminaryReportLineValues(DateTime $date) : array<string|int, mixed>
Parameters
- $date : DateTime
Return values
array<string|int, mixed>getLatestReportVersionSubmittedLineValues()
private
getLatestReportVersionSubmittedLineValues(DateTime $date) : array<string|int, mixed>
Parameters
- $date : DateTime
Return values
array<string|int, mixed>getLineDifferenceBetweenTotalFiledAndTotalVJ()
private
getLineDifferenceBetweenTotalFiledAndTotalVJ(DateTime $date) : array<string|int, mixed>
Parameters
- $date : DateTime
Return values
array<string|int, mixed>getLinesValues()
private
getLinesValues(DateTime $date, int $monthRow) : array<string|int, mixed>
Parameters
- $date : DateTime
- $monthRow : int
Return values
array<string|int, mixed>getLineTotalFiled()
private
getLineTotalFiled(DateTime $date) : array<string|int, mixed>
Parameters
- $date : DateTime
Return values
array<string|int, mixed>getLineTotalVJ()
private
getLineTotalVJ(DateTime $date) : array<string|int, mixed>
Parameters
- $date : DateTime
Return values
array<string|int, mixed>getPreliminaryReportsForPeriod()
private
getPreliminaryReportsForPeriod() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetPreliminaryYearlyReport()
private
getPreliminaryYearlyReport(DateTime $date) : mixed
Parameters
- $date : DateTime
getReportObligationPeriodMonthsDiff()
private
getReportObligationPeriodMonthsDiff(DatePeriod $reportObligationPeriod) : mixed
Parameters
- $reportObligationPeriod : DatePeriod
getReportsSummaries()
private
getReportsSummaries(mixed $reportsForPeriod) : array<string|int, mixed>
Parameters
- $reportsForPeriod : mixed
Return values
array<string|int, mixed>getUserReportConfigurations()
Returns array combined of ReportIntention if exists, or an array of ReportObligation.
private
getUserReportConfigurations(DateTime $startDate, DateTime $endDate) : array<string|int, mixed>
Parameters
- $startDate : DateTime
- $endDate : DateTime
Return values
array<string|int, mixed>getUserReportIntentions()
private
getUserReportIntentions(Client $client, mixed $startDate, mixed $endDate, ReportObligation $deVatReportObligation) : array<string|int, mixed>
Parameters
- $client : Client
- $startDate : mixed
- $endDate : mixed
- $deVatReportObligation : ReportObligation
Return values
array<string|int, mixed>validateEntryReportsForUserReportConfiguration()
private
validateEntryReportsForUserReportConfiguration(mixed $userReportConfiguration, mixed $entryReportsForSelectedYearAndReportObligation, mixed $reportObligationPeriodMonthsDiff) : mixed
Parameters
- $userReportConfiguration : mixed
- $entryReportsForSelectedYearAndReportObligation : mixed
- $reportObligationPeriodMonthsDiff : mixed
Tags
validatePreliminaryReportsForUserReportConfiguration()
private
validatePreliminaryReportsForUserReportConfiguration(mixed $userReportConfiguration, mixed $preliminaryReportsForSelectedYearAndReportObligation, mixed $reportObligationPeriodMonthsDiff) : mixed
Parameters
- $userReportConfiguration : mixed
- $preliminaryReportsForSelectedYearAndReportObligation : mixed
- $reportObligationPeriodMonthsDiff : mixed