mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for entity dates (#3563)
This commit is contained in:
parent
cdd562d3a5
commit
581654141b
@ -477,7 +477,7 @@ class CompanySettings extends BaseSettings
|
||||
'$contact.email',
|
||||
],
|
||||
'company_details' => [
|
||||
'$company.company_name',
|
||||
'$company.name',
|
||||
'$company.id_number',
|
||||
'$company.vat_number',
|
||||
'$company.website',
|
||||
@ -519,7 +519,7 @@ class CompanySettings extends BaseSettings
|
||||
'$product.cost',
|
||||
'$product.quantity',
|
||||
'$product.discount',
|
||||
'$product.tax_name1',
|
||||
'$product.tax',
|
||||
'$product.line_total',
|
||||
],
|
||||
'task_columns' =>[
|
||||
@ -528,7 +528,7 @@ class CompanySettings extends BaseSettings
|
||||
'$task.cost',
|
||||
'$task.quantity',
|
||||
'$task.discount',
|
||||
'$task.tax_name1',
|
||||
'$task.tax',
|
||||
'$task.line_total',
|
||||
],
|
||||
];
|
||||
|
@ -79,7 +79,7 @@ class Credit extends BaseModel
|
||||
const STATUS_APPLIED = 4;
|
||||
|
||||
public function getDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
//$value format 'Y:m:d H:i:s' to 'Y-m-d H:i'
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
@ -87,7 +87,7 @@ class Credit extends BaseModel
|
||||
}
|
||||
|
||||
public function getDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
//$value format 'Y:m:d H:i:s' to 'Y-m-d H:i'
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
@ -95,7 +95,7 @@ class Credit extends BaseModel
|
||||
}
|
||||
|
||||
public function getPartialDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
//$value format 'Y:m:d H:i:s' to 'Y-m-d H:i'
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
|
@ -129,21 +129,21 @@ class Invoice extends BaseModel
|
||||
const STATUS_REVERSED = -3;
|
||||
|
||||
public function getDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getPartialDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
|
@ -85,21 +85,21 @@ class Quote extends BaseModel
|
||||
const STATUS_EXPIRED = -1;
|
||||
|
||||
public function getDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getPartialDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
|
@ -112,21 +112,21 @@ class RecurringInvoice extends BaseModel
|
||||
];
|
||||
|
||||
public function getDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getPartialDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
|
@ -95,21 +95,21 @@ class RecurringQuote extends BaseModel
|
||||
];
|
||||
|
||||
public function getDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getPartialDueDateAttribute($value) {
|
||||
if (!$value) {
|
||||
if (!empty($value)) {
|
||||
return (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
return $value;
|
||||
|
@ -185,6 +185,7 @@ trait MakesInvoiceValues
|
||||
$data['$balance_due'] = &$data['$invoice.balance_due'];
|
||||
$data['$invoice.partial_due'] = ['value' => Number::formatMoney($this->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')];
|
||||
$data['$total'] = ['value' => Number::formatMoney($calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.total')];
|
||||
$data['$amount'] = &$data['$total'];
|
||||
$data['$quote.total'] = &$data['$total'];
|
||||
$data['$invoice.total'] = ['value' => Number::formatMoney($calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.invoice_total')];
|
||||
$data['$invoice.amount'] = &$data['$total'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user