ReferenceNumberGeneratorUtil
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- generateReferenceNumberFromEntry() : string|null
- referenceLogicForCountryAT() : string|null
- referenceLogicForCountryCZ() : string|null
- Build the reference string for Czech (CZ) reports.
- referenceLogicForCountryDE() : string|null
- taxId constant string = UStVA MM-YYYY separated by spaces " "
- referenceLogicForCountryES() : string|null
- client's VAT number without "ES" N°Q clientId separated by hyphens "-"
- referenceLogicForCountryFR() : string|null
- const $formNumber = "3310" MM or '3'.Q YY siretNumber separated by slashes "/"
- referenceLogicForCountryGB() : string|null
- client's VAT number, without "UK"
- referenceLogicForCountryIE() : string|null
- referenceLogicForCountryIT() : string|null
- if (company) client's vatId (11 digits) elseif (soletrader) client's tax code (string 16 characters)
- referenceLogicForCountryNL() : string|null
- referenceLogicForCountryPL() : string|null
- client's VAT number without "PL" YY + (constant string = "M") + M if (monthly) const string = VAT-7 if (quarterly) const string = VAT-7K separated by spaces " "
- referenceLogicForCountrySE() : string|null
- referenceLogicForCountryUK() : string|null
- just for good measure
- getFilteredUserVatFromEntry() : UserVat|null
- helper for getting UserVat object filtered by country
- isOss() : bool
- True when the Payment type is OSS for generating the banking details.
- normalizeITVatId() : string
- resolveTraderTypeIdByEntryAndCountryId() : int|null
- resolveVat7() : string|null
- resolveVatId() : string|null
- Safely obtain the VAT number from the entry.
Properties
$userTraderCountrySettingService
private
UserTraderCountrySettingService
$userTraderCountrySettingService
Methods
__construct()
public
__construct(UserTraderCountrySettingService $userTraderCountrySettingService) : mixed
Parameters
- $userTraderCountrySettingService : UserTraderCountrySettingService
generateReferenceNumberFromEntry()
public
generateReferenceNumberFromEntry(Entry $entry, int $paymentProcedureTypeId) : string|null
Parameters
- $entry : Entry
- $paymentProcedureTypeId : int
Return values
string|nullreferenceLogicForCountryAT()
public
referenceLogicForCountryAT(Entry $entry) : string|null
Parameters
- $entry : Entry
Return values
string|nullreferenceLogicForCountryCZ()
Build the reference string for Czech (CZ) reports.
public
referenceLogicForCountryCZ(Entry $entry, int $paymentProcedureTypeId) : string|null
Parameters
- $entry : Entry
- $paymentProcedureTypeId : int
Return values
string|nullreferenceLogicForCountryDE()
taxId constant string = UStVA MM-YYYY separated by spaces " "
public
referenceLogicForCountryDE(Entry $entry, int $paymentProcedureTypeId) : string|null
Parameters
- $entry : Entry
- $paymentProcedureTypeId : int
Return values
string|nullreferenceLogicForCountryES()
client's VAT number without "ES" N°Q clientId separated by hyphens "-"
public
referenceLogicForCountryES(Entry $entry) : string|null
Parameters
- $entry : Entry
Return values
string|nullreferenceLogicForCountryFR()
const $formNumber = "3310" MM or '3'.Q YY siretNumber separated by slashes "/"
public
referenceLogicForCountryFR(Entry $entry, int $paymentProcedureTypeId) : string|null
Parameters
- $entry : Entry
- $paymentProcedureTypeId : int
Return values
string|nullreferenceLogicForCountryGB()
client's VAT number, without "UK"
public
referenceLogicForCountryGB(Entry $entry) : string|null
Parameters
- $entry : Entry
Return values
string|nullreferenceLogicForCountryIE()
public
referenceLogicForCountryIE(Entry $entry, int $paymentProcedureTypeId) : string|null
Parameters
- $entry : Entry
- $paymentProcedureTypeId : int
Return values
string|nullreferenceLogicForCountryIT()
if (company) client's vatId (11 digits) elseif (soletrader) client's tax code (string 16 characters)
public
referenceLogicForCountryIT(Entry $entry, int $paymentProcedureTypeId) : string|null
if (regular payment) (constant string = 60) + MM elseif (prepayment of DEC vat) (constant string = 6013) elseif (final vat return) (constant string = 6012)
year
separated by dots
Parameters
- $entry : Entry
- $paymentProcedureTypeId : int
Return values
string|nullreferenceLogicForCountryNL()
public
referenceLogicForCountryNL(Entry $entry, int $paymentProcedureTypeId) : string|null
Parameters
- $entry : Entry
- $paymentProcedureTypeId : int
Return values
string|nullreferenceLogicForCountryPL()
client's VAT number without "PL" YY + (constant string = "M") + M if (monthly) const string = VAT-7 if (quarterly) const string = VAT-7K separated by spaces " "
public
referenceLogicForCountryPL(Entry $entry, int $paymentProcedureTypeId) : string|null
Parameters
- $entry : Entry
- $paymentProcedureTypeId : int
Return values
string|nullreferenceLogicForCountrySE()
public
referenceLogicForCountrySE(Entry $entry) : string|null
Parameters
- $entry : Entry
Return values
string|nullreferenceLogicForCountryUK()
just for good measure
public
referenceLogicForCountryUK(Entry $entry) : string|null
Parameters
- $entry : Entry
Return values
string|nullgetFilteredUserVatFromEntry()
helper for getting UserVat object filtered by country
private
getFilteredUserVatFromEntry(Entry $entry) : UserVat|null
Parameters
- $entry : Entry
Return values
UserVat|null —$userVat
isOss()
True when the Payment type is OSS for generating the banking details.
private
isOss(int $paymentProcedureTypeId) : bool
Parameters
- $paymentProcedureTypeId : int
Return values
boolnormalizeITVatId()
private
normalizeITVatId(string $vatId) : string
Parameters
- $vatId : string
Return values
stringresolveTraderTypeIdByEntryAndCountryId()
private
resolveTraderTypeIdByEntryAndCountryId(Entry $entry, int $countryId) : int|null
Parameters
- $entry : Entry
- $countryId : int
Return values
int|nullresolveVat7()
private
resolveVat7(int|null $periodId) : string|null
Parameters
- $periodId : int|null
Return values
string|nullresolveVatId()
Safely obtain the VAT number from the entry.
private
resolveVatId(Entry $entry) : string|null
Parameters
- $entry : Entry