diff --git a/app/Http/Controllers/ContractController.php b/app/Http/Controllers/ContractController.php index e56327c..e94da25 100644 --- a/app/Http/Controllers/ContractController.php +++ b/app/Http/Controllers/ContractController.php @@ -51,7 +51,7 @@ class ContractController extends Controller 'car' => $this->getCarFields($car), 'contact' => $this->getContactFields($contact), 'type' => ContractType::coerce($type)->key, - 'car_first' => $request->query('carFirst'), + 'car_first' => (bool)$request->query('carFirst'), ]); } @@ -153,6 +153,7 @@ class ContractController extends Controller 'contract' => [ 'id' => $contract->id, 'date' => $contract->date, + 'date_formatted' => $contract->date_formatted, 'is_sell_contract' => $contract->isSellContract(), 'price' => $contract->price->getAmount(), 'insurance_type' => (string)$contract->insurance_type, diff --git a/public/css/app.css b/public/css/app.css index 652c07d..abaae22 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -1,4 +1,4 @@ -/*! tailwindcss v2.1.2 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v2.1.4 | MIT License | https://tailwindcss.com */ /*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ diff --git a/public/js/app.js b/public/js/app.js index dcec18e..52d2b3d 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -18922,11 +18922,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope id: this.car.id, stammnummer: this.car.stammnummer, vin: this.car.vin, - initial_date: (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(Date.parse(this.car.initial_date)), + initial_date: (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(new Date(this.car.initial_date)), colour: this.car.colour, notes: this.car.notes, car_model_id: this.car.car_model.id, - last_check_date: (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(Date.parse(this.car.last_check_date)), + last_check_date: (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(new Date(this.car.last_check_date)), kilometers: this.car.kilometers, known_damage: this.car.known_damage }, "notes", this.car.notes) @@ -19742,7 +19742,8 @@ __webpack_require__.r(__webpack_exports__); type: this.type == "SellContract" ? '0' : '1', insurance_type: '0', car_id: this.car.id, - contact_id: this.contact.id + contact_id: this.contact.id, + is_sell_contract: this.type == "SellContract" } }; }, @@ -20077,9 +20078,10 @@ __webpack_require__.r(__webpack_exports__); on_success: 'Änderungen gespeichert' }, data: { - date: (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(Date.parse(this.contract.date)), + date: (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(new Date(this.contract.date)), price: this.contract.price, - insurance_type: this.contract.insurance_type + insurance_type: this.contract.insurance_type, + is_sell_contract: this.contract.is_sell_contract } }; } @@ -27406,7 +27408,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", null, [!$props.car_first ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_jet_form_section, { key: 0, - emptyBg: "true", + emptyBg: true, "class": "max-w-7xl mb-5" }, { title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { @@ -27432,7 +27434,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_form_section, { "class": "max-w-7xl", - emptyBg: "true" + emptyBg: true }, { title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [_hoisted_2]; @@ -27455,7 +27457,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { }), $props.car_first ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_jet_form_section, { key: 1, - emptyBg: "true", + emptyBg: true, "class": "max-w-7xl mt-5" }, { title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { @@ -27601,7 +27603,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_form_section, { "class": "max-w-7xl", - emptyBg: "true" + emptyBg: true }, { title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [_hoisted_2]; @@ -27810,7 +27812,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_form_section, { "class": "max-w-7xl", - emptyBg: "true" + emptyBg: true }, { title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.contactType), 1 @@ -27963,7 +27965,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { }, null, 8 /* PROPS */ , ["text", "href"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_bread_crumb, { - text: 'Vertrag vom ' + $props.contract.date, + text: 'Vertrag vom ' + $props.contract.date_formatted, href: _ctx.route('contracts.show', $props.contract.id) }, null, 8 /* PROPS */ diff --git a/resources/js/Pages/Cars/Edit.vue b/resources/js/Pages/Cars/Edit.vue index f295f07..de9c5cc 100644 --- a/resources/js/Pages/Cars/Edit.vue +++ b/resources/js/Pages/Cars/Edit.vue @@ -62,11 +62,11 @@ export default { id: this.car.id, stammnummer: this.car.stammnummer, vin: this.car.vin, - initial_date: ref(Date.parse(this.car.initial_date)), + initial_date: ref(new Date(this.car.initial_date)), colour: this.car.colour, notes: this.car.notes, car_model_id: this.car.car_model.id, - last_check_date: ref(Date.parse(this.car.last_check_date)), + last_check_date: ref(new Date(this.car.last_check_date)), kilometers: this.car.kilometers, known_damage: this.car.known_damage, notes: this.car.notes, diff --git a/resources/js/Pages/Contracts/Create.vue b/resources/js/Pages/Contracts/Create.vue index f80859a..686a189 100644 --- a/resources/js/Pages/Contracts/Create.vue +++ b/resources/js/Pages/Contracts/Create.vue @@ -12,7 +12,7 @@
- + @@ -23,7 +23,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -94,6 +94,7 @@ export default { insurance_type: '0', car_id: this.car.id, contact_id: this.contact.id, + is_sell_contract: this.type == "SellContract", }, } }, diff --git a/resources/js/Pages/Contracts/CreateFromCar.vue b/resources/js/Pages/Contracts/CreateFromCar.vue index e2d780c..901fc38 100644 --- a/resources/js/Pages/Contracts/CreateFromCar.vue +++ b/resources/js/Pages/Contracts/CreateFromCar.vue @@ -8,7 +8,7 @@
- + diff --git a/resources/js/Pages/Contracts/CreateFromContact.vue b/resources/js/Pages/Contracts/CreateFromContact.vue index 9bfc4f0..f1a22d7 100644 --- a/resources/js/Pages/Contracts/CreateFromContact.vue +++ b/resources/js/Pages/Contracts/CreateFromContact.vue @@ -8,7 +8,7 @@
- + diff --git a/resources/js/Pages/Contracts/Edit.vue b/resources/js/Pages/Contracts/Edit.vue index d24baa4..57445d4 100644 --- a/resources/js/Pages/Contracts/Edit.vue +++ b/resources/js/Pages/Contracts/Edit.vue @@ -4,7 +4,7 @@

- + bearbeiten

@@ -46,9 +46,10 @@ export default { on_success: 'Änderungen gespeichert', }, data: { - date: ref(Date.parse(this.contract.date)), + date: ref(new Date(this.contract.date)), price: this.contract.price, insurance_type: this.contract.insurance_type, + is_sell_contract: this.contract.is_sell_contract, } } },