GET | /eaccounting/invoices |
---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class EAccountingPagination implements JsonSerializable
{
public function __construct(
/** @description Page number that will be fetched to e-accounting client; Default 1 */
// @DataMember(Order=1)
// @ApiMember(Description="Page number that will be fetched to e-accounting client; Default 1")
/** @var int|null */
public ?int $PageNumber=null,
/** @description Page size that will be fetched to e-accounting client; Default 75~ */
// @DataMember(Order=2)
// @ApiMember(Description="Page size that will be fetched to e-accounting client; Default 75~")
/** @var int|null */
public ?int $PageSize=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['PageNumber'])) $this->PageNumber = $o['PageNumber'];
if (isset($o['PageSize'])) $this->PageSize = $o['PageSize'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->PageNumber)) $o['PageNumber'] = $this->PageNumber;
if (isset($this->PageSize)) $o['PageSize'] = $this->PageSize;
return empty($o) ? new class(){} : $o;
}
}
enum GreenTechnologyType : string
{
case None = 'None';
case SolarCellInstallation = 'SolarCellInstallation';
case ElectricEnergyStorageInstallation = 'ElectricEnergyStorageInstallation';
case ElectricVehicleChargingPointInstallation = 'ElectricVehicleChargingPointInstallation';
}
class ContributionMargin implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $Amount=null,
/** @var int|null */
public ?int $Percentage=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Amount'])) $this->Amount = $o['Amount'];
if (isset($o['Percentage'])) $this->Percentage = $o['Percentage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Amount)) $o['Amount'] = $this->Amount;
if (isset($this->Percentage)) $o['Percentage'] = $this->Percentage;
return empty($o) ? new class(){} : $o;
}
}
class InvoiceLineQueryResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ArticleNumber=null,
/** @var string|null */
public ?string $ArticleId=null,
/** @var bool|null */
public ?bool $IsServiceArticle=null,
/** @var float */
public float $AmountNoVat=0.0,
/** @var float|null */
public ?float $PercentVat=null,
/** @var int */
public int $LineNumber=0,
/** @var bool|null */
public ?bool $IsTextRow=null,
/** @var string|null */
public ?string $Text=null,
/** @var float */
public float $UnitPrice=0.0,
/** @var string|null */
public ?string $UnitAbbreviation=null,
/** @var string|null */
public ?string $UnitAbbreviationEnglish=null,
/** @var float */
public float $DiscountPercentage=0.0,
/** @var float */
public float $Quantity=0.0,
/** @var bool|null */
public ?bool $IsWorkCost=null,
/** @var bool|null */
public ?bool $IsVatFree=null,
/** @var string|null */
public ?string $CostCenterItemId1=null,
/** @var string|null */
public ?string $CostCenterItemId2=null,
/** @var string|null */
public ?string $CostCenterItemId3=null,
/** @var string|null */
public ?string $UnitId=null,
/** @var string|null */
public ?string $ProjectId=null,
/** @var int|null */
public ?int $WorkCostType=null,
/** @var float|null */
public ?float $WorkHours=null,
/** @var float|null */
public ?float $MaterialCosts=null,
/** @var GreenTechnologyType|null */
public ?GreenTechnologyType $GreenTechnologyType=null,
/** @var ContributionMargin|null */
public ?ContributionMargin $ContributionMargin=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ArticleNumber'])) $this->ArticleNumber = $o['ArticleNumber'];
if (isset($o['ArticleId'])) $this->ArticleId = $o['ArticleId'];
if (isset($o['IsServiceArticle'])) $this->IsServiceArticle = $o['IsServiceArticle'];
if (isset($o['AmountNoVat'])) $this->AmountNoVat = $o['AmountNoVat'];
if (isset($o['PercentVat'])) $this->PercentVat = $o['PercentVat'];
if (isset($o['LineNumber'])) $this->LineNumber = $o['LineNumber'];
if (isset($o['IsTextRow'])) $this->IsTextRow = $o['IsTextRow'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['UnitPrice'])) $this->UnitPrice = $o['UnitPrice'];
if (isset($o['UnitAbbreviation'])) $this->UnitAbbreviation = $o['UnitAbbreviation'];
if (isset($o['UnitAbbreviationEnglish'])) $this->UnitAbbreviationEnglish = $o['UnitAbbreviationEnglish'];
if (isset($o['DiscountPercentage'])) $this->DiscountPercentage = $o['DiscountPercentage'];
if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
if (isset($o['IsWorkCost'])) $this->IsWorkCost = $o['IsWorkCost'];
if (isset($o['IsVatFree'])) $this->IsVatFree = $o['IsVatFree'];
if (isset($o['CostCenterItemId1'])) $this->CostCenterItemId1 = $o['CostCenterItemId1'];
if (isset($o['CostCenterItemId2'])) $this->CostCenterItemId2 = $o['CostCenterItemId2'];
if (isset($o['CostCenterItemId3'])) $this->CostCenterItemId3 = $o['CostCenterItemId3'];
if (isset($o['UnitId'])) $this->UnitId = $o['UnitId'];
if (isset($o['ProjectId'])) $this->ProjectId = $o['ProjectId'];
if (isset($o['WorkCostType'])) $this->WorkCostType = $o['WorkCostType'];
if (isset($o['WorkHours'])) $this->WorkHours = $o['WorkHours'];
if (isset($o['MaterialCosts'])) $this->MaterialCosts = $o['MaterialCosts'];
if (isset($o['GreenTechnologyType'])) $this->GreenTechnologyType = JsonConverters::from('GreenTechnologyType', $o['GreenTechnologyType']);
if (isset($o['ContributionMargin'])) $this->ContributionMargin = JsonConverters::from('ContributionMargin', $o['ContributionMargin']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ArticleNumber)) $o['ArticleNumber'] = $this->ArticleNumber;
if (isset($this->ArticleId)) $o['ArticleId'] = $this->ArticleId;
if (isset($this->IsServiceArticle)) $o['IsServiceArticle'] = $this->IsServiceArticle;
if (isset($this->AmountNoVat)) $o['AmountNoVat'] = $this->AmountNoVat;
if (isset($this->PercentVat)) $o['PercentVat'] = $this->PercentVat;
if (isset($this->LineNumber)) $o['LineNumber'] = $this->LineNumber;
if (isset($this->IsTextRow)) $o['IsTextRow'] = $this->IsTextRow;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->UnitPrice)) $o['UnitPrice'] = $this->UnitPrice;
if (isset($this->UnitAbbreviation)) $o['UnitAbbreviation'] = $this->UnitAbbreviation;
if (isset($this->UnitAbbreviationEnglish)) $o['UnitAbbreviationEnglish'] = $this->UnitAbbreviationEnglish;
if (isset($this->DiscountPercentage)) $o['DiscountPercentage'] = $this->DiscountPercentage;
if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
if (isset($this->IsWorkCost)) $o['IsWorkCost'] = $this->IsWorkCost;
if (isset($this->IsVatFree)) $o['IsVatFree'] = $this->IsVatFree;
if (isset($this->CostCenterItemId1)) $o['CostCenterItemId1'] = $this->CostCenterItemId1;
if (isset($this->CostCenterItemId2)) $o['CostCenterItemId2'] = $this->CostCenterItemId2;
if (isset($this->CostCenterItemId3)) $o['CostCenterItemId3'] = $this->CostCenterItemId3;
if (isset($this->UnitId)) $o['UnitId'] = $this->UnitId;
if (isset($this->ProjectId)) $o['ProjectId'] = $this->ProjectId;
if (isset($this->WorkCostType)) $o['WorkCostType'] = $this->WorkCostType;
if (isset($this->WorkHours)) $o['WorkHours'] = $this->WorkHours;
if (isset($this->MaterialCosts)) $o['MaterialCosts'] = $this->MaterialCosts;
if (isset($this->GreenTechnologyType)) $o['GreenTechnologyType'] = JsonConverters::to('GreenTechnologyType', $this->GreenTechnologyType);
if (isset($this->ContributionMargin)) $o['ContributionMargin'] = JsonConverters::to('ContributionMargin', $this->ContributionMargin);
return empty($o) ? new class(){} : $o;
}
}
class VatSpecificationQueryResponse implements JsonSerializable
{
public function __construct(
/** @var float */
public float $AmountInvoiceCurrency=0.0,
/** @var float */
public float $VatAmountInvoiceCurrency=0.0,
/** @var float */
public float $VatPercent=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AmountInvoiceCurrency'])) $this->AmountInvoiceCurrency = $o['AmountInvoiceCurrency'];
if (isset($o['VatAmountInvoiceCurrency'])) $this->VatAmountInvoiceCurrency = $o['VatAmountInvoiceCurrency'];
if (isset($o['VatPercent'])) $this->VatPercent = $o['VatPercent'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AmountInvoiceCurrency)) $o['AmountInvoiceCurrency'] = $this->AmountInvoiceCurrency;
if (isset($this->VatAmountInvoiceCurrency)) $o['VatAmountInvoiceCurrency'] = $this->VatAmountInvoiceCurrency;
if (isset($this->VatPercent)) $o['VatPercent'] = $this->VatPercent;
return empty($o) ? new class(){} : $o;
}
}
class Person implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Ssn=null,
/** @var int */
public int $Amount=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Ssn'])) $this->Ssn = $o['Ssn'];
if (isset($o['Amount'])) $this->Amount = $o['Amount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Ssn)) $o['Ssn'] = $this->Ssn;
if (isset($this->Amount)) $o['Amount'] = $this->Amount;
return empty($o) ? new class(){} : $o;
}
}
class InvoiceAddress implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $CorporateIdentityNumber=null,
/** @var string|null */
public ?string $InvoiceAddress1=null,
/** @var string|null */
public ?string $InvoiceAddress2=null,
/** @var string|null */
public ?string $InvoiceCity=null,
/** @var string|null */
public ?string $InvoicePostalCode=null,
/** @var string|null */
public ?string $InvoiceCountryCode=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CorporateIdentityNumber'])) $this->CorporateIdentityNumber = $o['CorporateIdentityNumber'];
if (isset($o['InvoiceAddress1'])) $this->InvoiceAddress1 = $o['InvoiceAddress1'];
if (isset($o['InvoiceAddress2'])) $this->InvoiceAddress2 = $o['InvoiceAddress2'];
if (isset($o['InvoiceCity'])) $this->InvoiceCity = $o['InvoiceCity'];
if (isset($o['InvoicePostalCode'])) $this->InvoicePostalCode = $o['InvoicePostalCode'];
if (isset($o['InvoiceCountryCode'])) $this->InvoiceCountryCode = $o['InvoiceCountryCode'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CorporateIdentityNumber)) $o['CorporateIdentityNumber'] = $this->CorporateIdentityNumber;
if (isset($this->InvoiceAddress1)) $o['InvoiceAddress1'] = $this->InvoiceAddress1;
if (isset($this->InvoiceAddress2)) $o['InvoiceAddress2'] = $this->InvoiceAddress2;
if (isset($this->InvoiceCity)) $o['InvoiceCity'] = $this->InvoiceCity;
if (isset($this->InvoicePostalCode)) $o['InvoicePostalCode'] = $this->InvoicePostalCode;
if (isset($this->InvoiceCountryCode)) $o['InvoiceCountryCode'] = $this->InvoiceCountryCode;
return empty($o) ? new class(){} : $o;
}
}
class EAccountingTermsOfPaymentQueryResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $NameEnglish=null,
/** @var int */
public int $NumberOfDays=0,
/** @var int */
public int $TermsOfPaymentTypeId=0,
/** @var string|null */
public ?string $TermsOfPaymentTypeText=null,
/** @var bool|null */
public ?bool $AvailableForSales=null,
/** @var bool|null */
public ?bool $AvailableForPurchase=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['NameEnglish'])) $this->NameEnglish = $o['NameEnglish'];
if (isset($o['NumberOfDays'])) $this->NumberOfDays = $o['NumberOfDays'];
if (isset($o['TermsOfPaymentTypeId'])) $this->TermsOfPaymentTypeId = $o['TermsOfPaymentTypeId'];
if (isset($o['TermsOfPaymentTypeText'])) $this->TermsOfPaymentTypeText = $o['TermsOfPaymentTypeText'];
if (isset($o['AvailableForSales'])) $this->AvailableForSales = $o['AvailableForSales'];
if (isset($o['AvailableForPurchase'])) $this->AvailableForPurchase = $o['AvailableForPurchase'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->NameEnglish)) $o['NameEnglish'] = $this->NameEnglish;
if (isset($this->NumberOfDays)) $o['NumberOfDays'] = $this->NumberOfDays;
if (isset($this->TermsOfPaymentTypeId)) $o['TermsOfPaymentTypeId'] = $this->TermsOfPaymentTypeId;
if (isset($this->TermsOfPaymentTypeText)) $o['TermsOfPaymentTypeText'] = $this->TermsOfPaymentTypeText;
if (isset($this->AvailableForSales)) $o['AvailableForSales'] = $this->AvailableForSales;
if (isset($this->AvailableForPurchase)) $o['AvailableForPurchase'] = $this->AvailableForPurchase;
return empty($o) ? new class(){} : $o;
}
}
class NoteQueryResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Text=null,
/** @var DateTime */
public DateTime $CreatedUtc=new DateTime(),
/** @var DateTime */
public DateTime $ModifiedUtc=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['CreatedUtc'])) $this->CreatedUtc = JsonConverters::from('DateTime', $o['CreatedUtc']);
if (isset($o['ModifiedUtc'])) $this->ModifiedUtc = JsonConverters::from('DateTime', $o['ModifiedUtc']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->CreatedUtc)) $o['CreatedUtc'] = JsonConverters::to('DateTime', $this->CreatedUtc);
if (isset($this->ModifiedUtc)) $o['ModifiedUtc'] = JsonConverters::to('DateTime', $this->ModifiedUtc);
return empty($o) ? new class(){} : $o;
}
}
enum EAccountingInvoiceSendTypes : string
{
case None = 'None';
case AutoInvoiceElectronic = 'AutoInvoiceElectronic';
case AutoInvoicePrint = 'AutoInvoicePrint';
case AutoInvoiceB2C = 'AutoInvoiceB2C';
}
enum PaymentStatus : string
{
case Paid = 'Paid';
case Unpaid = 'Unpaid';
case Overdue = 'Overdue';
}
class CreditedBy implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $CreditInvoiceId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CreditInvoiceId'])) $this->CreditInvoiceId = $o['CreditInvoiceId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CreditInvoiceId)) $o['CreditInvoiceId'] = $this->CreditInvoiceId;
return empty($o) ? new class(){} : $o;
}
}
class InvoiceQueryResponse implements JsonSerializable
{
public function __construct(
/** @var string */
public string $InvoiceId='',
/** @var DateTime */
public DateTime $CreatedDate=new DateTime(),
/** @var float */
public float $TotalAmount=0.0,
/** @var float */
public float $TotalVatAmount=0.0,
/** @var string|null */
public ?string $CustomerId=null,
/** @var array<InvoiceLineQueryResponse>|null */
public ?array $Rows=null,
/** @var array<VatSpecificationQueryResponse>|null */
public ?array $VatSpecification=null,
/** @var string|null */
public ?string $InvoiceDate=null,
/** @var string|null */
public ?string $DueDate=null,
/** @var DateTime|null */
public ?DateTime $DeliveryDate=null,
/** @var array<Person>|null */
public ?array $Persons=null,
/** @var string|null */
public ?string $InvoiceCustomerName=null,
/** @var InvoiceAddress|null */
public ?InvoiceAddress $InvoiceAddress=null,
/** @var bool|null */
public ?bool $CustomerIsPrivatePerson=null,
/** @var string|null */
public ?string $TermsOfPaymentId=null,
/** @var EAccountingTermsOfPaymentQueryResponse|null */
public ?EAccountingTermsOfPaymentQueryResponse $TermsOfPaymentData=null,
/** @var string|null */
public ?string $CustomerEmail=null,
/** @var int */
public int $InvoiceNumber=0,
/** @var string|null */
public ?string $CustomerNumber=null,
/** @var array<NoteQueryResponse>|null */
public ?array $Notes=null,
/** @var array<string>|null */
public ?array $NoteIds=null,
/** @var DateTime */
public DateTime $CreatedUtc=new DateTime(),
/** @var DateTime */
public DateTime $ModifiedUtc=new DateTime(),
/** @var bool|null */
public ?bool $IncludesVat=null,
/** @var EAccountingInvoiceSendTypes|null */
public ?EAccountingInvoiceSendTypes $SendType=null,
/** @var bool|null */
public ?bool $IsSold=null,
/** @var DateTime|null */
public ?DateTime $PaymentDate=null,
/** @var PaymentStatus|null */
public ?PaymentStatus $PaymentStatus=null,
/** @var string|null */
public ?string $PaymentStatusTitle=null,
/** @var array<CreditedBy>|null */
public ?array $CreditedBy=null,
/** @var string|null */
public ?string $PriceSign=null,
/** @var string|null */
public ?string $BookingId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['InvoiceId'])) $this->InvoiceId = $o['InvoiceId'];
if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
if (isset($o['TotalAmount'])) $this->TotalAmount = $o['TotalAmount'];
if (isset($o['TotalVatAmount'])) $this->TotalVatAmount = $o['TotalVatAmount'];
if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
if (isset($o['Rows'])) $this->Rows = JsonConverters::fromArray('InvoiceLineQueryResponse', $o['Rows']);
if (isset($o['VatSpecification'])) $this->VatSpecification = JsonConverters::fromArray('VatSpecificationQueryResponse', $o['VatSpecification']);
if (isset($o['InvoiceDate'])) $this->InvoiceDate = $o['InvoiceDate'];
if (isset($o['DueDate'])) $this->DueDate = $o['DueDate'];
if (isset($o['DeliveryDate'])) $this->DeliveryDate = JsonConverters::from('DateTime', $o['DeliveryDate']);
if (isset($o['Persons'])) $this->Persons = JsonConverters::fromArray('Person', $o['Persons']);
if (isset($o['InvoiceCustomerName'])) $this->InvoiceCustomerName = $o['InvoiceCustomerName'];
if (isset($o['InvoiceAddress'])) $this->InvoiceAddress = JsonConverters::from('InvoiceAddress', $o['InvoiceAddress']);
if (isset($o['CustomerIsPrivatePerson'])) $this->CustomerIsPrivatePerson = $o['CustomerIsPrivatePerson'];
if (isset($o['TermsOfPaymentId'])) $this->TermsOfPaymentId = $o['TermsOfPaymentId'];
if (isset($o['TermsOfPaymentData'])) $this->TermsOfPaymentData = JsonConverters::from('EAccountingTermsOfPaymentQueryResponse', $o['TermsOfPaymentData']);
if (isset($o['CustomerEmail'])) $this->CustomerEmail = $o['CustomerEmail'];
if (isset($o['InvoiceNumber'])) $this->InvoiceNumber = $o['InvoiceNumber'];
if (isset($o['CustomerNumber'])) $this->CustomerNumber = $o['CustomerNumber'];
if (isset($o['Notes'])) $this->Notes = JsonConverters::fromArray('NoteQueryResponse', $o['Notes']);
if (isset($o['NoteIds'])) $this->NoteIds = JsonConverters::fromArray('string', $o['NoteIds']);
if (isset($o['CreatedUtc'])) $this->CreatedUtc = JsonConverters::from('DateTime', $o['CreatedUtc']);
if (isset($o['ModifiedUtc'])) $this->ModifiedUtc = JsonConverters::from('DateTime', $o['ModifiedUtc']);
if (isset($o['IncludesVat'])) $this->IncludesVat = $o['IncludesVat'];
if (isset($o['SendType'])) $this->SendType = JsonConverters::from('EAccountingInvoiceSendTypes', $o['SendType']);
if (isset($o['IsSold'])) $this->IsSold = $o['IsSold'];
if (isset($o['PaymentDate'])) $this->PaymentDate = JsonConverters::from('DateTime', $o['PaymentDate']);
if (isset($o['PaymentStatus'])) $this->PaymentStatus = JsonConverters::from('PaymentStatus', $o['PaymentStatus']);
if (isset($o['PaymentStatusTitle'])) $this->PaymentStatusTitle = $o['PaymentStatusTitle'];
if (isset($o['CreditedBy'])) $this->CreditedBy = JsonConverters::fromArray('CreditedBy', $o['CreditedBy']);
if (isset($o['PriceSign'])) $this->PriceSign = $o['PriceSign'];
if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->InvoiceId)) $o['InvoiceId'] = $this->InvoiceId;
if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
if (isset($this->TotalAmount)) $o['TotalAmount'] = $this->TotalAmount;
if (isset($this->TotalVatAmount)) $o['TotalVatAmount'] = $this->TotalVatAmount;
if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
if (isset($this->Rows)) $o['Rows'] = JsonConverters::toArray('InvoiceLineQueryResponse', $this->Rows);
if (isset($this->VatSpecification)) $o['VatSpecification'] = JsonConverters::toArray('VatSpecificationQueryResponse', $this->VatSpecification);
if (isset($this->InvoiceDate)) $o['InvoiceDate'] = $this->InvoiceDate;
if (isset($this->DueDate)) $o['DueDate'] = $this->DueDate;
if (isset($this->DeliveryDate)) $o['DeliveryDate'] = JsonConverters::to('DateTime', $this->DeliveryDate);
if (isset($this->Persons)) $o['Persons'] = JsonConverters::toArray('Person', $this->Persons);
if (isset($this->InvoiceCustomerName)) $o['InvoiceCustomerName'] = $this->InvoiceCustomerName;
if (isset($this->InvoiceAddress)) $o['InvoiceAddress'] = JsonConverters::to('InvoiceAddress', $this->InvoiceAddress);
if (isset($this->CustomerIsPrivatePerson)) $o['CustomerIsPrivatePerson'] = $this->CustomerIsPrivatePerson;
if (isset($this->TermsOfPaymentId)) $o['TermsOfPaymentId'] = $this->TermsOfPaymentId;
if (isset($this->TermsOfPaymentData)) $o['TermsOfPaymentData'] = JsonConverters::to('EAccountingTermsOfPaymentQueryResponse', $this->TermsOfPaymentData);
if (isset($this->CustomerEmail)) $o['CustomerEmail'] = $this->CustomerEmail;
if (isset($this->InvoiceNumber)) $o['InvoiceNumber'] = $this->InvoiceNumber;
if (isset($this->CustomerNumber)) $o['CustomerNumber'] = $this->CustomerNumber;
if (isset($this->Notes)) $o['Notes'] = JsonConverters::toArray('NoteQueryResponse', $this->Notes);
if (isset($this->NoteIds)) $o['NoteIds'] = JsonConverters::toArray('string', $this->NoteIds);
if (isset($this->CreatedUtc)) $o['CreatedUtc'] = JsonConverters::to('DateTime', $this->CreatedUtc);
if (isset($this->ModifiedUtc)) $o['ModifiedUtc'] = JsonConverters::to('DateTime', $this->ModifiedUtc);
if (isset($this->IncludesVat)) $o['IncludesVat'] = $this->IncludesVat;
if (isset($this->SendType)) $o['SendType'] = JsonConverters::to('EAccountingInvoiceSendTypes', $this->SendType);
if (isset($this->IsSold)) $o['IsSold'] = $this->IsSold;
if (isset($this->PaymentDate)) $o['PaymentDate'] = JsonConverters::to('DateTime', $this->PaymentDate);
if (isset($this->PaymentStatus)) $o['PaymentStatus'] = JsonConverters::to('PaymentStatus', $this->PaymentStatus);
if (isset($this->PaymentStatusTitle)) $o['PaymentStatusTitle'] = $this->PaymentStatusTitle;
if (isset($this->CreditedBy)) $o['CreditedBy'] = JsonConverters::toArray('CreditedBy', $this->CreditedBy);
if (isset($this->PriceSign)) $o['PriceSign'] = $this->PriceSign;
if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
return empty($o) ? new class(){} : $o;
}
}
class EaccountingInvoiceQuery extends EAccountingPagination implements ICompany, JsonSerializable
{
/**
* @param int|null $PageNumber
* @param int|null $PageSize
*/
public function __construct(
?int $PageNumber=null,
?int $PageSize=null,
/** @var int|null */
public ?int $BookingId=null,
/** @var bool|null */
public ?bool $Paid=null,
/** @var bool|null */
public ?bool $IncludeInvoiceLines=null,
/** @var bool|null */
public ?bool $IncludeInvoiceNotes=null,
/** @var bool|null */
public ?bool $IncludePaymentTermData=null,
/** @var bool|null */
public ?bool $IncludeInvoiceAddress=null,
/** @var string|null */
public ?string $CompanyId=null
) {
parent::__construct($PageNumber,$PageSize);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
if (isset($o['Paid'])) $this->Paid = $o['Paid'];
if (isset($o['IncludeInvoiceLines'])) $this->IncludeInvoiceLines = $o['IncludeInvoiceLines'];
if (isset($o['IncludeInvoiceNotes'])) $this->IncludeInvoiceNotes = $o['IncludeInvoiceNotes'];
if (isset($o['IncludePaymentTermData'])) $this->IncludePaymentTermData = $o['IncludePaymentTermData'];
if (isset($o['IncludeInvoiceAddress'])) $this->IncludeInvoiceAddress = $o['IncludeInvoiceAddress'];
if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
if (isset($this->Paid)) $o['Paid'] = $this->Paid;
if (isset($this->IncludeInvoiceLines)) $o['IncludeInvoiceLines'] = $this->IncludeInvoiceLines;
if (isset($this->IncludeInvoiceNotes)) $o['IncludeInvoiceNotes'] = $this->IncludeInvoiceNotes;
if (isset($this->IncludePaymentTermData)) $o['IncludePaymentTermData'] = $this->IncludePaymentTermData;
if (isset($this->IncludeInvoiceAddress)) $o['IncludeInvoiceAddress'] = $this->IncludeInvoiceAddress;
if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
return empty($o) ? new class(){} : $o;
}
}
PHP EaccountingInvoiceQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /eaccounting/invoices HTTP/1.1 Host: api.bokamera.se Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <EAccountingDtos.InvoiceQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <BookingId>String</BookingId> <CreatedDate>0001-01-01T00:00:00</CreatedDate> <CreatedUtc>0001-01-01T00:00:00</CreatedUtc> <CreditedBy> <EAccountingClientDtos.CreditedBy> <CreditInvoiceId>String</CreditInvoiceId> </EAccountingClientDtos.CreditedBy> </CreditedBy> <CustomerEmail>String</CustomerEmail> <CustomerId>String</CustomerId> <CustomerIsPrivatePerson>false</CustomerIsPrivatePerson> <CustomerNumber>String</CustomerNumber> <DeliveryDate>0001-01-01T00:00:00</DeliveryDate> <DueDate>String</DueDate> <IncludesVat>false</IncludesVat> <InvoiceAddress> <CorporateIdentityNumber>String</CorporateIdentityNumber> <InvoiceAddress1>String</InvoiceAddress1> <InvoiceAddress2>String</InvoiceAddress2> <InvoiceCity>String</InvoiceCity> <InvoiceCountryCode>String</InvoiceCountryCode> <InvoicePostalCode>String</InvoicePostalCode> </InvoiceAddress> <InvoiceCustomerName>String</InvoiceCustomerName> <InvoiceDate>String</InvoiceDate> <InvoiceId>00000000-0000-0000-0000-000000000000</InvoiceId> <InvoiceNumber>0</InvoiceNumber> <IsSold>false</IsSold> <ModifiedUtc>0001-01-01T00:00:00</ModifiedUtc> <NoteIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </NoteIds> <Notes> <EAccountingDtos.NoteQueryResponse> <CreatedUtc>0001-01-01T00:00:00</CreatedUtc> <Id>String</Id> <ModifiedUtc>0001-01-01T00:00:00</ModifiedUtc> <Text>String</Text> </EAccountingDtos.NoteQueryResponse> </Notes> <PaymentDate>0001-01-01T00:00:00</PaymentDate> <PaymentStatus>Paid</PaymentStatus> <PaymentStatusTitle>String</PaymentStatusTitle> <Persons> <EAccountingClientDtos.Person> <Amount>0</Amount> <Ssn>String</Ssn> </EAccountingClientDtos.Person> </Persons> <PriceSign>String</PriceSign> <Rows> <EAccountingDtos.InvoiceLineQueryResponse> <AmountNoVat>0</AmountNoVat> <ArticleId>String</ArticleId> <ArticleNumber>String</ArticleNumber> <ContributionMargin> <Amount>0</Amount> <Percentage>0</Percentage> </ContributionMargin> <CostCenterItemId1>String</CostCenterItemId1> <CostCenterItemId2>String</CostCenterItemId2> <CostCenterItemId3>String</CostCenterItemId3> <DiscountPercentage>0</DiscountPercentage> <GreenTechnologyType>None</GreenTechnologyType> <IsServiceArticle>false</IsServiceArticle> <IsTextRow>false</IsTextRow> <IsVatFree>false</IsVatFree> <IsWorkCost>false</IsWorkCost> <LineNumber>0</LineNumber> <MaterialCosts>0</MaterialCosts> <PercentVat>0</PercentVat> <ProjectId>String</ProjectId> <Quantity>0</Quantity> <Text>String</Text> <UnitAbbreviation>String</UnitAbbreviation> <UnitAbbreviationEnglish>String</UnitAbbreviationEnglish> <UnitId>String</UnitId> <UnitPrice>0</UnitPrice> <WorkCostType>0</WorkCostType> <WorkHours>0</WorkHours> </EAccountingDtos.InvoiceLineQueryResponse> </Rows> <SendType>None</SendType> <TermsOfPaymentData> <AvailableForPurchase>false</AvailableForPurchase> <AvailableForSales>false</AvailableForSales> <Id>String</Id> <Name>String</Name> <NameEnglish>String</NameEnglish> <NumberOfDays>0</NumberOfDays> <TermsOfPaymentTypeId>0</TermsOfPaymentTypeId> <TermsOfPaymentTypeText>String</TermsOfPaymentTypeText> </TermsOfPaymentData> <TermsOfPaymentId>String</TermsOfPaymentId> <TotalAmount>0</TotalAmount> <TotalVatAmount>0</TotalVatAmount> <VatSpecification> <EAccountingDtos.VatSpecificationQueryResponse> <AmountInvoiceCurrency>0</AmountInvoiceCurrency> <VatAmountInvoiceCurrency>0</VatAmountInvoiceCurrency> <VatPercent>0</VatPercent> </EAccountingDtos.VatSpecificationQueryResponse> </VatSpecification> </EAccountingDtos.InvoiceQueryResponse>