switched 2 inputs
This commit is contained in:
@@ -148,5 +148,9 @@ TODO: enable option for showing prices
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="padding-top: 16pt">
|
||||
Die Ware bleibt bis zur vollständigen Bezahlung Eigentum der XINON GmbH.
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,7 +9,7 @@ class WarehouseShippingNoteModel extends TTCrudBaseModel {
|
||||
public string $deliveryAddressCity;
|
||||
public string $deliveryAddressEMail;
|
||||
public string $note;
|
||||
public string $status; // 'new'|'accepted'|'invoiced'
|
||||
public string $status; // 'new'|'in_progress'|'accepted'|'invoiced' TODO: add to enum / migration
|
||||
public string $positions;
|
||||
public string $textElements;
|
||||
public string $hoursEntries;
|
||||
|
||||
26
db/migrations/20241121100000_warehouse_modify_3.php
Normal file
26
db/migrations/20241121100000_warehouse_modify_3.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php /** @noinspection ALL */
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class WarehouseModify3 extends AbstractMigration {
|
||||
public function up(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$WarehouseShippingNote = $this->table("WarehouseShippingNote", ["signed" => true]);
|
||||
$WarehouseShippingNote->changeColumn("status", "enum", ["values" => ["new", "accepted", "invoiced", "in_progress"], "null" => false]);
|
||||
$WarehouseShippingNote->save();
|
||||
}
|
||||
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$WarehouseShippingNote = $this->table("WarehouseShippingNote");
|
||||
$WarehouseShippingNote->changeColumn("status", "enum", ["values" => ["new", "accepted", "invoiced"], "null" => false]);
|
||||
$WarehouseShippingNote->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,10 @@ class Helper {
|
||||
} else if (!empty($filterValue)) {
|
||||
if ($exactMatch) {
|
||||
$sql .= " AND `$columnName` = '" . $filterValue . "'";
|
||||
} else if ($filterValue[0] === "%") {
|
||||
$sql .= " AND `$columnName` LIKE '" . $filterValue . "'";
|
||||
} else if ($filterValue[strlen($filterValue) - 1] === "%") {
|
||||
$sql .= " AND `$columnName` LIKE '" . $filterValue . "'";
|
||||
} else {
|
||||
$filterItems = explode(" ", $filterValue);
|
||||
foreach ($filterItems as $item) {
|
||||
|
||||
@@ -124,6 +124,10 @@ class TTCrud extends mfBaseController {
|
||||
$page = $this->postData['pagination']['page'] ?? 1;
|
||||
$perPage = $this->postData['pagination']['per_page'] ?? 10;
|
||||
|
||||
if ($order['key'] === null && isset($this->defaultOrder)) {
|
||||
$order = $this->defaultOrder;
|
||||
}
|
||||
|
||||
$rows = $this->model::getAll($filter, $perPage, ($page - 1) * $perPage, $order);
|
||||
$filteredAvailable = $this->model::count($filter);
|
||||
$totalRows = $this->model::count();
|
||||
@@ -240,11 +244,19 @@ class TTCrud extends mfBaseController {
|
||||
|
||||
if (strlen($searchedID) > 0) {
|
||||
$filter = ['id' => $searchedID];
|
||||
$data = $this->model::getAll($filter, 10);
|
||||
} else {
|
||||
$filter = [$textKey => $this->request->q . '%'];
|
||||
$data = $this->model::getAll($filter, 10);
|
||||
if (count($data) < 11) {
|
||||
$filter = [$textKey => $this->request->q];
|
||||
$lazyData = $this->model::getAll($filter, 10);
|
||||
$data = array_merge($data, $lazyData);
|
||||
$data = array_unique($data, SORT_REGULAR);
|
||||
$data = array_slice($data, 0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
$data = $this->model::getAll($filter, 10);
|
||||
|
||||
self::returnJson(array_map(function ($item) use ($textKey) {
|
||||
return ['value' => $item->id, 'text' => $item->$textKey];
|
||||
|
||||
@@ -246,6 +246,7 @@ Vue.component('warehouse-article-price-modal', {
|
||||
})
|
||||
|
||||
|
||||
// noinspection EqualityComparisonWithCoercionJS
|
||||
Vue.component('warehouse-article', {
|
||||
//language=Vue
|
||||
template: `
|
||||
@@ -261,7 +262,7 @@ Vue.component('warehouse-article', {
|
||||
|
||||
<template v-slot:cheapestsellprice="{ row }">
|
||||
<template v-for="price in JSON.parse(row.cheapestSellPrice)">
|
||||
<span v-if="price && window.TT_CONFIG['WAREHOUSE_ADMIN'] === true">{{price.title}}: {{(price.price)}} €<br></span>
|
||||
<span v-if="price && window.TT_CONFIG['WAREHOUSE_ADMIN'] == true">{{price.title}}: {{(price.price)}} €<br></span>
|
||||
<span v-if="price && price.title === 'Verkauf'">{{(price.price)}} €</span>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -57,7 +57,7 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', {
|
||||
<tt-input v-model="hourCount" label="Stunden" sm/>
|
||||
<tt-autocomplete v-model="carId" :api-url="carApiUrl" label="Fahrzeug" sm/>
|
||||
<tt-input v-model="hourlyPrice" label="Stundenlohn" type="number" sm v-if="showHourlyPrice"/>
|
||||
<tt-input v-model="kilometerCount" label="Kilometer" sm/>
|
||||
<tt-input :disabled="carId === ''" v-model="kilometerCount" label="Kilometer" sm/>
|
||||
<div class="warehouse-shipping-note-modal-hours-entry-actions">
|
||||
<button @click="createOrUpdate" class="btn btn-sm btn-primary">Speichern</button>
|
||||
</div>
|
||||
@@ -87,6 +87,10 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', {
|
||||
this.updateCarId().then();
|
||||
},
|
||||
async updateKilometerCount() {
|
||||
if (!this.carId) {
|
||||
this.kilometerCount = '';
|
||||
return;
|
||||
}
|
||||
const delAddr = this.$parent.$parent.$parent.delAddrLine +
|
||||
' ' +
|
||||
this.$parent.$parent.$parent.delAddrCity +
|
||||
@@ -122,6 +126,8 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', {
|
||||
if (!this.kilometerCount) this.updateKilometerCount().then();
|
||||
|
||||
this.$parent.$parent.$parent.$watch('delAddrLine', this.updateKilometerCount);
|
||||
this.$watch('carId', this.updateKilometerCount);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@@ -429,6 +435,7 @@ Vue.component('warehouse-shipping-note-modal-positions', {
|
||||
})
|
||||
|
||||
|
||||
// noinspection EqualityComparisonWithCoercionJS
|
||||
Vue.component('warehouse-shipping-note-modal', {
|
||||
props: {
|
||||
id: {type: [String, Number], required: true},
|
||||
@@ -464,10 +471,12 @@ Vue.component('warehouse-shipping-note-modal', {
|
||||
:del-addr-e-mail.sync="delAddrEMail"/>
|
||||
|
||||
|
||||
<div v-show="delAddrFilled === false">
|
||||
<div v-show="delAddrFilled === true">
|
||||
<template v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && 1 < 0">
|
||||
<hr>
|
||||
<h4 class="text-center">Textelemente</h4>
|
||||
<warehouse-shipping-note-modal-text-elements :text-elements="textElements"/>
|
||||
</template>
|
||||
|
||||
|
||||
<hr>
|
||||
@@ -484,14 +493,21 @@ Vue.component('warehouse-shipping-note-modal', {
|
||||
<warehouse-shipping-note-modal-positions :positions.sync="positions" :bill-addr-id="billAddrId"/>
|
||||
</div>
|
||||
|
||||
<div v-show="delAddrFilled === true" class="text-center">Bitte füllen Sie die Rechnungs- und Lieferadresse aus</div>
|
||||
<div v-show="delAddrFilled === false" class="text-center">Bitte füllen Sie die Rechnungs- und Lieferadresse aus</div>
|
||||
|
||||
</div>
|
||||
<!-- TODO: fix these buttons-->
|
||||
<template v-slot:footer-prepend v-if="id !== 'create'">
|
||||
<button v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && status === 'new'" class="btn btn-warning" @click="alert('In Bearbeitung')">In
|
||||
Bearbeitung
|
||||
</button>
|
||||
<button v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && (status === 'new' || status === 'in_progress')" class="btn btn-success"
|
||||
@click="alert('Accepted')">Akzeptieren
|
||||
</button>
|
||||
<button v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && status === 'accepted'" class="btn btn-info" @click="alert('Invoiced')">
|
||||
Verrechnet
|
||||
</button>
|
||||
<button class="btn btn-info" @click="$emit('open-signing-modal', id)">Unterschreiben</button>
|
||||
<!-- <button class="btn btn-success" @click="alert('Accept')">Akzeptieren</button>-->
|
||||
<!-- <button class="btn btn-warning" @click="alert('Invoiced')">Verrechnet</button>-->
|
||||
</template>
|
||||
</tt-modal>
|
||||
`,
|
||||
@@ -559,7 +575,8 @@ Vue.component('warehouse-shipping-note-modal', {
|
||||
return this.id === 'create' ? 'Lieferschein erstellen' : `Lieferschein #${this.id} bearbeiten`;
|
||||
},
|
||||
delAddrFilled() {
|
||||
return !this.delAddrName || !this.delAddrLine || !this.delAddrPLZ || !this.delAddrCity;
|
||||
if (this.id !== 'create') return true;
|
||||
return !!this.delAddrName && !!this.delAddrLine && !!this.delAddrPLZ && !!this.delAddrCity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,12 +616,13 @@ Vue.component('warehouse-shipping-note-modal-address', {
|
||||
<template v-else-if="addressMode === 'new'">
|
||||
<tt-input :value="delAddrName" @input="$emit('update:delAddrName', $event)" label="Lieferadresse Name*" sm row/>
|
||||
<tt-input :value="delAddrEMail" @input="$emit('update:delAddrEMail', $event)" label="Lieferadresse E-Mail" sm row/>
|
||||
<tt-autocomplete :api-url="window.TT_CONFIG['BASE_PATH'] + '/WarehouseShippingNote/geoAutocomplete'" @input="newAddrGeoLatLon = $event" label="Adresse*" sm row/>
|
||||
<tt-autocomplete :api-url="window.TT_CONFIG['BASE_PATH'] + '/WarehouseShippingNote/geoAutocomplete'" @input="newAddrGeoLatLon = $event"
|
||||
label="Adresse*" sm row/>
|
||||
|
||||
<span v-if="delAddrLine && delAddrPLZ && delAddrCity">Adresse: {{ delAddrLine }}, {{ delAddrPLZ }} {{ delAddrCity }}</span>
|
||||
<!-- <tt-input :value="delAddrLine" @input="$emit('update:delAddrLine', $event)" label="Lieferadresse" sm row/>-->
|
||||
<!-- <tt-input :value="delAddrPLZ" @input="$emit('update:delAddrPLZ', $event)" label="Lieferadresse PLZ" sm row/>-->
|
||||
<!-- <tt-input :value="delAddrCity" @input="$emit('update:delAddrCity', $event)" label="Lieferadresse Ort" sm row/>-->
|
||||
<!-- <tt-input :value="delAddrLine" @input="$emit('update:delAddrLine', $event)" label="Lieferadresse" sm row/>-->
|
||||
<!-- <tt-input :value="delAddrPLZ" @input="$emit('update:delAddrPLZ', $event)" label="Lieferadresse PLZ" sm row/>-->
|
||||
<!-- <tt-input :value="delAddrCity" @input="$emit('update:delAddrCity', $event)" label="Lieferadresse Ort" sm row/>-->
|
||||
</template>
|
||||
</div>
|
||||
`,
|
||||
@@ -616,14 +634,30 @@ Vue.component('warehouse-shipping-note-modal-address', {
|
||||
},
|
||||
methods: {
|
||||
async fetchGeoAddress() {
|
||||
if (!this.newAddrGeoLatLon) return;
|
||||
if (!this.newAddrGeoLatLon) {
|
||||
this.$emit('update:delAddrLine', '');
|
||||
this.$emit('update:delAddrPLZ', '');
|
||||
this.$emit('update:delAddrCity', '');
|
||||
return;
|
||||
}
|
||||
const [lat, lon] = this.newAddrGeoLatLon.split(',');
|
||||
const response = await axios.get(window.TT_CONFIG["BASE_PATH"] + '/WarehouseShippingNote/geoReverse?lat=' + lat + '&lon=' + lon);
|
||||
|
||||
if (response.data.address.road) {
|
||||
this.$emit('update:delAddrLine', `${response.data.address.road}${response.data.address.house_number ? ' ' + response.data.address.house_number : ''}`);
|
||||
} else {
|
||||
this.$emit('update:delAddrLine', `${response.data.address.village}${response.data.address.house_number ? ' ' + response.data.address.house_number : ''}`);
|
||||
this.$emit('update:delAddrLine',
|
||||
`${response.data.address.road}${response.data.address.house_number ? ' ' + response.data.address.house_number : ''}`);
|
||||
} else if(response.data.address.village) {
|
||||
this.$emit('update:delAddrLine',
|
||||
`${response.data.address.village}${response.data.address.house_number ? ' ' + response.data.address.house_number : ''}`);
|
||||
} else if(response.data.address.hamlet) {
|
||||
this.$emit('update:delAddrLine',
|
||||
`${response.data.address.hamlet}${response.data.address.house_number ? ' ' + response.data.address.house_number : ''}`);
|
||||
} else if(response.data.address.residential) {
|
||||
this.$emit('update:delAddrLine',
|
||||
`${response.data.address.residential}${response.data.address.house_number ? ' ' + response.data.address.house_number : ''}`);
|
||||
} else if(response.data.address.city) {
|
||||
this.$emit('update:delAddrLine',
|
||||
`${response.data.address.city}${response.data.address.house_number ? ' ' + response.data.address.house_number : ''}`);
|
||||
}
|
||||
|
||||
this.$emit('update:delAddrPLZ', response.data.address.postcode);
|
||||
|
||||
Reference in New Issue
Block a user