Merge remote-tracking branch 'origin/master'

This commit is contained in:
Omair Saleh
2019-04-24 00:01:02 +08:00
16 changed files with 282 additions and 41 deletions
@@ -29,8 +29,9 @@ class ListsOrderHistory
foreach ($orderSteps as $step){
switch ($step->reference_id){
case Constants::ORDER_PROCESSING_STEP:
$warehouse = Warehouse::find($order->warehouse_id)->first();
$history->push(['date' => $step->updated_at->format('d-m-Y H:i'), 'description' => $warehouse ? $warehouse->name.' confirmed as your order\'s warehouse' : ' Your order\'s warehouse has been confirmed']);
if($order->warehouse_id){
$history->push(['date' => $step->updated_at->format('d-m-Y H:i'), 'description' => Warehouse::find($order->warehouse_id)->first()->name.' confirmed as your order\'s warehouse']);
}
break;
case Constants::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER:
$history->push(['date' => $step->updated_at->format('d-m-Y H:i'), 'description' => 'Your Order has been loaded into container']);
@@ -45,14 +46,14 @@ class ListsOrderHistory
$history->push(['date' => $step->updated_at->format('d-m-Y H:i'), 'description' => 'Invoice has been issued, waiting for shipping payment']);
break;
case Constants::ORDER_SHIPPING_STEP:
$shippingArrangment = $order->shippingArrangement()->first();
if($shippingArrangment){
$shippingSchedules = $shippingArrangment->shippingSchedule()->get();
$shippingArrangement = $order->shippingArrangement()->first();
if($shippingArrangement){
$shippingSchedules = $shippingArrangement->shippingSchedule()->get();
foreach ($shippingSchedules as $schedule){
if($schedule->status === 2){
$customeIssue = CustomIssues::where('schedule_id', $schedule->id)->first();
if($customeIssue !== null){
$history->push(['date' => $step->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Shipping Schedule failed due to: '.$customeIssue->remark]);
$customIssue = CustomIssues::where('schedule_id', $schedule->id)->first();
if($customIssue !== null){
$history->push(['date' => $step->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Shipping Schedule failed due to: '.$customIssue->remark]);
} else {
$history->push(['date' => $step->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Shipping Schedule failed']);
}
@@ -77,19 +78,19 @@ class ListsOrderHistory
}
if($order->current_step === Constants::ORDER_SHIPPING_STEP){
$shippingArrangment = $order->shippingArrangement()->first();
if($shippingArrangment){
$shippingSchedules = $shippingArrangment->shippingSchedule()->get();
$shippingArrangement = $order->shippingArrangement()->first();
if($shippingArrangement){
$shippingSchedules = $shippingArrangement->shippingSchedule()->get();
foreach ($shippingSchedules as $schedule){
if($schedule->status === 2){
$customeIssue = CustomIssues::where('schedule_id', $schedule->id)->first();
if($customeIssue !== null){
$history->push(['date' => $shippingSchedules->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Shipping Schedule failed due to: '.$customeIssue->remark]);
$customIssue = CustomIssues::where('schedule_id', $schedule->id)->first();
if($customIssue !== null){
$history->push(['date' => $schedule->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Shipping Schedule failed due to: '.$customIssue->remark]);
} else {
$history->push(['date' => $shippingSchedules->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Shipping Schedule failed']);
$history->push(['date' => $schedule->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Shipping Schedule failed']);
}
} else {
$history->push(['date' => $shippingSchedules->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Your Order has been scheduled for shipping ']);
$history->push(['date' => $schedule->updated_at->format('d-m-Y H:i'), 'description' => '[ETD: '.$schedule->ETD.', ETA: '.$schedule->ETA.'] Your Order has been scheduled for shipping ']);
}
}
}
@@ -1,11 +1,13 @@
<template>
<div class="row" ref="content">
<div class="col no-padding">
<div class="row">
<div class="col all-caps fs-13 bold" ref="title"></div>
</div>
<div class="row fs-12 m-t-5">
<div class="col" ref="message"></div>
<div class="hide">
<div class="row" ref="content">
<div class="col no-padding">
<div class="row">
<div class="col all-caps fs-13 bold" ref="title"></div>
</div>
<div class="row fs-12 m-t-5">
<div class="col" ref="message"></div>
</div>
</div>
</div>
</div>
@@ -26,7 +28,7 @@
let content = this.$refs.content;
new Noty({
type: 'error',
type: 'success',
text: content.innerHTML.toString(),
timeout: 5000,
closeWith: ['button'],
@@ -1,6 +1,7 @@
<template>
<div class="card card-default no-border no-margin">
<loading-component v-show="isLoading"></loading-component>
<notification-component ref="notification"></notification-component>
<loading-component v-show="isLoading"></loading-component>
<div class="card-block">
<div class="row" v-show="!this.isEdit">
<div class="col">
@@ -47,6 +48,7 @@
</div>
</template>
<script>
import notificationConstant from '../../../constant/notification'
export default {
props: {
'id': {
@@ -101,10 +103,19 @@
'content-type': 'application/json'
}
}).then((response) => {
let notification = this.$refs.notification;
if(!this.isEdit){
Event.$emit('updateAddressBookList');
this.clearForm();
notification.title = notificationConstant.IMPORTER.ADDRESS_BOOK.TITLE;
notification.message = notificationConstant.IMPORTER.ADDRESS_BOOK.MESSAGE;
}
else {
notification.title = notificationConstant.IMPORTER.ADDRESS_BOOK.UPDATED.TITLE;
notification.message = notificationConstant.IMPORTER.ADDRESS_BOOK.UPDATED.MESSAGE;
}
notification.execute();
//turn off loading animation
this.isLoading = false;
@@ -1,7 +1,7 @@
<template>
<div>
<notification-component ref="notification"></notification-component>
<loading-component v-show="isLoading"></loading-component>
<loading-component v-show="isLoading"></loading-component>
<div class="row m-t-20" v-show="!isEdit">
<div class="col">
<div class="b-l b-success p-l-15 m-b-15" style="border-left-width: 3px;">
@@ -61,6 +61,7 @@
</div>
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -153,21 +154,22 @@
'content-type': 'application/json'
}
}).then((response) => {
let notification = this.$refs.notification;
if(!this.isEdit){
Event.$emit('updateCompanyList');
this.clearForm();
notification.title = notificationConstant.IMPORTER.DETAILS.CREATED.TITLE;
notification.message = notificationConstant.IMPORTER.DETAILS.CREATED.MESSAGE;
}
else {
notification.title = notificationConstant.IMPORTER.DETAILS.UPDATED.MESSAGE;
notification.message = notificationConstant.IMPORTER.DETAILS.UPDATED.MESSAGE;
}
let notification = this.$refs.notification;
notification.title = 'Created Successfully';
notification.message = 'Importer details have been updated successfully';
notification.execute();
//turn off loading animation
this.isLoading = false;
$('.modal').modal('hide');
this.collapseEdit();
})
}
@@ -1,5 +1,6 @@
<template>
<div class="card card-default no-border no-margin">
<notification-component ref="notification"></notification-component>
<loading-component v-show="isLoading"></loading-component>
<div class="card-block">
<div class="row" v-show="!this.isEdit">
@@ -60,6 +61,7 @@
</div>
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'type': {
@@ -110,11 +112,18 @@
'content-type': 'application/json'
}
}).then((response) => {
let notification = this.$refs.notification;
if(!this.isEdit){
Event.$emit('updateContactsList');
this.clearForm();
notification.title = notificationConstant.WAREHOUSE.CONTACT.UPDATED.TITLE;
notification.title = notificationConstant.WAREHOUSE.CONTACT.UPDATED.MESSAGE;
}
else {
notification.title = notificationConstant.WAREHOUSE.CONTACT.CREATED.TITLE;
notification.title = notificationConstant.WAREHOUSE.CONTACT.CREATED.MESSAGE;
}
notification.execute();
//turn off loading animation
this.isLoading = false;
@@ -1,5 +1,6 @@
<template>
<div class="inline">
<notification-component ref="notification"></notification-component>
<div class="btn btn-sm btn-success b-rad-none requestModal" data-type="arrival">Order Arrived</div>
<confirm-modal-component
title="Order Arrival"
@@ -11,6 +12,7 @@
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -36,6 +38,14 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.WAREHOUSE_ARRIVAL.TITLE;
notification.message = notificationConstant.ORDER.WAREHOUSE_ARRIVAL.MESSAGE;
notification.execute();
Event.$emit('updateOrdersList', true);
@@ -2,6 +2,7 @@
<div class="inline">
<div class="btn btn-sm btn-success b-rad-none requestModal" data-type="receiveNote">Confirm Warehouse</div>
<modal-component type="receiveNote">
<notification-component ref="notification"></notification-component>
<loading-component style="left: 0;" v-show="isLoading"></loading-component>
<div class="card card-default no-border">
<div class="card-block no-padding">
@@ -55,6 +56,7 @@
</div>
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -108,6 +110,14 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.ORDER_WAREHOUSE_CONFIRMED.TITLE;
notification.message = notificationConstant.ORDER.ORDER_WAREHOUSE_CONFIRMED.MESSAGE;
notification.execute();
Event.$emit('updateOrdersList');
})
@@ -1,5 +1,6 @@
<template>
<div class="inline">
<notification-component ref="notification"></notification-component>
<div class="btn btn-sm btn-success b-rad-none requestModal" data-type="delivery">Out for Delivery</div>
<confirm-modal-component
title="Order Packed"
@@ -11,6 +12,7 @@
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -36,6 +38,13 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.OUT_FOR_DELIVERY.TITLE;
notification.message = notificationConstant.ORDER.OUT_FOR_DELIVERY.MESSAGE;
notification.execute();
Event.$emit('updateOrdersList', true);
@@ -1,5 +1,6 @@
<template>
<div class="inline">
<notification-component ref="notification"></notification-component>
<div class="btn btn-sm btn-success b-rad-none requestModal" v-if="this.packingList.confirmed" data-type="packed">Order Packed</div>
<div class="btn btn-sm btn-complete b-rad-none requestModal" data-type="packingList">Packing List</div>
<modal-component type="packingList" large>
@@ -196,6 +197,7 @@
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -245,6 +247,14 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.PACKING_LIST_NOTIFICATION.TITLE;
notification.message = notificationConstant.ORDER.PACKING_LIST_NOTIFICATION.MESSAGE;
notification.execute();
Event.$emit('updateOrdersList');
});
@@ -262,6 +272,13 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.ORDER_PACKED.TITLE;
notification.message = notificationConstant.ORDER.ORDER_PACKED.MESSAGE;
notification.execute();
Event.$emit('updateOrdersList', true);
@@ -2,6 +2,7 @@
<div class="inline">
<div class="btn btn-sm btn-success b-rad-none requestModal" data-type="receiveNote">Warehouse Received</div>
<modal-component type="receiveNote">
<notification-component ref="notification"></notification-component>
<loading-component style="left: 0;" v-show="isLoading"></loading-component>
<div class="card card-default no-border">
<div class="card-block no-padding">
@@ -51,6 +52,7 @@
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -113,6 +115,13 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.WAREHOUSE_RECEIVE.TITLE;
notification.message = notificationConstant.ORDER.WAREHOUSE_RECEIVE.MESSAGE;
notification.execute();
$(this.$el).find('.receiveForm').parents('.modal').modal('hide')
Event.$emit('updateOrdersList');
@@ -4,6 +4,7 @@
<div class="btn btn-sm btn-success b-rad-none requestModal" v-if="arrangementExist" data-type="shippingComplete">Port Arrival</div>
<div class="btn btn-sm btn-warning text-black b-rad-none requestModal" v-if="arrangementExist" data-type="rescheduleShipping">Reschedule Shipping</div>
<modal-component type="shippingArrangement" v-if="!arrangementExist">
<notification-component ref="notification"></notification-component>
<loading-component style="left: 0;" v-show="isLoading"></loading-component>
<div class="card card-default no-border">
<div class="card-block no-padding">
@@ -79,6 +80,7 @@
</div>
</modal-component>
<modal-component type="rescheduleShipping" v-if="arrangementExist">
<notification-component ref="notification"></notification-component>
<loading-component style="left: 0;" v-show="isLoading"></loading-component>
<div class="card card-default no-border">
<div class="card-block no-padding">
@@ -149,7 +151,8 @@
</template>
<script>
import moment from 'moment'
import moment from 'moment';
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -179,6 +182,7 @@
}
},
mounted: function() {
this.validateMethod();
this.dataValidation();
},
created(){
@@ -189,6 +193,11 @@
}
},
methods: {
validateMethod() {
$.validator.addMethod("minDate", function(value, element, params) {
return (moment(value, "DD-MM-YYYY") > moment(params, "DD-MM-YYYY"))
});
},
dataValidation() {
$(this.$el).find('.shippingForm').validate({
rules: {
@@ -199,7 +208,7 @@
},
messages: {
ETA: {
min : 'ETA must be greater than ETD'
minDate : 'ETA must be greater than ETD'
}
},
errorPlacement: function ( error, element ) {
@@ -227,7 +236,7 @@
},
messages: {
ETA: {
min : 'ETA must be greater than ETD'
minDate : 'ETA must be greater than ETD'
}
},
errorPlacement: function ( error, element ) {
@@ -252,7 +261,7 @@
$(this.$el).find('.shippingForm').valid();
this.shippingArrangement.schedule.ETD = date;
$(this.$el).find('.shippingForm .ETA').rules("add", {
min: moment(this.shippingArrangement.schedule.ETD, "DD-MM-YYYY").add(1, 'days').format('DD-MM-YYYY')
minDate: moment(this.shippingArrangement.schedule.ETD, "DD-MM-YYYY").add(1, 'days').format('DD-MM-YYYY')
})
}
@@ -269,7 +278,7 @@
$(this.$el).find('.rescheduleShipping').valid();
this.reschedule.ETD = date;
$(this.$el).find('.rescheduleShipping .ETA').rules("add", {
min: moment(this.reschedule.ETD, "DD-MM-YYYY").add(1, 'days').format('DD-MM-YYYY')
minDate: moment(this.reschedule.ETD, "DD-MM-YYYY").add(1, 'days').format('DD-MM-YYYY')
})
}
@@ -300,6 +309,12 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.SHIPPING_ARRANGEMENT.TITLE;
notification.message = notificationConstant.ORDER.SHIPPING_ARRANGEMENT.MESSAGE;
notification.execute();
$(this.$el).find('.shippingForm').parents('.modal').modal('hide')
@@ -323,6 +338,14 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.SHIPPING_ARRANGEMENT.RESCHEDULE.TITLE;
notification.message = notificationConstant.ORDER.SHIPPING_ARRANGEMENT.RESCHEDULE.MESSAGE;
notification.execute();
$(this.$el).find('.rescheduleShipping').parents('.modal').modal('hide')
Event.$emit('updateOrdersList', true);
@@ -344,6 +367,14 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.PORT_ARRIVAL.TITLE;
notification.message = notificationConstant.ORDER.PORT_ARRIVAL.MESSAGE;
notification.execute();
Event.$emit('updateOrdersList', true);
@@ -1,5 +1,6 @@
<template>
<div class="inline">
<notification-component ref="notification"></notification-component>
<div class="btn btn-sm btn-success b-rad-none requestModal" data-type="packed">Order Packed</div>
<confirm-modal-component
title="Order Packed"
@@ -11,6 +12,7 @@
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -36,6 +38,14 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.ORDER_PACKED.TITLE;
notification.message = notificationConstant.ORDER.ORDER_PACKED.MESSAGE;
notification.execute();
Event.$emit('updateOrdersList', true);
@@ -1,5 +1,6 @@
<template>
<div class="inline">
<notification-component ref="notification"></notification-component>
<div class="btn btn-sm btn-success b-rad-none requestModal" data-type="unpacked">Order Unpacked</div>
<confirm-modal-component
title="Order UnPacked"
@@ -11,6 +12,7 @@
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -36,6 +38,13 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.ORDER_UNPACKED.TITLE;
notification.message = notificationConstant.ORDER.ORDER_UNPACKED.MESSAGE;
notification.execute();
Event.$emit('updateOrdersList', true);
})
@@ -1,5 +1,6 @@
<template>
<div class="card card-default no-border">
<notification-component ref="notification"></notification-component>
<loading-component v-show="isLoading"></loading-component>
<div class="card-block no-padding">
<div class="row p-t-30">
@@ -47,6 +48,7 @@
</div>
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -105,6 +107,12 @@
//turn off loading animation
this.isLoading = false;
let notification = this.$refs.notification;
notification.title = notificationConstant.ORDER.ORDER_CREATED.TITLE;
notification.message = notificationConstant.ORDER.ORDER_CREATED.MESSAGE;
notification.execute();
$(this.$el).parents('.modal').modal('hide')
Event.$emit('updateOrdersList');
@@ -1,5 +1,6 @@
<template>
<div>
<div class="warehouseForm">
<notification-component ref="notification"></notification-component>
<loading-component v-show="isLoading"></loading-component>
<div class="row m-t-20" v-show="!isEdit">
<div class="col">
@@ -38,6 +39,7 @@
</div>
</template>
<script>
import notificationConstant from '../../../constant/notification';
export default {
props: {
'data': {
@@ -84,14 +86,23 @@
'content-type': 'application/json'
}
}).then((response) => {
let notification = this.$refs.notification;
if(!this.isEdit){
Event.$emit('updateWarehouseList');
this.clearForm();
notification.title = notificationConstant.WAREHOUSE.DETAILS_CREATED.TITLE;
notification.message = notificationConstant.WAREHOUSE.DETAILS_CREATED.MESSAGE;
}
else {
notification.title = notificationConstant.WAREHOUSE.DETAILS_CREATED.UPDATED.TITLE;
notification.message = notificationConstant.WAREHOUSE.DETAILS_CREATED.UPDATED.MESSAGE;
}
notification.execute();
//turn off loading animation
this.isLoading = false;
$('.modal').modal('hide');
this.collapseEdit();
})
},
+92
View File
@@ -0,0 +1,92 @@
export default Object.freeze({
ORDER: Object.freeze({
ORDER_CREATED: Object.freeze({
TITLE: 'Orders Created Successfully',
MESSAGE: 'Orders have been created successfully'
}),
ORDER_WAREHOUSE_CONFIRMED: Object.freeze({
TITLE: 'Warehouse Successfully confirmed',
MESSAGE: 'Warehouse have been confirmed successfully'
}),
PACKING_LIST_NOTIFICATION: Object.freeze({
TITLE: 'Packing list Successfully created',
MESSAGE: 'Packing list have been created',
UPDATE: Object.freeze({
TITLE: 'Packing list Successfully Updated',
MESSAGE: 'Packing list have been updated'
})
}),
ORDER_PACKED: Object.freeze({
TITLE: 'Order Successfully Packed',
MESSAGE: 'Order have been packed successfully'
}),
SHIPPING_ARRANGEMENT: Object.freeze({
TITLE: 'Shipping Arrangement Successfully Created',
MESSAGE: 'Shipping Arrangement have been created successfully',
RESCHEDULE: Object.freeze({
TITLE: 'Shipping Arrangement Successfully Rescheduled',
MESSAGE: 'Shipping Arrangement have been rescheduled successfully'
})
}),
PORT_ARRIVAL: Object.freeze({
TITLE: 'Port Arrival Successfully Confirmed',
MESSAGE: 'Port Arrival have been confirmed successfully'
}),
WAREHOUSE_ARRIVAL: Object.freeze({
TITLE: 'Warehouse Arrival Successfully Confirmed',
MESSAGE: 'Warehouse Arrival have been confirmed successfully'
}),
WAREHOUSE_RECEIVE: Object.freeze({
TITLE: 'Warehouse Received Confirmed',
MESSAGE: 'Warehouse Received have been confirmed'
}),
ORDER_UNPACKED: Object.freeze({
TITLE: 'Order Successfully Unpacked',
MESSAGE: 'Order have been unpacked successfully'
}),
OUT_FOR_DELIVERY: Object.freeze({
TITLE: 'Out For Delivery Successfully Confirmed',
MESSAGE: 'Out For Delivery have been confirmed successfully'
})
}),
IMPORTER: Object.freeze({
DETAILS: {
CREATED: {
TITLE: 'Created Successfully',
MESSAGE: "created successfully"
},
DETAILS_UPDATED: {
TITLE: "updated",
MESSAGE: "updated"
}
},
ADDRESS_BOOK: {
TITLE: null,
MESSAGE: null,
UPDATED: {
TITLE: null,
MESSAGE: null
}
},
}),
WAREHOUSE: Object.freeze({
DETAILS_CREATED: {
TITLE: 'Warehouse created',
MESSAGE: 'warehouse created',
UPDATED: Object.freeze({
TITLE: 'warehouse updated',
MESSAGE: 'warehouse updated'
})
},
CONTACT: {
CREATED: {
TITLE: 'new contact created',
MESSAGE: 'new contact created'
},
UPDATED: {
TITLE: 'Contact updated',
MESSAGE: 'Contact updated'
}
}
})
});