aboutsummaryrefslogtreecommitdiff
path: root/classes/Offer.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Offer.php')
-rw-r--r--classes/Offer.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/classes/Offer.php b/classes/Offer.php
index 8da2095..1422721 100644
--- a/classes/Offer.php
+++ b/classes/Offer.php
@@ -282,14 +282,14 @@ class Offer extends Model{
*/
public function createAssignment($title, $description, $hours, $price_per_hour, $vat) {
$stmt = $this->pdo->prepare("INSERT INTO `".Constants::db_prefix."assignment` (`offerId`,`title`,`description`,`hours`,`price_per_hour`,`VAT_percentage`) VALUES (?,?,?,?,?,?)");
- $stmt->execute(array(
+ $stmt->execute([
$this->id,
$title,
$description,
$hours,
$price_per_hour,
$vat
- ));
+ ]);
if ($stmt->rowCount() == 1) {
return new Assignment($this->pdo, $this->pdo->lastInsertId());
} else {
@@ -313,13 +313,13 @@ class Offer extends Model{
*/
public function createDiscount($title, $description, $value, $vat) {
$stmt = $this->pdo->prepare("INSERT INTO `".Constants::db_prefix."discount` (`offerId`,`title`,`description`,`value`,`VAT_percentage`) VALUES (?,?,?,?,?)");
- $stmt->execute(array(
+ $stmt->execute([
$this->id,
$title,
$description,
$value,
$vat
- ));
+ ]);
if ($stmt->rowCount() == 1) {
return new Discount($this->pdo, $this->pdo->lastInsertId());
} else {
@@ -372,24 +372,24 @@ class Offer extends Model{
$this->invoice_fileId = $file->id;
} else {
- $invoice_nr = str_replace(array('invoice-','.pdf'), array('',''), $file->filename);
+ $invoice_nr = str_replace(['invoice-','.pdf'], ['', ''], $file->filename);
}
- $list = array();
+ $list = [];
foreach ($this->getAssignments() as $assignment)
- $list[] = array(
+ $list[] = [
$assignment->title,
$assignment->price_per_hour * $assignment->hours,
$assignment->VAT_percentage . "%",
$assignment->price_per_hour * $assignment->hours * (1 + $assignment->VAT_percentage / 100)
- );
+ ];
foreach ($this->getDiscounts() as $discount)
- $list[] = array(
+ $list[] = [
$discount->title,
$discount->calculate(Calculatable::SUBTOTAL),
$discount->VAT_percentage . "%",
$discount->calculate(Calculatable::TOTAL)
- );
+ ];
$pdf = new Correspondence();
$pdf->SetContact($this->getContact());
@@ -404,9 +404,9 @@ class Offer extends Model{
$pdf->SetTextColor(0);
$pdf->Ln();
- $width = array(90,25,20,25);
+ $width = [90, 25, 20, 25];
$subtotal = 0;
- $btw = array();
+ $btw = [];
$total = 0;
// Header