-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update classes and methods, rename classes, and add new features
Added the setCompanyVatCode method to multiple classes along with edits to existing functions for better return typing and renaming of classes for clarity. The ability to send an email upon invoice creation has also been added to ProformaInvoice. The README documentation was updated accordingly to reflect these changes.
- Loading branch information
Showing
9 changed files
with
130 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Ag84ark\SmartBill\ApiResponse; | ||
|
||
class InvoicePaymentStatusApiResponse extends BaseApiResponse | ||
{ | ||
private string $number = ''; | ||
private string $series = ''; | ||
private float $invoiceTotalAmount = 0; | ||
private float $paidAmount = 0; | ||
private float $unpaidAmount = 0; | ||
|
||
public static function fromArray(array $data): InvoicePaymentStatusApiResponse | ||
{ | ||
$invoicePaymentStatusResponse = new InvoicePaymentStatusApiResponse(); | ||
$invoicePaymentStatusResponse->errorText = $data['errorText']; | ||
$invoicePaymentStatusResponse->message = $data['message']; | ||
$invoicePaymentStatusResponse->number = $data['number']; | ||
$invoicePaymentStatusResponse->series = $data['series']; | ||
$invoicePaymentStatusResponse->invoiceTotalAmount = $data['invoiceTotalAmount']; | ||
$invoicePaymentStatusResponse->paidAmount = $data['paidAmount']; | ||
$invoicePaymentStatusResponse->unpaidAmount = $data['unpaidAmount']; | ||
|
||
$invoicePaymentStatusResponse->responseData = $data; | ||
|
||
return $invoicePaymentStatusResponse; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return array_merge(parent::toArray(), [ | ||
'number' => $this->number, | ||
'series' => $this->series, | ||
'invoiceTotalAmount' => $this->invoiceTotalAmount, | ||
'paidAmount' => $this->paidAmount, | ||
'unpaidAmount' => $this->unpaidAmount, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters