mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
Fixes #439
This commit is contained in:
@ -22,17 +22,26 @@ class CustomFieldValue extends Model
|
|||||||
|
|
||||||
public function setDateAnswerAttribute($value)
|
public function setDateAnswerAttribute($value)
|
||||||
{
|
{
|
||||||
$this->attributes['date_answer'] = Carbon::createFromFormat('Y-m-d', $value);
|
if ($value && $value != null) {
|
||||||
|
$this->attributes['date_answer'] = Carbon::createFromFormat('Y-m-d', $value);
|
||||||
|
}
|
||||||
|
$this->attributes['date_answer'] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTimeAnswerAttribute($value)
|
public function setTimeAnswerAttribute($value)
|
||||||
{
|
{
|
||||||
$this->attributes['time_answer'] = date("H:i:s", strtotime($value));
|
if ($value && $value != null) {
|
||||||
|
$this->attributes['time_answer'] = date("H:i:s", strtotime($value));
|
||||||
|
}
|
||||||
|
$this->attributes['time_answer'] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDateTimeAnswerAttribute($value)
|
public function setDateTimeAnswerAttribute($value)
|
||||||
{
|
{
|
||||||
$this->attributes['date_time_answer'] = Carbon::createFromFormat('Y-m-d H:i', $value);
|
if ($value && $value != null) {
|
||||||
|
$this->attributes['date_time_answer'] = Carbon::createFromFormat('Y-m-d H:i', $value);
|
||||||
|
}
|
||||||
|
$this->attributes['time_answer'] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDefaultAnswerAttribute()
|
public function getDefaultAnswerAttribute()
|
||||||
|
|||||||
@ -72,11 +72,9 @@ export default {
|
|||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
this.date =
|
this.date =
|
||||||
this.field && this.field.defaultAnswer
|
this.field && this.field.defaultAnswer && this.field.defaultAnswer
|
||||||
? this.field.defaultAnswer
|
|
||||||
: new Date()
|
|
||||||
this.placeholder =
|
this.placeholder =
|
||||||
this.field && this.field.placeholder ? this.field.placeholder : ''
|
this.field && this.field.placeholder ? this.field.placeholder : ''
|
||||||
},
|
},
|
||||||
|
|||||||
@ -460,7 +460,7 @@ export default {
|
|||||||
taxPerItem: null,
|
taxPerItem: null,
|
||||||
discountPerItem: null,
|
discountPerItem: null,
|
||||||
isLoadingInvoice: false,
|
isLoadingInvoice: false,
|
||||||
isLoadingData: false,
|
isLoadingData: true,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
maxDiscount: 0,
|
maxDiscount: 0,
|
||||||
invoicePrefix: null,
|
invoicePrefix: null,
|
||||||
@ -834,10 +834,9 @@ export default {
|
|||||||
|
|
||||||
if (res2.data) {
|
if (res2.data) {
|
||||||
let customFields = res2.data.customFields.data
|
let customFields = res2.data.customFields.data
|
||||||
this.setEditCustomFields(fields, customFields)
|
await this.setEditCustomFields(fields, customFields)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isLoadingInvoice = false
|
this.isLoadingInvoice = false
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user