mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
large commit
This commit is contained in:
@@ -39,89 +39,4 @@ class Constants {
|
||||
public const ADDRESS_FIELDS = ['street_one', 'street_two', 'city', 'state', 'country', 'post_code'];
|
||||
|
||||
|
||||
public const ORDER_PROCESSING_STEP = 'PS_PROCESSING';
|
||||
public const ORDER_SHIPPING_STEP = 'PS_SHIPPING';
|
||||
public const ORDER_DELIVERY_STEP = 'PS_DELIVERY';
|
||||
|
||||
public const ORDER_MODULE_WAREHOUSE = 'WAREHOUSE';
|
||||
public const ORDER_WAREHOUSE_RECEIVING_STEP = 'MS_WAREHOUSE_RECEIVING';
|
||||
public const ORDER_WAREHOUSE_PACKING_STEP = 'MS_WAREHOUSE_PACKING';
|
||||
public const ORDER_WAREHOUSE_ARRIVAL_STEP = 'MS_WAREHOUSE_ARRIVAL';
|
||||
public const ORDER_WAREHOUSE_UNPACKING_STEP = 'MS_WAREHOUSE_UNPACKING';
|
||||
|
||||
public const ORDER_MODULE_NO_WAREHOUSE = 'NO_WAREHOUSE';
|
||||
public const ORDER_NO_WAREHOUSE_PENDING_SUPPLIER = 'MS_NO_WAREHOUSE_PENDING_SUPPLIER';
|
||||
|
||||
public const ORDER_PRIMARY_STEPS = [
|
||||
Constants::ORDER_PROCESSING_STEP => [
|
||||
'initial_name' => 'processing order',
|
||||
'final_name' => 'order confirmed',
|
||||
'description' => 'Order created and pending confirmation',
|
||||
'sequence' => 0
|
||||
],
|
||||
Constants::ORDER_SHIPPING_STEP => [
|
||||
'initial_name' => 'shipping',
|
||||
'final_name' => 'shipped out',
|
||||
'description' => 'Order is Loaded to Container, waiting for Shipment',
|
||||
'sequence' => 1
|
||||
],
|
||||
Constants::ORDER_DELIVERY_STEP => [
|
||||
'initial_name' => 'delivery',
|
||||
'final_name' => 'Received',
|
||||
'description' => 'Order out for delivery soon',
|
||||
'sequence' => 2
|
||||
],
|
||||
];
|
||||
|
||||
public const ORDER_MODULAR_STEPS = [
|
||||
Constants::ORDER_MODULE_WAREHOUSE => [
|
||||
'china_warehouse' => [
|
||||
'previous' => Constants::ORDER_PROCESSING_STEP,
|
||||
'next' => Constants::ORDER_SHIPPING_STEP,
|
||||
'steps' => [
|
||||
Constants::ORDER_WAREHOUSE_RECEIVING_STEP => [
|
||||
'initial_name' => 'pending supplier',
|
||||
'final_name' => 'arrived at warehouse',
|
||||
'description' => 'Waiting for supplier to deliver order to warehouse'
|
||||
],
|
||||
Constants::ORDER_WAREHOUSE_PACKING_STEP => [
|
||||
'initial_name' => 'packing',
|
||||
'final_name' => 'packed',
|
||||
'description' => 'Packing order into shipping container'
|
||||
]
|
||||
]
|
||||
],
|
||||
'malaysia_warehouse' => [
|
||||
'previous' => Constants::ORDER_SHIPPING_STEP,
|
||||
'next' => Constants::ORDER_DELIVERY_STEP,
|
||||
'steps' => [
|
||||
Constants::ORDER_WAREHOUSE_ARRIVAL_STEP => [
|
||||
'initial_name' => 'pending arrival',
|
||||
'final_name' => 'arrived at warehouse',
|
||||
'description' => 'Waiting for order\'s arrival & custom clearance'
|
||||
],
|
||||
Constants::ORDER_WAREHOUSE_UNPACKING_STEP => [
|
||||
'initial_name' => 'unpacking',
|
||||
'final_name' => 'unpacked',
|
||||
'description' => 'Unpacking order from shipping container'
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
Constants::ORDER_MODULE_NO_WAREHOUSE => [
|
||||
'pending_arrival' => [
|
||||
'previous' => Constants::ORDER_PROCESSING_STEP,
|
||||
'next' => Constants::ORDER_SHIPPING_STEP,
|
||||
'steps' => [
|
||||
Constants::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER => [
|
||||
'initial_name' => 'pending supplier',
|
||||
'final_name' => 'supplier packed order',
|
||||
'description' => 'Waiting for supplier to pack order for shipping'
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
]
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Billing\Services;
|
||||
|
||||
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Models\Order;
|
||||
|
||||
class CreatesShippingInvoice
|
||||
{
|
||||
|
||||
|
||||
public function execute($orderId){
|
||||
|
||||
$order = order::findOrFail($orderId);
|
||||
|
||||
$orderObject = new orderObject($order->marking, $order->company_id, $order->forwarder_id, $order->warehouse_id);
|
||||
|
||||
/** @var float $totalCBM */
|
||||
$totalCBM = GetsOrderTotalCBM($orderId);
|
||||
|
||||
/** @var Object() [(string)state, (bool)outstation] $delivertAddress */
|
||||
$delivertAddressObject = GetDeliveryAddress($orderId);
|
||||
|
||||
$forwarderSettings = getsForwarderSettings($orderObject->getForwarderId());
|
||||
|
||||
$servicesArray = [];
|
||||
|
||||
((($forwarderSettings->ShippingRate +
|
||||
getsCustomerRate($orderObject->getCompanyId(), $orderObject->getForwarderId()) +
|
||||
getsLocationRate($delivertAddressObject, $orderObject->getForwarderId())) * $totalCBM) + GetServices($servicesArray)) * $forwarderSettings->ServiceFee;
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Classes\Modules\ControllerLogic\Contacts;
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
|
||||
use App\Classes\Modules\Contacts\Exceptions\CannotCreateContactException;
|
||||
use App\Classes\Modules\Contacts\Services\CreatesContact;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateContactLogic
|
||||
|
||||
+2
-5
@@ -7,7 +7,6 @@ use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
|
||||
use App\Classes\Modules\Contacts\Services\CreatesContact;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\DeliveryArrangementObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\ScheduleObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\TrackingNumberObject;
|
||||
use App\Classes\Modules\Orders\Services\Attachments\UpdatesDeliveryArrangement;
|
||||
@@ -59,10 +58,8 @@ class UpdateDeliveryArrangementLogic
|
||||
|
||||
try {
|
||||
|
||||
$orderObject = new OrderObject($orderId);
|
||||
|
||||
$deliveryArrangementObject = new DeliveryArrangementObject($request->input('type'), $request->input('vehicle_no'));
|
||||
$arrangementId = $this->updatesDeliveryArrangement->execute($orderObject, $deliveryArrangementObject);
|
||||
$arrangementId = $this->updatesDeliveryArrangement->execute($orderId, $deliveryArrangementObject);
|
||||
|
||||
$scheduleObject = new ScheduleObject($request->input('schedule')['ETA'], $request->input('schedule')['ETD'], 1, $request->input('schedule')['remark']);
|
||||
|
||||
@@ -78,7 +75,7 @@ class UpdateDeliveryArrangementLogic
|
||||
|
||||
if($deliveryArrangementObject->getType() === 1){
|
||||
$trackingNumberObject = new TrackingNumberObject(1, $request->input('tracking_number'), $request->input('courier'));
|
||||
$this->updatesTrackingNumber->execute($orderObject, $trackingNumberObject);
|
||||
$this->updatesTrackingNumber->execute($orderId, $trackingNumberObject);
|
||||
}
|
||||
|
||||
return new JsonResponse(null, HttpStatus::RESOURCE_CREATED);
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\ControllersLogic\Orders\Attachments;
|
||||
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\PackingListObject;
|
||||
use App\Classes\Modules\Orders\Services\Attachments\UpdatesPackages;
|
||||
use App\Classes\Modules\Orders\Services\Attachments\UpdatesPackingList;
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
use App\Traits\ChecksIfPackingListIsComplete;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdatePackagesLogic
|
||||
{
|
||||
|
||||
use ChecksIfPackingListIsComplete;
|
||||
|
||||
/** @var UpdatesPackages */
|
||||
private $updatesPackages;
|
||||
|
||||
/**
|
||||
* UpdatePackagesLogic constructor.
|
||||
* @param UpdatesPackages $updatesPackages
|
||||
*/
|
||||
public function __construct(UpdatesPackages $updatesPackages)
|
||||
{
|
||||
$this->updatesPackages = $updatesPackages;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param String $orderId
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(String $orderId, Request $request){
|
||||
|
||||
try {
|
||||
|
||||
$this->updatesPackages->execute($orderId, $request->input('packages'));
|
||||
|
||||
return new JsonResponse(null, HttpStatus::RESOURCE_CREATED);
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new InternalServerErrorException("Failed to update order's packages because {$exception->getMessage()}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,13 +39,11 @@ class UpdatePackingListLogic
|
||||
|
||||
try {
|
||||
|
||||
$orderObject = new OrderObject($orderId);
|
||||
|
||||
$packingListObject = new PackingListObject($request->input('reference_no'), $request->input('packages'));
|
||||
|
||||
$confirmed = $this->checkPackingListIsComplete($packingListObject->getPackages());
|
||||
|
||||
$this->updatesPackingList->execute($orderObject, $packingListObject, $confirmed);
|
||||
$this->updatesPackingList->execute($orderId, $packingListObject, $confirmed);
|
||||
|
||||
return new JsonResponse(null, HttpStatus::RESOURCE_CREATED);
|
||||
|
||||
|
||||
+1
-3
@@ -46,10 +46,8 @@ class UpdateShippingArrangementLogic
|
||||
|
||||
try {
|
||||
|
||||
$orderObject = new OrderObject($orderId);
|
||||
|
||||
$shippingArrangementObject = new ShippingArrangementObject($request->input('container_no'), $request->input('seal_no'));
|
||||
$arrangementId = $this->updatesShippingArrangement->execute($orderObject, $shippingArrangementObject);
|
||||
$arrangementId = $this->updatesShippingArrangement->execute($orderId, $shippingArrangementObject);
|
||||
|
||||
$scheduleObject = new ScheduleObject($request->input('schedule')['ETA'], $request->input('schedule')['ETD'], 0, $request->input('schedule')['remark']);
|
||||
|
||||
|
||||
+1
-3
@@ -34,10 +34,8 @@ class UpdateTrackingNumberLogic
|
||||
public function execute(String $orderId, Request $request){
|
||||
|
||||
try {
|
||||
|
||||
$orderObject = new OrderObject($orderId);
|
||||
$trackingNumberObject = new TrackingNumberObject($request->input('type'), $request->input('tracking_number'), $request->input('courier'));
|
||||
$this->updatesTrackingNumber->execute($orderObject, $trackingNumberObject);
|
||||
$this->updatesTrackingNumber->execute($orderId, $trackingNumberObject);
|
||||
|
||||
return new JsonResponse(null, HttpStatus::RESOURCE_CREATED);
|
||||
|
||||
|
||||
@@ -6,6 +6,10 @@ use App\Classes\Modules\Accounts\Exceptions\CannotCreateOrderException;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\Services\CreatesOrder;
|
||||
use App\Classes\Modules\Orders\Services\Steps\UpdatesOrderSteps;
|
||||
use App\Classes\Modules\Orders\Services\UpdatesOrderWarehouse;
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateOrderLogic
|
||||
@@ -14,13 +18,23 @@ class CreateOrderLogic
|
||||
/** @var CreatesOrder */
|
||||
private $createOrder;
|
||||
|
||||
/** @var UpdatesOrderWarehouse */
|
||||
private $updatesOrderWarehouse;
|
||||
|
||||
/** @var UpdatesOrderSteps */
|
||||
private $updateOrderSteps;
|
||||
|
||||
/**
|
||||
* CreateOrderLogic constructor.
|
||||
* @param CreatesOrder $createOrder
|
||||
* @param UpdatesOrderWarehouse $updatesOrderWarehouse
|
||||
* @param UpdatesOrderSteps $updateOrderSteps
|
||||
*/
|
||||
public function __construct(CreatesOrder $createOrder)
|
||||
public function __construct(CreatesOrder $createOrder, UpdatesOrderWarehouse $updatesOrderWarehouse, UpdatesOrderSteps $updateOrderSteps)
|
||||
{
|
||||
$this->createOrder = $createOrder;
|
||||
$this->updatesOrderWarehouse = $updatesOrderWarehouse;
|
||||
$this->updateOrderSteps = $updateOrderSteps;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,13 +43,22 @@ class CreateOrderLogic
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @throws InternalServerErrorException
|
||||
* @throws \App\Classes\Modules\Accounts\Exceptions\CannotUpdateOrderWarehouseException
|
||||
*/
|
||||
public function execute(int $companyId, Request $request) {
|
||||
try {
|
||||
|
||||
$order = new OrderObject($request->input('marking'), $companyId);
|
||||
$order = new OrderObject($request->input('marking'), $companyId, 1);
|
||||
|
||||
return $this->createOrder->execute($order);
|
||||
/** @var int $orderId */
|
||||
$orderId = $this->createOrder->execute($order);
|
||||
|
||||
$this->updatesOrderWarehouse->execute($orderId, $request->input('warehouse_id'), 0);
|
||||
$this->updatesOrderWarehouse->execute($orderId, $request->input('warehouse_id'), 1);
|
||||
|
||||
$this->updateOrderSteps->execute($orderId, $request);
|
||||
|
||||
return new JsonResponse(null, HttpStatus::REQUEST_ACCEPTED);
|
||||
|
||||
} catch (CannotCreateOrderException $exception){
|
||||
throw new InternalServerErrorException("Failed to create order because {$exception->getMessage()}");
|
||||
|
||||
@@ -2,21 +2,20 @@
|
||||
|
||||
namespace App\Classes\Modules\ControllersLogic\Orders;
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\TrackingNumberObject;
|
||||
use App\Classes\Modules\Orders\Services\Attachments\UpdatesTrackingNumber;
|
||||
use App\Classes\Modules\Orders\Services\SetsOrderWarehouse;
|
||||
use App\Classes\Modules\Orders\Services\UpdatesOrderWarehouse;
|
||||
use App\Classes\Modules\Orders\Services\Steps\UpdatesStepCompleteDate;
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateReceiveNoteLogic
|
||||
{
|
||||
/** @var SetsOrderWarehouse */
|
||||
/** @var UpdatesOrderWarehouse */
|
||||
private $setsOrderWarehouse;
|
||||
|
||||
/** @var UpdatesStepCompleteDate */
|
||||
@@ -27,11 +26,11 @@ class UpdateReceiveNoteLogic
|
||||
|
||||
/**
|
||||
* UpdateReceiveNoteLogic constructor.
|
||||
* @param SetsOrderWarehouse $setsOrderWarehouse
|
||||
* @param UpdatesOrderWarehouse $setsOrderWarehouse
|
||||
* @param UpdatesStepCompleteDate $updatesStepCompleteDate
|
||||
* @param UpdatesTrackingNumber $updatesTrackingNumber
|
||||
*/
|
||||
public function __construct(SetsOrderWarehouse $setsOrderWarehouse, UpdatesStepCompleteDate $updatesStepCompleteDate, UpdatesTrackingNumber $updatesTrackingNumber)
|
||||
public function __construct(UpdatesOrderWarehouse $setsOrderWarehouse, UpdatesStepCompleteDate $updatesStepCompleteDate, UpdatesTrackingNumber $updatesTrackingNumber)
|
||||
{
|
||||
$this->setsOrderWarehouse = $setsOrderWarehouse;
|
||||
$this->updatesStepCompleteDate = $updatesStepCompleteDate;
|
||||
@@ -49,28 +48,20 @@ class UpdateReceiveNoteLogic
|
||||
|
||||
try{
|
||||
|
||||
$orderObject = new OrderObject($orderId, null, $request->input('warehouse_id'));
|
||||
$stepObject = new StepObject(Constants::ORDER_WAREHOUSE_RECEIVING_STEP, $request->input('complete_date'));
|
||||
$stepObject = new StepObject(OrderSteps::ORDER_WAREHOUSE_RECEIVING_STEP, $request->input('complete_date'));
|
||||
|
||||
$this->setsOrderWarehouse->execute($orderObject);
|
||||
$this->setsOrderWarehouse->execute($orderId, $request->input('warehouse_id'), 0);
|
||||
$this->setsOrderWarehouse->execute($orderId, $request->input('warehouse_id'), 2);
|
||||
$this->updatesStepCompleteDate->execute($orderId, $stepObject);
|
||||
|
||||
$trackingNumberObject = new TrackingNumberObject(0, $request->input('tracking_number'));
|
||||
$this->updatesTrackingNumber->execute($orderObject, $trackingNumberObject);
|
||||
$this->updatesTrackingNumber->execute($orderId, $trackingNumberObject);
|
||||
|
||||
return new JsonResponse([], HttpStatus::RESOURCE_CREATED);
|
||||
|
||||
}catch(\Exception $exception) {
|
||||
throw new InternalServerErrorException("Failed to update order's receive note because {$exception->getMessage()}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,8 +3,7 @@
|
||||
namespace App\Classes\Modules\ControllersLogic\Orders;
|
||||
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\Services\SetsOrderWarehouse;
|
||||
use App\Classes\Modules\Orders\Services\UpdatesOrderWarehouse;
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -12,16 +11,16 @@ use Illuminate\Http\Request;
|
||||
class UpdateWarehouseLogic
|
||||
{
|
||||
|
||||
/** @var SetsOrderWarehouse */
|
||||
private $setsOrderWarehouse;
|
||||
/** @var UpdatesOrderWarehouse */
|
||||
private $updatesOrderWarehouse;
|
||||
|
||||
/**
|
||||
* UpdateWarehouseLogic constructor.
|
||||
* @param SetsOrderWarehouse $setsOrderWarehouse
|
||||
* @param UpdatesOrderWarehouse $updatesOrderWarehouse
|
||||
*/
|
||||
public function __construct(SetsOrderWarehouse $setsOrderWarehouse)
|
||||
public function __construct(UpdatesOrderWarehouse $updatesOrderWarehouse)
|
||||
{
|
||||
$this->setsOrderWarehouse = $setsOrderWarehouse;
|
||||
$this->updatesOrderWarehouse = $updatesOrderWarehouse;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,11 +33,9 @@ class UpdateWarehouseLogic
|
||||
|
||||
try {
|
||||
|
||||
$order = new OrderObject($orderId);
|
||||
|
||||
$order->setWarehouseId($request->input('warehouse_id'));
|
||||
|
||||
$this->setsOrderWarehouse->execute($order);
|
||||
$this->updatesOrderWarehouse->execute($orderId, $request->input('warehouse_id'), 0);
|
||||
$this->updatesOrderWarehouse->execute($orderId, $request->input('warehouse_id'), 1);
|
||||
|
||||
return new JsonResponse(null, HttpStatus::REQUEST_ACCEPTED);
|
||||
|
||||
|
||||
@@ -7,43 +7,56 @@ class OrderObject
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
private $orderId;
|
||||
private $marking;
|
||||
|
||||
/** @var int|null */
|
||||
/** @var int */
|
||||
private $companyId;
|
||||
|
||||
/** @var int */
|
||||
private $forwarderId;
|
||||
|
||||
/** @var int|null */
|
||||
private $warehouseId;
|
||||
|
||||
/**
|
||||
* OrderObject constructor.
|
||||
* @param string $orderId
|
||||
* @param int|null $companyId
|
||||
* @param string $marking
|
||||
* @param int $companyId
|
||||
* @param int $forwarderId
|
||||
* @param int|null $warehouseId
|
||||
*/
|
||||
public function __construct(string $orderId, ?int $companyId = null, ?int $warehouseId = null)
|
||||
public function __construct(string $marking, int $companyId, int $forwarderId, ?int $warehouseId = null)
|
||||
{
|
||||
$this->orderId = $orderId;
|
||||
$this->marking = $marking;
|
||||
$this->companyId = $companyId;
|
||||
$this->forwarderId = $forwarderId;
|
||||
$this->warehouseId = $warehouseId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getOrderId(): string
|
||||
public function getMarking(): string
|
||||
{
|
||||
return $this->orderId;
|
||||
return $this->marking;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getCompanyId(): ?int
|
||||
public function getCompanyId(): int
|
||||
{
|
||||
return $this->companyId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getForwarderId(): int
|
||||
{
|
||||
return $this->forwarderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
|
||||
@@ -17,19 +17,19 @@ abstract class AbstractStepProcessor
|
||||
abstract function execute(): JsonResponse;
|
||||
|
||||
/**
|
||||
* @param OrderObject $order
|
||||
* @param int $orderId
|
||||
* @param StepObject $step
|
||||
* @return JsonResponse
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function handler(OrderObject $order, StepObject $step) {
|
||||
public function handler(int $orderId, StepObject $step) {
|
||||
try {
|
||||
|
||||
if(!$this->validator()){
|
||||
return new JsonResponse(['message' => 'Updating step validation has failed due to missing requirements'], HttpStatus::VALIDATION_FAILED);
|
||||
}
|
||||
|
||||
(new CompletesOrderStep())->execute($order, $step);
|
||||
(new CompletesOrderStep())->execute($orderId, $step);
|
||||
|
||||
/** notification */
|
||||
|
||||
|
||||
@@ -3,21 +3,20 @@
|
||||
namespace App\Classes\Modules\Orders\Processors;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\Modules\Orders\Services\Steps\GenerateOrderSteps;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class ConfirmsOrder extends AbstractStepProcessor
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
const STEP_REFERENCE = Constants::ORDER_PROCESSING_STEP;
|
||||
const STEP_REFERENCE = OrderSteps::ORDER_PROCESSING_STEP;
|
||||
|
||||
/** @var OrderObject */
|
||||
private $order;
|
||||
/** @var int */
|
||||
private $orderId;
|
||||
|
||||
/** @var StepObject */
|
||||
private $step;
|
||||
@@ -29,7 +28,7 @@ class ConfirmsOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function __construct(int $orderId, string $completeDate = null)
|
||||
{
|
||||
$this->order = new OrderObject($orderId);
|
||||
$this->orderId = $orderId;
|
||||
$this->step = new StepObject(self::STEP_REFERENCE, $completeDate);
|
||||
|
||||
}
|
||||
@@ -49,9 +48,9 @@ class ConfirmsOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function execute(): JsonResponse {
|
||||
|
||||
(new generateOrderSteps())->execute($this->order);
|
||||
(new generateOrderSteps())->execute($this->orderId);
|
||||
|
||||
return $this->handler($this->order, $this->step);
|
||||
return $this->handler($this->orderId, $this->step);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,10 +3,9 @@
|
||||
namespace App\Classes\Modules\Orders\Processors;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use App\Models\DeliveryArrangement;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -14,23 +13,22 @@ class DeliverOrder extends AbstractStepProcessor
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
const STEP_REFERENCE = Constants::ORDER_DELIVERY_STEP;
|
||||
const STEP_REFERENCE = OrderSteps::ORDER_DELIVERY_STEP;
|
||||
|
||||
/** @var OrderObject */
|
||||
private $order;
|
||||
/** @var int */
|
||||
private $orderId;
|
||||
|
||||
/** @var StepObject */
|
||||
private $step;
|
||||
|
||||
|
||||
/**
|
||||
* DeliverOrder constructor.
|
||||
* WarehousePackOrder constructor.
|
||||
* @param int $orderId
|
||||
* @param string $completeDate
|
||||
*/
|
||||
public function __construct(int $orderId, string $completeDate = null)
|
||||
{
|
||||
$this->order = new OrderObject($orderId);
|
||||
$this->orderId = $orderId;
|
||||
$this->step = new StepObject(self::STEP_REFERENCE, $completeDate);
|
||||
|
||||
}
|
||||
@@ -39,7 +37,7 @@ class DeliverOrder extends AbstractStepProcessor
|
||||
* @return bool
|
||||
*/
|
||||
public function validator(): bool {
|
||||
if(!DeliveryArrangement::where('order_id', $this->order->getOrderId())->exists()) {
|
||||
if(!DeliveryArrangement::where('order_id', $this->orderId)->exists()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,7 +50,7 @@ class DeliverOrder extends AbstractStepProcessor
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(): JsonResponse {
|
||||
return $this->handler($this->order, $this->step);
|
||||
return $this->handler($this->orderId, $this->step);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,10 +3,9 @@
|
||||
namespace App\Classes\Modules\Orders\Processors;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use App\Models\ShippingArrangement;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -14,10 +13,10 @@ class ShipOrder extends AbstractStepProcessor
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
const STEP_REFERENCE = Constants::ORDER_SHIPPING_STEP;
|
||||
const STEP_REFERENCE = OrderSteps::ORDER_SHIPPING_STEP;
|
||||
|
||||
/** @var OrderObject */
|
||||
private $order;
|
||||
/** @var int */
|
||||
private $orderId;
|
||||
|
||||
/** @var StepObject */
|
||||
private $step;
|
||||
@@ -29,17 +28,18 @@ class ShipOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function __construct(int $orderId, string $completeDate = null)
|
||||
{
|
||||
$this->order = new OrderObject($orderId);
|
||||
$this->orderId = $orderId;
|
||||
$this->step = new StepObject(self::STEP_REFERENCE, $completeDate);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function validator(): bool {
|
||||
|
||||
if(!ShippingArrangement::where('order_id', $this->order->getOrderId())->exists()) {
|
||||
if(!ShippingArrangement::where('order_id', $this->orderId)->exists()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class ShipOrder extends AbstractStepProcessor
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(): JsonResponse {
|
||||
return $this->handler($this->order, $this->step);
|
||||
return $this->handler($this->orderId, $this->step);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,20 +3,19 @@
|
||||
namespace App\Classes\Modules\Orders\Processors;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class WarehouseArrivalOrder extends AbstractStepProcessor
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
const STEP_REFERENCE = Constants::ORDER_WAREHOUSE_ARRIVAL_STEP;
|
||||
const STEP_REFERENCE = OrderSteps::ORDER_WAREHOUSE_ARRIVAL_STEP;
|
||||
|
||||
/** @var OrderObject */
|
||||
private $order;
|
||||
/** @var int */
|
||||
private $orderId;
|
||||
|
||||
/** @var StepObject */
|
||||
private $step;
|
||||
@@ -28,7 +27,7 @@ class WarehouseArrivalOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function __construct(int $orderId, string $completeDate = null)
|
||||
{
|
||||
$this->order = new OrderObject($orderId);
|
||||
$this->orderId = $orderId;
|
||||
$this->step = new StepObject(self::STEP_REFERENCE, $completeDate);
|
||||
|
||||
}
|
||||
@@ -46,7 +45,7 @@ class WarehouseArrivalOrder extends AbstractStepProcessor
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(): JsonResponse {
|
||||
return $this->handler($this->order, $this->step);
|
||||
return $this->handler($this->orderId, $this->step);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
namespace App\Classes\Modules\Orders\Processors;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use App\Models\PackingList;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -14,10 +13,10 @@ class WarehousePackOrder extends AbstractStepProcessor
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
const STEP_REFERENCE = Constants::ORDER_WAREHOUSE_PACKING_STEP;
|
||||
const STEP_REFERENCE = OrderSteps::ORDER_WAREHOUSE_PACKING_STEP;
|
||||
|
||||
/** @var OrderObject */
|
||||
private $order;
|
||||
/** @var int */
|
||||
private $orderId;
|
||||
|
||||
/** @var StepObject */
|
||||
private $step;
|
||||
@@ -29,7 +28,7 @@ class WarehousePackOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function __construct(int $orderId, string $completeDate = null)
|
||||
{
|
||||
$this->order = new OrderObject($orderId);
|
||||
$this->orderId = $orderId;
|
||||
$this->step = new StepObject(self::STEP_REFERENCE, $completeDate);
|
||||
|
||||
}
|
||||
@@ -39,7 +38,7 @@ class WarehousePackOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function validator(): bool {
|
||||
|
||||
$packingList = PackingList::where('order_id', $this->order->getOrderId())->first();
|
||||
$packingList = PackingList::where('order_id', $this->orderId)->first();
|
||||
|
||||
if(!$packingList->confirmed) {
|
||||
return false;
|
||||
@@ -55,7 +54,7 @@ class WarehousePackOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function execute(): JsonResponse {
|
||||
|
||||
return $this->handler($this->order, $this->step);
|
||||
return $this->handler($this->orderId, $this->step);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,20 +3,19 @@
|
||||
namespace App\Classes\Modules\Orders\Processors;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class WarehouseReceivesOrder extends AbstractStepProcessor
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
const STEP_REFERENCE = Constants::ORDER_WAREHOUSE_RECEIVING_STEP;
|
||||
const STEP_REFERENCE = OrderSteps::ORDER_WAREHOUSE_RECEIVING_STEP;
|
||||
|
||||
/** @var OrderObject */
|
||||
private $order;
|
||||
/** @var int */
|
||||
private $orderId;
|
||||
|
||||
/** @var StepObject */
|
||||
private $step;
|
||||
@@ -28,7 +27,7 @@ class WarehouseReceivesOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function __construct(int $orderId, string $completeDate = null)
|
||||
{
|
||||
$this->order = new OrderObject($orderId);
|
||||
$this->orderId = $orderId;
|
||||
$this->step = new StepObject(self::STEP_REFERENCE, $completeDate);
|
||||
|
||||
}
|
||||
@@ -46,7 +45,7 @@ class WarehouseReceivesOrder extends AbstractStepProcessor
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(): JsonResponse {
|
||||
return $this->handler($this->order, $this->step);
|
||||
return $this->handler($this->orderId, $this->step);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,20 +3,19 @@
|
||||
namespace App\Classes\Modules\Orders\Processors;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class WarehouseUnpackingOrder extends AbstractStepProcessor
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
const STEP_REFERENCE = Constants::ORDER_WAREHOUSE_UNPACKING_STEP;
|
||||
const STEP_REFERENCE = OrderSteps::ORDER_WAREHOUSE_UNPACKING_STEP;
|
||||
|
||||
/** @var OrderObject */
|
||||
private $order;
|
||||
/** @var int */
|
||||
private $orderId;
|
||||
|
||||
/** @var StepObject */
|
||||
private $step;
|
||||
@@ -28,7 +27,7 @@ class WarehouseUnpackingOrder extends AbstractStepProcessor
|
||||
*/
|
||||
public function __construct(int $orderId, string $completeDate = null)
|
||||
{
|
||||
$this->order = new OrderObject($orderId);
|
||||
$this->orderId = $orderId;
|
||||
$this->step = new StepObject(self::STEP_REFERENCE, $completeDate);
|
||||
|
||||
}
|
||||
@@ -46,7 +45,7 @@ class WarehouseUnpackingOrder extends AbstractStepProcessor
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(): JsonResponse {
|
||||
return $this->handler($this->order, $this->step);
|
||||
return $this->handler($this->orderId, $this->step);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,8 +23,13 @@ class UpdatesDeliveryArrangement
|
||||
}
|
||||
|
||||
|
||||
public function execute(OrderObject $order, DeliveryArrangementObject $arrangement){
|
||||
$arrangement = $this->repository->updateOrCreate(['order_id' => $order->getOrderId()],
|
||||
/**
|
||||
* @param int $orderId
|
||||
* @param DeliveryArrangementObject $arrangement
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute(int $orderId, DeliveryArrangementObject $arrangement){
|
||||
$arrangement = $this->repository->updateOrCreate(['order_id' => $orderId],
|
||||
['type' => $arrangement->getType(), 'vehicle_no' => $arrangement->getVehicleNumber()]);
|
||||
|
||||
return $arrangement->id;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Orders\Services\Attachments;
|
||||
|
||||
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\PackingListObject;
|
||||
use App\Models\Order;
|
||||
use App\Models\Package;
|
||||
use App\Models\PackingList;
|
||||
|
||||
class UpdatesPackages
|
||||
{
|
||||
|
||||
/** @var Package */
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* UpdatesPackages constructor.
|
||||
* @param Package $repository
|
||||
*/
|
||||
public function __construct(Package $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
|
||||
public function execute(int $orderId, array $packages){
|
||||
/** @var Order $order */
|
||||
$order = Order::findOrFail($orderId);
|
||||
$order->packages()->delete();
|
||||
$order->packages()->createMany($packages);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,9 +23,9 @@ class UpdatesPackingList
|
||||
}
|
||||
|
||||
|
||||
public function execute(OrderObject $orderObject, PackingListObject $packingListObject, bool $confirmed){
|
||||
public function execute(int $orderId, PackingListObject $packingListObject, bool $confirmed){
|
||||
|
||||
$packingList = $this->repository->updateOrCreate(['order_id' => $orderObject->getOrderId()],
|
||||
$packingList = $this->repository->updateOrCreate(['order_id' => $orderId],
|
||||
[
|
||||
'reference_no' => $packingListObject->getReferenceId(),
|
||||
'confirmed' => $confirmed
|
||||
|
||||
@@ -22,8 +22,8 @@ class UpdatesShippingArrangement
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function execute(OrderObject $order, ShippingArrangementObject $arrangement){
|
||||
$arrangement = $this->repository->updateOrCreate(['order_id' => $order->getOrderId()],
|
||||
public function execute(int $orderId, ShippingArrangementObject $arrangement){
|
||||
$arrangement = $this->repository->updateOrCreate(['order_id' => $orderId],
|
||||
['container_no' => $arrangement->getContainerNumber(), 'seal_no' => $arrangement->getSealNumber()]);
|
||||
|
||||
return $arrangement->id;
|
||||
|
||||
@@ -23,9 +23,12 @@ class UpdatesTrackingNumber
|
||||
}
|
||||
|
||||
|
||||
public function execute(OrderObject $orderObject, TrackingNumberObject $trackingNumberObject){
|
||||
|
||||
$this->repository->updateOrCreate(['order_id' => $orderObject->getOrderId(), 'type' => $trackingNumberObject->getType()],
|
||||
/**
|
||||
* @param int $orderId
|
||||
* @param TrackingNumberObject $trackingNumberObject
|
||||
*/
|
||||
public function execute(int $orderId, TrackingNumberObject $trackingNumberObject){
|
||||
$this->repository->updateOrCreate(['order_id' => $orderId, 'type' => $trackingNumberObject->getType()],
|
||||
[
|
||||
'tracking_no' => $trackingNumberObject->getTrackingNumber(),
|
||||
'courier' => $trackingNumberObject->getCourier()
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
namespace App\Classes\Modules\Orders\Services;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\Accounts\Exceptions\CannotCreateOrderException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
use App\Models\AddressBook;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use App\Models\Company;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -34,22 +34,23 @@ class CreatesOrder
|
||||
public function execute(OrderObject $order) {
|
||||
|
||||
try {
|
||||
|
||||
$address = AddressBook::where('company_id', $order->getCompanyId())
|
||||
->where('default', true)->first();
|
||||
$address = Company::findOrFail($order->getCompanyId())->addressBook()->where('default', true)->first();
|
||||
// $address = AddressBook::where('company_id', $order->getCompanyId())
|
||||
// ->where('default', true)->first();
|
||||
|
||||
if(!$address){
|
||||
return new JsonResponse(['message' => 'Failed to create order because import\'s delivery address wasn\'t found'], HttpStatus::RESOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
$this->repository->company_id = $order->getCompanyId();
|
||||
$this->repository->marking = $order->getOrderId();
|
||||
$this->repository->marking = $order->getMarking();
|
||||
$this->repository->forwarder_id = $order->getForwarderId();
|
||||
$this->repository->address_id = $address->id;
|
||||
$this->repository->current_step = Constants::ORDER_PROCESSING_STEP;
|
||||
$this->repository->current_step = OrderSteps::ORDER_PROCESSING_STEP;
|
||||
|
||||
$this->repository->save();
|
||||
|
||||
return new JsonResponse(null, HttpStatus::RESOURCE_CREATED);
|
||||
return $this->repository->id;
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new CannotCreateOrderException($exception->getMessage());
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
namespace App\Classes\Modules\Orders\Services;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use App\Models\Order;
|
||||
use App\Models\OrderWarehouse;
|
||||
use App\Models\Schedule;
|
||||
use App\Models\Warehouse;
|
||||
use Carbon\Carbon;
|
||||
@@ -37,46 +38,47 @@ class ListsOrderHistory
|
||||
foreach ($orderSteps as $step){
|
||||
$completeDate = Carbon::parse($step->complete_date)->format('d-m-Y');
|
||||
switch ($step->reference_id){
|
||||
case Constants::ORDER_PROCESSING_STEP:
|
||||
case OrderSteps::ORDER_PROCESSING_STEP:
|
||||
if($order->warehouse_id){
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => Warehouse::where('id', $order->warehouse_id)->first()->name.' confirmed as your order\'s warehouse']);
|
||||
}
|
||||
break;
|
||||
case Constants::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER:
|
||||
case OrderSteps::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER:
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Your Order has been loaded into container']);
|
||||
break;
|
||||
case Constants::ORDER_WAREHOUSE_RECEIVING_STEP:
|
||||
$warehouse = Warehouse::where('id', $order->warehouse_id)->first();
|
||||
case OrderSteps::ORDER_WAREHOUSE_RECEIVING_STEP:
|
||||
$warehouseId = OrderWarehouse::where('order_id', $order->id)->where('type', 0)->first()->pluck('warehouse_id');
|
||||
$warehouse = Warehouse::where('id', $warehouseId)->first();
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Arrived at '. $warehouse->name .' warehouse in china']);
|
||||
break;
|
||||
case Constants::ORDER_WAREHOUSE_PACKING_STEP:
|
||||
case OrderSteps::ORDER_WAREHOUSE_PACKING_STEP:
|
||||
$packages = $order->packingLists()->firstOrFail()->packages()->selectRaw(DB::raw('((width/100) * (height/100) * (length/100)) * quantity as cbm, quantity'))->get();
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => '['.$packages->sum('quantity').' Packages, '.number_format((float)$packages->sum('cbm'), 2, '.', '').' CBM] Your order has been loaded into container']);
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Invoice has been issued, waiting for shipping payment']);
|
||||
break;
|
||||
case Constants::ORDER_SHIPPING_STEP:
|
||||
case OrderSteps::ORDER_SHIPPING_STEP:
|
||||
$this->shippingArrangment($order);
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Arrived to Malaysian port']);
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Custom clearance is successful']);
|
||||
break;
|
||||
case Constants::ORDER_WAREHOUSE_ARRIVAL_STEP:
|
||||
case OrderSteps::ORDER_WAREHOUSE_ARRIVAL_STEP:
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Arrived at Malaysia\'s warehouse']);
|
||||
break;
|
||||
case Constants::ORDER_WAREHOUSE_UNPACKING_STEP:
|
||||
case OrderSteps::ORDER_WAREHOUSE_UNPACKING_STEP:
|
||||
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Your Order has been unloaded and being prepared for delivery']);
|
||||
break;
|
||||
case Constants::ORDER_DELIVERY_STEP:
|
||||
case OrderSteps::ORDER_DELIVERY_STEP:
|
||||
$this->deliveryArrangment($order);
|
||||
$this->history->push(['type' => 2, 'date' => $completeDate, 'description' => 'Your Order has successfully been delivered']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($order->current_step === Constants::ORDER_SHIPPING_STEP){
|
||||
if($order->current_step === OrderSteps::ORDER_SHIPPING_STEP){
|
||||
$this->shippingArrangment($order);
|
||||
}
|
||||
|
||||
if($order->current_step === Constants::ORDER_DELIVERY_STEP){
|
||||
if($order->current_step === OrderSteps::ORDER_DELIVERY_STEP){
|
||||
$this->deliveryArrangment($order);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Orders\Services;
|
||||
|
||||
|
||||
use App\Classes\Modules\Accounts\Exceptions\CannotUpdateOrderWarehouseException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Models\Order;
|
||||
|
||||
class SetsOrderWarehouse
|
||||
{
|
||||
|
||||
/** @var Order */
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* SetsOrderWarehouse constructor.
|
||||
* @param Order $repository
|
||||
*/
|
||||
public function __construct(Order $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param OrderObject $order
|
||||
* @throws CannotUpdateOrderWarehouseException
|
||||
*/
|
||||
public function execute(OrderObject $order){
|
||||
try {
|
||||
/** @var Order $orderRepository */
|
||||
$orderRepository = $this->repository->findOrFail($order->getOrderId());
|
||||
$orderRepository->warehouse_id = $order->getWarehouseId();
|
||||
$orderRepository->save();
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new CannotUpdateOrderWarehouseException($exception->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,13 +10,13 @@ use App\Models\Order;
|
||||
class CompletesOrderStep {
|
||||
|
||||
/**
|
||||
* @param OrderObject $order
|
||||
* @param int $orderId
|
||||
* @param StepObject $step
|
||||
*/
|
||||
public function execute(OrderObject $order, StepObject $step){
|
||||
public function execute(int $orderId, StepObject $step){
|
||||
|
||||
/** @var Order $repository */
|
||||
$repository = Order::findOrFail($order->getOrderId());
|
||||
$repository = Order::findOrFail($orderId);
|
||||
|
||||
$orderStep = $repository->orderSteps()->where('reference_id', $step->getReferenceId())->firstOrFail();
|
||||
|
||||
@@ -24,7 +24,7 @@ class CompletesOrderStep {
|
||||
$orderStep->complete_date = $step->getCompleteDate();
|
||||
|
||||
if($orderStep->save()){
|
||||
(new UpdatesOrderCurrentStep())->execute($order,$step);
|
||||
(new UpdatesOrderCurrentStep())->execute($orderId, $step);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,16 +22,16 @@ class CreatesOrderSteps
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OrderObject $order
|
||||
* @param int $orderId
|
||||
* @param array $orderSteps
|
||||
* @throws CannotCreateOrderStepsException
|
||||
*/
|
||||
public function execute(OrderObject $order, array $orderSteps){
|
||||
public function execute(int $orderId, array $orderSteps){
|
||||
|
||||
try {
|
||||
|
||||
/** @var Order $repository */
|
||||
$repository = $this->repository->findOrFail($order->getOrderId());
|
||||
$repository = $this->repository->findOrFail($orderId);
|
||||
|
||||
$repository->orderSteps()->delete();
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
namespace App\Classes\Modules\Orders\Services\Steps;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Objects\Orders\OrderStepObject;
|
||||
use App\Models\ModularStep;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use App\Models\Order;
|
||||
use App\Models\PrimaryStep;
|
||||
use App\Models\OrderWarehouse;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class GenerateOrderSteps
|
||||
@@ -36,47 +34,45 @@ class GenerateOrderSteps
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OrderObject $order
|
||||
* @param int $orderId
|
||||
* @throws \App\Classes\Modules\Accounts\Exceptions\CannotCreateOrderStepsException
|
||||
*/
|
||||
public function execute(OrderObject $order){
|
||||
public function execute(int $orderId){
|
||||
$this->primarySteps(array_merge(OrderSteps::ORDER_PRIMARY_STEPS, OrderSteps::ORDER_PRIMARY_MODULAR_STEPS));
|
||||
$this->modularSteps([OrderWarehouse::where('order_id', $orderId)->get()->isEmpty() ? OrderSteps::ORDER_MODULE_NO_WAREHOUSE : OrderSteps::ORDER_MODULE_WAREHOUSE]);
|
||||
|
||||
$orderSteps = $this->getSteps([$this->repository->findOrFail($order->getOrderId())->pluck('warehouse_id') ? Constants::ORDER_MODULE_WAREHOUSE : Constants::ORDER_MODULE_NO_WAREHOUSE]);
|
||||
$orderSteps = $this->steps->sortBy('sequence');
|
||||
|
||||
$this->createsOrderSteps->execute($order, $orderSteps->toArray());
|
||||
$this->createsOrderSteps->execute($orderId, $orderSteps->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $modules
|
||||
* @return Collection
|
||||
*/
|
||||
public function getSteps(array $modules): Collection
|
||||
{
|
||||
$this->primarySteps();
|
||||
$this->modularSteps($modules);
|
||||
return $this->steps->sortBy('sequence');
|
||||
}
|
||||
|
||||
public function modularSteps(array $modules){
|
||||
$modularSteps = ModularStep::with('moduleGroups.steps')->whereIn('reference_id', $modules)->get();
|
||||
foreach ($modularSteps as $module){
|
||||
foreach($module->moduleGroups as $group){
|
||||
foreach ($modules as $module){
|
||||
foreach(OrderSteps::ORDER_MODULAR_STEPS[$module] as $group){
|
||||
$i = 0;
|
||||
foreach ($group->steps as $step){
|
||||
foreach ($group['steps'] as $reference_id => $step){
|
||||
$i++;
|
||||
$sequence = Constants::ORDER_PRIMARY_STEPS[$group->previous]['sequence'] + ($i/10);
|
||||
$this->addSteps((new OrderStepObject(false, $step->reference_id, $sequence)));
|
||||
if(array_key_exists($group['previous'], OrderSteps::ORDER_PRIMARY_STEPS)){
|
||||
$sequence = OrderSteps::ORDER_PRIMARY_STEPS[$group['previous']]['sequence'] + ($i/10);
|
||||
}
|
||||
|
||||
if(array_key_exists($group['previous'], OrderSteps::ORDER_PRIMARY_MODULAR_STEPS)){
|
||||
$sequence = OrderSteps::ORDER_PRIMARY_MODULAR_STEPS[$group['previous']]['sequence'] + ($i/10);
|
||||
}
|
||||
|
||||
$this->addSteps((new OrderStepObject(false, $reference_id, $sequence)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function primarySteps(){
|
||||
PrimaryStep::all()->map(function ($step){
|
||||
private function primarySteps($array){
|
||||
array_walk($array, function($step, $reference_id){
|
||||
$this->addSteps((new OrderStepObject(
|
||||
true,
|
||||
$step->reference_id,
|
||||
Constants::ORDER_PRIMARY_STEPS[$step->reference_id]['sequence'])));
|
||||
$reference_id,
|
||||
$step['sequence'])));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,26 +2,25 @@
|
||||
|
||||
namespace App\Classes\Modules\Orders\Services\Steps;
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use App\Models\Order;
|
||||
use App\Models\OrderStep;
|
||||
|
||||
class UpdatesOrderCurrentStep
|
||||
{
|
||||
|
||||
public function execute(OrderObject $order, StepObject $step){
|
||||
public function execute(int $orderId, StepObject $step){
|
||||
|
||||
$orderStep = OrderStep::where('order_id', $order->getOrderId())
|
||||
$orderStep = OrderStep::where('order_id', $orderId)
|
||||
->where('complete', 0)->orderBy('sequence')->first();
|
||||
|
||||
$nextStep = $orderStep ? $orderStep->reference_id : null;
|
||||
|
||||
$repository = order::findOrFail($order->getOrderId());
|
||||
$repository = order::findOrFail($orderId);
|
||||
$repository->current_step = $nextStep;
|
||||
|
||||
if($nextStep === null && $step !== Constants::ORDER_PROCESSING_STEP){
|
||||
if($nextStep === null && $step !== OrderSteps::ORDER_PROCESSING_STEP){
|
||||
$repository->complete = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Orders\Services;
|
||||
|
||||
|
||||
use App\Classes\Modules\Accounts\Exceptions\CannotUpdateOrderWarehouseException;
|
||||
use App\Models\OrderWarehouse;
|
||||
|
||||
class UpdatesOrderWarehouse
|
||||
{
|
||||
|
||||
/** @var OrderWarehouse */
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* SetsOrderWarehouse constructor.
|
||||
* @param OrderWarehouse $repository
|
||||
*/
|
||||
public function __construct(OrderWarehouse $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $orderId
|
||||
* @param $warehouseId
|
||||
* @param $type
|
||||
* @throws CannotUpdateOrderWarehouseException
|
||||
*/
|
||||
public function execute(int $orderId, $warehouseId, $type){
|
||||
try {
|
||||
$this->repository->updateOrCreate(['order_id' => $orderId, 'type' =>$type], ['warehouse_id' => $warehouseId]);
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new CannotUpdateOrderWarehouseException($exception->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,18 +2,26 @@
|
||||
|
||||
namespace App\Classes\Modules\Steps;
|
||||
|
||||
use App\Http\Resources\Step as StepResource;
|
||||
use App\Models\PrimaryStep;
|
||||
use App\Models\Step;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
|
||||
class GetStep
|
||||
{
|
||||
public function execute($referenceId){
|
||||
$step = PrimaryStep::where('reference_id', $referenceId)->first();
|
||||
if($step){
|
||||
return new StepResource($step);
|
||||
if(array_key_exists($referenceId, OrderSteps::ORDER_PRIMARY_STEPS)){
|
||||
return OrderSteps::ORDER_PRIMARY_STEPS[$referenceId];
|
||||
}
|
||||
|
||||
if(array_key_exists($referenceId, OrderSteps::ORDER_PRIMARY_MODULAR_STEPS)){
|
||||
return OrderSteps::ORDER_PRIMARY_MODULAR_STEPS[$referenceId];
|
||||
}
|
||||
|
||||
foreach(OrderSteps::ORDER_MODULAR_STEPS as $module){
|
||||
foreach($module as $group){
|
||||
if(array_key_exists($referenceId, $group['steps'])){
|
||||
return $group['steps'][$referenceId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new StepResource(Step::where('reference_id', $referenceId)->first());
|
||||
}
|
||||
}
|
||||
@@ -2,23 +2,23 @@
|
||||
|
||||
namespace App\Classes\Modules\Steps;
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Http\Resources\PackingList as PackingListResource;
|
||||
use App\Classes\ValueObjects\Constants\OrderSteps;
|
||||
use App\Http\Resources\Package as PackageResource;
|
||||
use App\Http\Resources\ShippingArrangement as ShippingArrangementResource;
|
||||
use App\Http\Resources\DeliveryArrangement as DeliveryArrangementResource;
|
||||
use App\Models\DeliveryArrangement;
|
||||
use App\Models\PackingList;
|
||||
use App\Models\Package;
|
||||
use App\Models\ShippingArrangement;
|
||||
|
||||
class StepAttachments
|
||||
{
|
||||
public function execute($order_id, $referenceId){
|
||||
switch ($referenceId) {
|
||||
case Constants::ORDER_WAREHOUSE_PACKING_STEP:
|
||||
return new PackingListResource(PackingList::where('order_id', $order_id)->first());
|
||||
case Constants::ORDER_SHIPPING_STEP:
|
||||
case OrderSteps::ORDER_WAREHOUSE_PACKING_STEP:
|
||||
return PackageResource::collection(Package::where('order_id', $order_id)->get());
|
||||
case OrderSteps::ORDER_SHIPPING_STEP:
|
||||
return new ShippingArrangementResource(ShippingArrangement::where('order_id', $order_id)->first());
|
||||
case Constants::ORDER_DELIVERY_STEP:
|
||||
case OrderSteps::ORDER_DELIVERY_STEP:
|
||||
return new DeliveryArrangementResource(DeliveryArrangement::where('order_id', $order_id)->first());
|
||||
default:
|
||||
return null;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Classes\ValueObjects\Constants;
|
||||
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\Orders\Processors\ConfirmsOrder;
|
||||
use App\Classes\Modules\Orders\Processors\DeliverOrder;
|
||||
use App\Classes\Modules\Orders\Processors\ShipOrder;
|
||||
@@ -21,21 +20,110 @@ class OrderSteps
|
||||
public const COMPANY_COMPLETE_CATEGORY = 'complete';
|
||||
public const COMPANY_CANCEL_CATEGORY = 'cancel';
|
||||
|
||||
public const ORDER_PROCESSING_STEP = 'PS_PROCESSING';
|
||||
public const ORDER_SHIPPING_STEP = 'PS_SHIPPING';
|
||||
public const ORDER_DELIVERY_STEP = 'PS_DELIVERY';
|
||||
|
||||
public const ORDER_MODULE_WAREHOUSE = 'WAREHOUSE';
|
||||
public const ORDER_WAREHOUSE_RECEIVING_STEP = 'MS_WAREHOUSE_RECEIVING';
|
||||
public const ORDER_WAREHOUSE_PACKING_STEP = 'MS_WAREHOUSE_PACKING';
|
||||
public const ORDER_WAREHOUSE_ARRIVAL_STEP = 'MS_WAREHOUSE_ARRIVAL';
|
||||
public const ORDER_WAREHOUSE_UNPACKING_STEP = 'MS_WAREHOUSE_UNPACKING';
|
||||
|
||||
public const ORDER_MODULE_NO_WAREHOUSE = 'NO_WAREHOUSE';
|
||||
public const ORDER_NO_WAREHOUSE_PENDING_SUPPLIER = 'MS_NO_WAREHOUSE_PENDING_SUPPLIER';
|
||||
|
||||
|
||||
public const ORDER_PRIMARY_STEPS = [
|
||||
OrderSteps::ORDER_PROCESSING_STEP => [
|
||||
'initial_name' => 'processing order',
|
||||
'final_name' => 'order confirmed',
|
||||
'description' => 'Order created and pending confirmation',
|
||||
'sequence' => 0
|
||||
]
|
||||
];
|
||||
|
||||
public const ORDER_PRIMARY_MODULAR_STEPS = [
|
||||
OrderSteps::ORDER_SHIPPING_STEP => [
|
||||
'initial_name' => 'shipping',
|
||||
'final_name' => 'shipped out',
|
||||
'description' => 'Order is Loaded to Container, waiting for Shipment',
|
||||
'sequence' => 1
|
||||
],
|
||||
OrderSteps::ORDER_DELIVERY_STEP => [
|
||||
'initial_name' => 'delivery',
|
||||
'final_name' => 'Received',
|
||||
'description' => 'Order out for delivery soon',
|
||||
'sequence' => 2
|
||||
],
|
||||
];
|
||||
|
||||
public const ORDER_MODULAR_STEPS = [
|
||||
OrderSteps::ORDER_MODULE_WAREHOUSE => [
|
||||
'china_warehouse' => [
|
||||
'previous' => OrderSteps::ORDER_PROCESSING_STEP,
|
||||
'next' => OrderSteps::ORDER_SHIPPING_STEP,
|
||||
'steps' => [
|
||||
OrderSteps::ORDER_WAREHOUSE_RECEIVING_STEP => [
|
||||
'initial_name' => 'pending supplier',
|
||||
'final_name' => 'arrived at warehouse',
|
||||
'description' => 'Waiting for supplier to deliver order to warehouse'
|
||||
],
|
||||
OrderSteps::ORDER_WAREHOUSE_PACKING_STEP => [
|
||||
'initial_name' => 'packing',
|
||||
'final_name' => 'packed',
|
||||
'description' => 'Packing order into shipping container'
|
||||
]
|
||||
]
|
||||
],
|
||||
'malaysia_warehouse' => [
|
||||
'previous' => OrderSteps::ORDER_SHIPPING_STEP,
|
||||
'next' => OrderSteps::ORDER_DELIVERY_STEP,
|
||||
'steps' => [
|
||||
OrderSteps::ORDER_WAREHOUSE_ARRIVAL_STEP => [
|
||||
'initial_name' => 'pending arrival',
|
||||
'final_name' => 'arrived at warehouse',
|
||||
'description' => 'Waiting for order\'s arrival & custom clearance'
|
||||
],
|
||||
OrderSteps::ORDER_WAREHOUSE_UNPACKING_STEP => [
|
||||
'initial_name' => 'unpacking',
|
||||
'final_name' => 'unpacked',
|
||||
'description' => 'Unpacking order from shipping container'
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
OrderSteps::ORDER_MODULE_NO_WAREHOUSE => [
|
||||
'pending_arrival' => [
|
||||
'previous' => OrderSteps::ORDER_PROCESSING_STEP,
|
||||
'next' => OrderSteps::ORDER_SHIPPING_STEP,
|
||||
'steps' => [
|
||||
OrderSteps::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER => [
|
||||
'initial_name' => 'pending supplier',
|
||||
'final_name' => 'supplier packed order',
|
||||
'description' => 'Waiting for supplier to pack order for shipping'
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
],
|
||||
];
|
||||
|
||||
public const COMPANY_ORDER_PROCESSING = [
|
||||
Constants::ORDER_PROCESSING_STEP,
|
||||
Constants::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER,
|
||||
Constants::ORDER_WAREHOUSE_RECEIVING_STEP
|
||||
OrderSteps::ORDER_PROCESSING_STEP,
|
||||
OrderSteps::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER,
|
||||
OrderSteps::ORDER_WAREHOUSE_RECEIVING_STEP
|
||||
];
|
||||
|
||||
public const COMPANY_ORDER_SHIPPING = [
|
||||
Constants::ORDER_WAREHOUSE_PACKING_STEP,
|
||||
Constants::ORDER_SHIPPING_STEP
|
||||
OrderSteps::ORDER_WAREHOUSE_PACKING_STEP,
|
||||
OrderSteps::ORDER_SHIPPING_STEP
|
||||
];
|
||||
|
||||
public const COMPANY_ORDER_RECEIVING = [
|
||||
Constants::ORDER_WAREHOUSE_ARRIVAL_STEP,
|
||||
Constants::ORDER_WAREHOUSE_UNPACKING_STEP,
|
||||
Constants::ORDER_DELIVERY_STEP
|
||||
OrderSteps::ORDER_WAREHOUSE_ARRIVAL_STEP,
|
||||
OrderSteps::ORDER_WAREHOUSE_UNPACKING_STEP,
|
||||
OrderSteps::ORDER_DELIVERY_STEP
|
||||
|
||||
];
|
||||
|
||||
@@ -45,28 +133,28 @@ class OrderSteps
|
||||
public const WAREHOUSE_CANCEL_CATEGORY = 'cancel';
|
||||
|
||||
public const WAREHOUSE_ORDER_RECEIVING = [
|
||||
Constants::ORDER_WAREHOUSE_RECEIVING_STEP
|
||||
OrderSteps::ORDER_WAREHOUSE_RECEIVING_STEP
|
||||
];
|
||||
|
||||
public const WAREHOUSE_ORDER_SHIPPING = [
|
||||
Constants::ORDER_WAREHOUSE_PACKING_STEP,
|
||||
Constants::ORDER_SHIPPING_STEP,
|
||||
OrderSteps::ORDER_WAREHOUSE_PACKING_STEP,
|
||||
OrderSteps::ORDER_SHIPPING_STEP,
|
||||
];
|
||||
|
||||
public const WAREHOUSE_ORDER_COMPLETE = [
|
||||
Constants::ORDER_WAREHOUSE_ARRIVAL_STEP,
|
||||
Constants::ORDER_WAREHOUSE_UNPACKING_STEP,
|
||||
Constants::ORDER_DELIVERY_STEP
|
||||
OrderSteps::ORDER_WAREHOUSE_ARRIVAL_STEP,
|
||||
OrderSteps::ORDER_WAREHOUSE_UNPACKING_STEP,
|
||||
OrderSteps::ORDER_DELIVERY_STEP
|
||||
];
|
||||
|
||||
public const STEP_PROCESSOR = [
|
||||
Constants::ORDER_PROCESSING_STEP => ConfirmsOrder::class,
|
||||
Constants::ORDER_WAREHOUSE_RECEIVING_STEP => WarehouseReceivesOrder::class,
|
||||
Constants::ORDER_WAREHOUSE_PACKING_STEP => WarehousePackOrder::class,
|
||||
Constants::ORDER_SHIPPING_STEP => ShipOrder::class,
|
||||
Constants::ORDER_WAREHOUSE_ARRIVAL_STEP => WarehouseArrivalOrder::class,
|
||||
Constants::ORDER_WAREHOUSE_UNPACKING_STEP => WarehouseUnpackingOrder::class,
|
||||
Constants::ORDER_DELIVERY_STEP => DeliverOrder::class,
|
||||
OrderSteps::ORDER_PROCESSING_STEP => ConfirmsOrder::class,
|
||||
OrderSteps::ORDER_WAREHOUSE_RECEIVING_STEP => WarehouseReceivesOrder::class,
|
||||
OrderSteps::ORDER_WAREHOUSE_PACKING_STEP => WarehousePackOrder::class,
|
||||
OrderSteps::ORDER_SHIPPING_STEP => ShipOrder::class,
|
||||
OrderSteps::ORDER_WAREHOUSE_ARRIVAL_STEP => WarehouseArrivalOrder::class,
|
||||
OrderSteps::ORDER_WAREHOUSE_UNPACKING_STEP => WarehouseUnpackingOrder::class,
|
||||
OrderSteps::ORDER_DELIVERY_STEP => DeliverOrder::class,
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Orders\Attachments;
|
||||
|
||||
use App\Classes\Modules\ControllersLogic\Orders\Attachments\UpdatePackagesLogic;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdatePackagesController
|
||||
{
|
||||
/**
|
||||
* @param String $orderId
|
||||
* @param Request $request
|
||||
* @param UpdatePackagesLogic $logic
|
||||
* @throws \App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException
|
||||
*/
|
||||
public function update(String $orderId, Request $request , UpdatePackagesLogic $logic){
|
||||
$logic->execute($orderId, $request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,11 +2,8 @@
|
||||
|
||||
namespace App\Http\Controllers\Orders;
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\TrackingNumberObject;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
||||
use App\Classes\Modules\Orders\Processors\WarehouseReceivesOrder;
|
||||
use App\Classes\Modules\Orders\Services\Attachments\UpdatesTrackingNumber;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -23,10 +20,9 @@ class BulkReceiveNotesController
|
||||
|
||||
try{
|
||||
foreach ($request->input('orders') as $note){
|
||||
$orderObject = new OrderObject($note['id']);
|
||||
|
||||
$trackingNumberObject = new TrackingNumberObject(0, $note['tracking_number']);
|
||||
$updatesTrackingNumber->execute($orderObject, $trackingNumberObject);
|
||||
$updatesTrackingNumber->execute($note['id'], $trackingNumberObject);
|
||||
|
||||
(new WarehouseReceivesOrder($note['id'], $request->input('receive_date')))->execute();
|
||||
}
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
namespace App\Http\Controllers\Orders;
|
||||
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\PackingListObject;
|
||||
use App\Models\AddressBook;
|
||||
use App\Models\Company;
|
||||
use App\Models\CustomIssues;
|
||||
use App\Models\Order;
|
||||
use App\Models\PackingList;
|
||||
use App\Models\ShippingArrangement;
|
||||
use Barryvdh\DomPDF\PDF;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -15,6 +18,18 @@ use App\Http\Resources\Order as OrderResource;
|
||||
class OrderController extends Controller
|
||||
{
|
||||
|
||||
/** @var PDF */
|
||||
private $pdf;
|
||||
|
||||
/**
|
||||
* TestController constructor.
|
||||
* @param PDF $pdf
|
||||
*/
|
||||
public function __construct(PDF $pdf)
|
||||
{
|
||||
$this->pdf = $pdf;
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
$order = order::findOrFail($id);
|
||||
return new OrderResource($order);
|
||||
@@ -55,5 +70,19 @@ class OrderController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function download(String $orderId, String $type){
|
||||
$order = order::findOrFail($orderId);
|
||||
return view('pages.pdf.qr', [
|
||||
'order' => $order,
|
||||
'company' => Company::findOrFail($order->company_id),
|
||||
'delivery_address' => AddressBook::where('id', $order->address_id)->first()
|
||||
]);
|
||||
|
||||
return $this->pdf->setOptions(['isHtml5ParserEnabled' => true, 'isRemoteEnabled' => true])->loadView('pages.pdf.qr', [
|
||||
'order' => $order,
|
||||
'company' => Company::findOrFail($order->company_id),
|
||||
'delivery_address' => AddressBook::where('id', $order->address_id)->first()
|
||||
])->stream();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Classes\ControllersLogic\Companies\AddressBook\UpdateAddress;
|
||||
use App\Classes\Modules\AddressBook\DataTransferObjects\AddressBookObject;
|
||||
use App\Classes\Modules\AddressBook\Services\CreatesAddress;
|
||||
use App\Models\Company;
|
||||
use Barryvdh\DomPDF\PDF;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -15,21 +15,27 @@ use App\Classes\Excel\Import\CompaniesImport;
|
||||
class TestController extends Controller
|
||||
{
|
||||
|
||||
/** @var PDF */
|
||||
private $pdf;
|
||||
/** @var CreatesAddress */
|
||||
private $createsAddress;
|
||||
|
||||
/**
|
||||
* TestController constructor.
|
||||
* @param PDF $pdf
|
||||
* @param CreatesAddress $createsAddress
|
||||
*/
|
||||
public function __construct(CreatesAddress $createsAddress)
|
||||
public function __construct(PDF $pdf, CreatesAddress $createsAddress)
|
||||
{
|
||||
$this->pdf = $pdf;
|
||||
$this->createsAddress = $createsAddress;
|
||||
}
|
||||
|
||||
|
||||
public function index(Request $request){
|
||||
dd(Company::find(1)->contacts()->get());
|
||||
// return view('pages.pdf.qr');
|
||||
return $this->pdf->loadView('pages.pdf.qr')->stream();
|
||||
|
||||
$companiesImport = Excel::toArray(new CompaniesImport(), $request->file('xsl'));
|
||||
$companies = new Collection();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class Company extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$billing = AddressBook::where('company_id', $this->id)
|
||||
$billing = $this->addressBook()->where('reference_id', $this->id)->where('type', 1)
|
||||
->where('billing', true)->first();
|
||||
$reports = \App\Models\Order::select(DB::raw('count(*) total'), DB::raw('SUM(CASE WHEN complete = 0 THEN 0 ELSE 1 END) active'))->where('company_id', $this->id)->first();
|
||||
return [
|
||||
|
||||
@@ -7,12 +7,13 @@ use App\Classes\Modules\Steps\GetStep;
|
||||
use App\Classes\Modules\Steps\StepAttachments;
|
||||
use App\Models\OrderStep;
|
||||
use App\Http\Resources\OrderStep as OrderStepResource;
|
||||
use App\Models\OrderWarehouse;
|
||||
use App\Models\TrackingNumber;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use App\Models\AddressBook as AddressBookModel;
|
||||
use App\Models\DeliveryArrangement as DeliveryArrangementModel;
|
||||
use App\Models\PackingList as PackingListModel;
|
||||
use App\Models\Package as PackagesModel;
|
||||
use App\Models\ShippingArrangement as ShippingArrangementModel;
|
||||
use App\Models\Warehouse as WarehouseModel;
|
||||
use App\Models\Company as CompanyModel;
|
||||
@@ -27,7 +28,8 @@ class Order extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$warehouse = $this->warehouse_id ? WarehouseModel::where('id', $this->warehouse_id)->first() : null;
|
||||
$warehouseId = OrderWarehouse::where('order_id', $this->id)->where('type', 0)->pluck('warehouse_id');
|
||||
$warehouse = $warehouseId ? WarehouseModel::where('id', $warehouseId)->first() : null;
|
||||
$receiveDate = OrderStep::where('order_id', $this->id)->where('reference_id', 'MS_WAREHOUSE_RECEIVING')->pluck('complete_date')->first();
|
||||
return [
|
||||
'id' => $this->id,
|
||||
@@ -40,6 +42,7 @@ class Order extends JsonResource
|
||||
'complete' => (int)$this->complete,
|
||||
'date' => $this->created_at->format('d/m/Y'),
|
||||
'current_step' => [
|
||||
'reference_id' => $this->current_step,
|
||||
'details' => (new GetStep())->execute($this->current_step),
|
||||
'attachments' => (new StepAttachments())->execute($this->id, $this->current_step)
|
||||
],
|
||||
@@ -50,8 +53,8 @@ class Order extends JsonResource
|
||||
'tracking_number' => TrackingNumber::Where('order_id', $this->id)->where('type', 0)->pluck('tracking_no')->first(),
|
||||
'receive_date' => $receiveDate ? Carbon::parse($receiveDate)->format('d-m-Y') : null
|
||||
],
|
||||
'packing_list' => new PackingList(PackingListModel::where('order_id', $this->id)->first()),
|
||||
'shipping_arrangement' => new ShippingArrangement(ShippingArrangementModel::where('order_id', $this->id)->first()),
|
||||
'packages' => Package::collection(PackagesModel::where('order_id', $this->id)->get()),
|
||||
'shipping_arrangement' => [],
|
||||
'delivery_arrangement' => new DeliveryArrangement(DeliveryArrangementModel::where('order_id', $this->id)->first())
|
||||
];
|
||||
}
|
||||
|
||||
@@ -7,11 +7,21 @@ class AddressBook extends AbstractModel
|
||||
protected $table = 'address_book';
|
||||
|
||||
protected $fillable = [
|
||||
'company_id', 'reference', 'contact', 'street_one', 'street_two', 'city', 'state', 'post_code', 'country', 'default', 'billing'
|
||||
'type', 'reference_id', 'reference', 'contact', 'street_one', 'street_two', 'city', 'state', 'post_code', 'country', 'default', 'billing'
|
||||
];
|
||||
|
||||
public function forwarder()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Forwarder', 'id', 'reference_id')->where('type', '=', 0);
|
||||
}
|
||||
|
||||
public function company()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Company');
|
||||
return $this->belongsTo('App\Models\Company', 'id', 'reference_id')->where('type', '=', 1);
|
||||
}
|
||||
|
||||
public function warehouse()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Warehouse', 'id', 'reference_id')->where('type', '=', 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class Company extends AbstractModel
|
||||
|
||||
public function addressBook()
|
||||
{
|
||||
return $this->hasMany('App\Models\AddressBook');
|
||||
return $this->hasMany('App\Models\AddressBook', 'reference_id', 'id')->where('type', '=', 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,9 +7,14 @@ class Forwarder extends AbstractModel
|
||||
protected $table = 'forwarder';
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'email', 'street_one', 'street_two', 'city', 'state', 'post_code', 'country', 'shipping_rate','overdue_days','markup_percentage','minimum_cbm'
|
||||
'name', 'email', 'shipping_rate', 'markup_percentage','minimum_cbm'
|
||||
];
|
||||
|
||||
public function addressBook()
|
||||
{
|
||||
return $this->hasMany('App\Models\AddressBook', 'reference_id', 'id')->where('type', '=', 0);
|
||||
}
|
||||
|
||||
public function customerRelation()
|
||||
{
|
||||
return $this->hasMany(CustomerRelation::class, 'forwarder_id');
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Invoice extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class InvoiceDetail extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class Order extends AbstractModel
|
||||
protected $table = 'orders';
|
||||
|
||||
protected $fillable = [
|
||||
'company_id', 'marking', 'forwarder_id', 'supplier_id', 'warehouse_id', 'address_id', 'current_step', 'complete'
|
||||
'company_id', 'marking', 'forwarder_id', 'address_id', 'current_step', 'complete'
|
||||
];
|
||||
|
||||
public function orderSteps()
|
||||
@@ -20,9 +20,9 @@ class Order extends AbstractModel
|
||||
return $this->hasMany(OrderStep::class, 'order_id');
|
||||
}
|
||||
|
||||
public function packingLists()
|
||||
public function packages()
|
||||
{
|
||||
return $this->hasOne(PackingList::class, 'order_id');
|
||||
return $this->hasMany(Package::class, 'order_id');
|
||||
}
|
||||
|
||||
public function shippingArrangement()
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrderWarehouse extends Model
|
||||
{
|
||||
protected $table = 'order_warehouses';
|
||||
|
||||
protected $fillable = [
|
||||
'order_id', 'warehouse_id', 'type', 'outsources'
|
||||
];
|
||||
}
|
||||
@@ -8,7 +8,12 @@ class Warehouse extends AbstractModel
|
||||
protected $table = 'warehouses';
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'email', 'street_one', 'street_two', 'city', 'state', 'post_code', 'country'
|
||||
'name', 'email'
|
||||
];
|
||||
|
||||
public function addressBook()
|
||||
{
|
||||
return $this->hasMany('App\Models\AddressBook', 'reference_id', 'id')->where('type', '=', 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"rinvex/countries": "^5.0",
|
||||
"spatie/laravel-activitylog": "^3.1",
|
||||
"tightenco/ziggy": "v0.6.8.1"
|
||||
"tightenco/ziggy": "v0.6.8.1",
|
||||
"ext-imagick": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"beyondcode/laravel-dump-server": "^1.0",
|
||||
|
||||
+2
-1
@@ -147,7 +147,7 @@ return [
|
||||
Illuminate\Validation\ValidationServiceProvider::class,
|
||||
Illuminate\View\ViewServiceProvider::class,
|
||||
Tightenco\Ziggy\ZiggyServiceProvider::class,
|
||||
|
||||
Barryvdh\DomPDF\ServiceProvider::class,
|
||||
/*
|
||||
* Package Service Providers...
|
||||
*/
|
||||
@@ -210,6 +210,7 @@ return [
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'Constants' => App\Classes\Constants::class,
|
||||
'PDF' => Barryvdh\DomPDF\Facade::class,
|
||||
|
||||
],
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\AddressBook::class, function (Faker $faker) {
|
||||
return [
|
||||
'type' => 1,
|
||||
'reference' => $faker->firstName.' '.$faker->lastName,
|
||||
'contact' => $faker->phoneNumber,
|
||||
'street_one' => $faker->streetAddress,
|
||||
|
||||
@@ -6,10 +6,5 @@ $factory->define(App\Models\Warehouse::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->company,
|
||||
'email' => $faker->companyEmail,
|
||||
'street_one' => $faker->streetAddress,
|
||||
'city' => $faker->city,
|
||||
'state' => $faker->city,
|
||||
'post_code' => $faker->postcode,
|
||||
'country' => $faker->country
|
||||
];
|
||||
});
|
||||
|
||||
@@ -24,13 +24,13 @@ class CreateUserTable extends Migration
|
||||
$table->string('last_name', 60);
|
||||
$table->string('email')->unique();
|
||||
$table->string('password');
|
||||
$table->integer('verified')->nullable()->default(0);
|
||||
$table->integer('role_id');
|
||||
$table->boolean('verified')->default(0);
|
||||
$table->smallInteger('role_id');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
DB::table('users')->insert(
|
||||
DB::table('users')->insert([
|
||||
[
|
||||
'first_name' => 'Omair',
|
||||
'last_name' => 'Saleh',
|
||||
@@ -51,7 +51,7 @@ class CreateUserTable extends Migration
|
||||
'created_at' => \Carbon\Carbon::now(),
|
||||
'updated_at' => \Carbon\Carbon::now()
|
||||
]
|
||||
);
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,10 +18,8 @@ class CreateCompaniesTable extends Migration
|
||||
$table->string('name');
|
||||
$table->string('marking', 80)->unique();
|
||||
$table->string('email', 80)->nullable();
|
||||
$table->string('wechat_id', 80)->nullable();
|
||||
$table->string('registration_no', 25)->nullable();
|
||||
$table->string('tax_no', 25)->nullable();
|
||||
$table->double('rate')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ class CreateAddressBookTable extends Migration
|
||||
{
|
||||
Schema::create('address_book', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('company_id')->unsigned()->index();
|
||||
$table->integer('type');
|
||||
$table->integer('reference_id');
|
||||
$table->string('reference')->nullable();
|
||||
$table->string('contact', 25)->nullable();
|
||||
$table->string('street_one', 80)->nullable();
|
||||
@@ -24,11 +25,9 @@ class CreateAddressBookTable extends Migration
|
||||
$table->string('state', 50)->nullable();
|
||||
$table->string('post_code', 10)->nullable();
|
||||
$table->string('country')->nullable();
|
||||
$table->integer('default')->nullable()->default(0);
|
||||
$table->integer('billing')->nullable()->default(0);
|
||||
$table->boolean('default')->default(0);
|
||||
$table->boolean('billing')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('company_id')->references('id')->on('companies');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -16,11 +16,12 @@ class CreateContactsTable extends Migration
|
||||
Schema::create('contacts', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('type');
|
||||
$table->string('reference_id');
|
||||
$table->integer('reference_id');
|
||||
$table->string('name');
|
||||
$table->string('designation')->nullable();
|
||||
$table->string('contact');
|
||||
$table->string('contact')->nullable();
|
||||
$table->string('email')->nullable();
|
||||
$table->string('wechat_id', 80)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,12 +17,8 @@ class CreateWarehousesTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('email', 80)->nullable();
|
||||
$table->string('street_one', 80)->nullable();
|
||||
$table->string('street_two', 80)->nullable();
|
||||
$table->string('city', 50)->nullable();
|
||||
$table->string('state', 50)->nullable();
|
||||
$table->string('post_code', 10)->nullable();
|
||||
$table->string('country')->nullable();
|
||||
$table->decimal('rate', 13, 3)->unsigned()->default(0);
|
||||
$table->integer('hold_limit')->unsigned()->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,10 +17,9 @@ class CreateOrdersTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->integer('company_id')->unsigned()->index();
|
||||
$table->string('marking');
|
||||
$table->string('forwarder_id')->nullable();
|
||||
$table->string('supplier_id')->nullable();
|
||||
$table->string('warehouse_id')->nullable();
|
||||
$table->string('address_id');
|
||||
$table->integer('forwarder_id');
|
||||
$table->integer('address_id');
|
||||
$table->boolean('multiple_batch')->default(0);
|
||||
$table->string('current_step')->nullable();
|
||||
$table->boolean('complete')->default(0);
|
||||
$table->softDeletes();
|
||||
|
||||
@@ -16,12 +16,8 @@ class CreatePackingLists extends Migration
|
||||
{
|
||||
Schema::create('packing_lists', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('order_id')->unsigned()->index();
|
||||
$table->string('reference_no');
|
||||
$table->integer('confirmed')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePackingListPackagesTables extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('packing_list_packages_tables', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->integer('packing_list_id')->unsigned()->index();
|
||||
$table->integer('package_id')->unsigned()->index();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('packing_list_id')->references('id')->on('packing_lists');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('packing_list_packages_tables');
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ class CreatePackages extends Migration
|
||||
{
|
||||
Schema::create('packages', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('list_id')->unsigned()->index();
|
||||
$table->integer('order_id')->unsigned()->index();
|
||||
$table->integer('type')->default(0);
|
||||
$table->string('description')->nullable();
|
||||
$table->decimal('width', 7, 2);
|
||||
@@ -25,7 +25,7 @@ class CreatePackages extends Migration
|
||||
$table->integer('quantity');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('list_id')->references('id')->on('packing_lists');
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,15 @@ class CreateShippingArrangementsTable extends Migration
|
||||
{
|
||||
Schema::create('shipping_arrangements', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('order_id')->unsigned()->index();
|
||||
$table->integer('packing_list_id')->unsigned()->index();
|
||||
$table->integer('type')->default(0);
|
||||
$table->string('container_no');
|
||||
$table->string('seal_no');
|
||||
$table->date('shipped');
|
||||
$table->date('arrived');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
$table->foreign('packing_list_id')->references('id')->on('packing_lists');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -18,14 +18,7 @@ class CreateForwarderTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->string('name', 50);
|
||||
$table->string('email', 80)->nullable();
|
||||
$table->string('street_one', 80)->nullable();
|
||||
$table->string('street_two', 80)->nullable();
|
||||
$table->string('city', 50)->nullable();
|
||||
$table->string('state', 50)->nullable();
|
||||
$table->string('post_code', 10)->nullable();
|
||||
$table->string('country')->nullable();
|
||||
$table->decimal('shipping_rate', 7, 2)->default(0);
|
||||
$table->integer('overdue_days')->default(0);
|
||||
$table->decimal('markup_percentage', 7, 2)->default(0);
|
||||
$table->decimal('minimum_cbm', 5, 2)->default(0);
|
||||
$table->timestamps();
|
||||
@@ -34,20 +27,24 @@ class CreateForwarderTable extends Migration
|
||||
[
|
||||
'name' => 'CIEF Worldwide SDN BHD',
|
||||
'email' => 'infociefworldwide@gmail.com',
|
||||
'street_one' => 'Malaysian Global Innovation & Creativity Centre(MaGIC)',
|
||||
'street_two' => ' CWS Block, 3730, Persiaran Apec',
|
||||
'city' => 'Cyberjaya',
|
||||
'state' => 'Selangor',
|
||||
'post_code' => '63000',
|
||||
'country' => 'Malaysia',
|
||||
'shipping_rate' => '300',
|
||||
'overdue_days' => '0',
|
||||
'markup_percentage' => '0',
|
||||
'minimum_cbm' =>'0.3',
|
||||
'created_at' => \Carbon\Carbon::now(),
|
||||
'updated_at' => \Carbon\Carbon::now()
|
||||
]
|
||||
);
|
||||
|
||||
DB::table('address_book')->insert([
|
||||
'type' => 0,
|
||||
'reference_id' => 1,
|
||||
'street_one' => 'Malaysian Global Innovation & Creativity Centre(MaGIC)',
|
||||
'street_two' => ' CWS Block, 3730, Persiaran Apec',
|
||||
'city' => 'Cyberjaya',
|
||||
'state' => 'Selangor',
|
||||
'post_code' => '63000',
|
||||
'country' => 'Malaysia',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateServiceFeesTable extends Migration
|
||||
class CreateWarehouseServicesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -13,7 +13,7 @@ class CreateServiceFeesTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('service_fees', function (Blueprint $table) {
|
||||
Schema::create('warehouse_services', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->nullable();
|
||||
$table->integer('type')->nullable();
|
||||
@@ -15,10 +15,13 @@ class CreateCustomerRelationTable extends Migration
|
||||
{
|
||||
Schema::create('customer_relation', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('forwarder_id')->unsigned()->nullable();
|
||||
$table->integer('company_id')->unsigned()->nullable();
|
||||
$table->float('customer_rate')->default(0);
|
||||
$table->boolean('wave')->default(0);
|
||||
$table->integer('forwarder_id');
|
||||
$table->integer('company_id');
|
||||
$table->smallInteger('type', false, false);
|
||||
$table->decimal('customer_rate', 13, 3)->default(0);
|
||||
$table->decimal('credit_limit', 13, 3);
|
||||
$table->integer('term_limit')->default(0);
|
||||
$table->boolean('wave_minimum')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateInvoicesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('invoices', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('order_id')->unsigned()->index();
|
||||
$table->integer('company_id')->unsigned()->index();
|
||||
$table->decimal('currency', 13, 3);
|
||||
$table->decimal('total', 13, 3);
|
||||
$table->decimal('tax', 13, 3)->default(0);
|
||||
$table->date('due_date')->nullable();
|
||||
$table->decimal('total_paid', 13, 3);
|
||||
$table->boolean('status')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('invoices');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateInvoiceDetailsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('invoice_details', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('invoice_id')->unsigned()->index();
|
||||
$table->string('name', 60)->nullable();
|
||||
$table->string('description', 60)->nullable();
|
||||
$table->integer('quantity');
|
||||
$table->string('uom', 30)->nullable();
|
||||
$table->decimal('price', 13, 3)->nullable();
|
||||
$table->decimal('total', 13, 3)->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('invoice_id')->references('id')->on('invoices');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('invoice_details');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateOrderBatchesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('order_batches', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->integer('order_id')->unsigned()->index();
|
||||
$table->integer('supplier_id');
|
||||
$table->string('supplier_name');
|
||||
$table->boolean('received');
|
||||
$table->date('received_date');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('order_batches');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateOrderWarehousesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('order_warehouses', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->integer('order_id')->unsigned()->index();
|
||||
$table->integer('warehouse_id');
|
||||
$table->integer('type');
|
||||
$table->boolean('outsourced')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('order_warehouses');
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class DatabaseSeeder extends Seeder
|
||||
// $this->call(PackagesTableSeeder::class);
|
||||
}
|
||||
|
||||
$this->call(PrimaryStepsTableSeeder::class);
|
||||
$this->call(ModularStepsTableSeeder::class);
|
||||
// $this->call(PrimaryStepsTableSeeder::class);
|
||||
// $this->call(ModularStepsTableSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<div class="col-8">
|
||||
<div class="card no-border bg-transparent">
|
||||
<div class="tab-content bg-transparent p-l-0 p-r-0">
|
||||
<div class="tab-pane active" id="orders">
|
||||
@@ -168,6 +168,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,22 +1,42 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<notification-component ref="notification"></notification-component>
|
||||
<div class="col p-t-10 p-b-10">
|
||||
<div class="row no-margin align-items-center justify-content-center">
|
||||
<div class="col">
|
||||
<small class="text-danger fs-10 requestModal pointer" data-type="delete"><i class="fa fa-times"></i> delete order</small>
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<!--<div class="col">-->
|
||||
<!--<small class="text-danger fs-10 requestModal pointer" data-type="delete"><i class="fa fa-times"></i> delete order</small>-->
|
||||
<!--</div>-->
|
||||
<div class="col-auto p-l-0">
|
||||
<component v-if="this.order.current_step.details" v-on:updateStep="updateOrderStep($event)" :is="stepComponent(this.order.current_step.reference_id)" :attachments="this.order.current_step.attachments" :data="this.order.id"></component>
|
||||
<div class="dropdown inline">
|
||||
<!--<a class="btn btn-sm btn-default b-rad-none p-t-10 p-b-10" :href="route('order.profile', {orderId: this.order.id})"></a>-->
|
||||
<button class="btn btn-sm btn-default b-rad-none p-t-10 p-b-10" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right b-rad-none no-padding pointer" aria-labelledby="dropdownMenuLink" style="box-shadow: none; min-width: 150px;">
|
||||
<a :href="route('order.profile', {orderId: this.order.id})">
|
||||
<div class="row no-margin align-items-center justify-content-center text-black" style=" border-bottom: solid 1px #e1e1e1; ">
|
||||
<div class="col-3 p-t-15 p-b-15 bg-master-lighter muted"><i class="fa fa-chevron-right fs-10"></i></div>
|
||||
<div class="col" style="white-space: nowrap;"><span class="fs-10 all-caps bold">View Details</span></div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<component v-if="this.order.current_step.details" v-on:updateStep="updateOrderStep($event)" :is="stepComponent(this.order.current_step.details.reference_id)" :attachments="this.order.current_step.attachments" :data="this.order.id"></component>
|
||||
<a class="btn btn-sm btn-default b-rad-none" :href="route('order.profile', {orderId: this.order.id})">View Details</a>
|
||||
</a>
|
||||
<div class="text-danger all-caps gb-master-lightest" style=" white-space: nowrap;">
|
||||
<div class="row no-margin align-items-center justify-content-center">
|
||||
<div class="col-3 p-t-15 p-b-15 bg-master-lighter"><i class="fa fa-times fs-10"></i></div>
|
||||
<div class="col" style="white-space: nowrap;"><span class="fs-10 bold">Cancel Order</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<confirm-modal-component
|
||||
title="Cancel Order"
|
||||
:message="'Are you sure you want to cancel this order ?'"
|
||||
type="delete"
|
||||
danger
|
||||
v-on:confirm="deleteOrder()"></confirm-modal-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!--<confirm-modal-component-->
|
||||
<!--title="Cancel Order"-->
|
||||
<!--:message="'Are you sure you want to cancel this order ?'"-->
|
||||
<!--type="delete"-->
|
||||
<!--danger-->
|
||||
<!--v-on:confirm="deleteOrder()"></confirm-modal-component>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<div class="row m-b-10 parentContainer bg-white">
|
||||
<div class="col">
|
||||
<order-header-component :data="this.data"></order-header-component>
|
||||
<order-action-component class="b-t b-grey" :data="this.data"></order-action-component>
|
||||
<order-quick-view-component :data="this.data"></order-quick-view-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,38 +1,41 @@
|
||||
<template>
|
||||
<div class="row no-margin">
|
||||
<div class="row no-margin align-items-center justify-content-center p-t-10 p-b-10">
|
||||
<div class="col">
|
||||
<div class="row no-margin p-t-10 p-b-10">
|
||||
<div class="col p-l-0">
|
||||
<div class="row no-margin align-items-center justify-content-center">
|
||||
<div class="col-auto no-padding all-caps">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="bold">
|
||||
<span class="v-align-middle">#{{this.order.marking}} </span>
|
||||
</div>
|
||||
<div class="col fs-10">
|
||||
<span class="bold">#{{this.order.marking}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-9 muted all-caps">Importer: <a :href="route('companies.profile', {companyId: this.order.company.id})"><small class="fs-10 text-complete bold">{{this.order.company.marking}}</small></a></div>
|
||||
<div class="fs-9 muted all-caps">Importer:
|
||||
<a :href="route('companies.profile', {companyId: this.order.company.id})">
|
||||
<span class="fs-9 text-complete bold">{{this.order.company.marking}}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto p-r-0">
|
||||
</div>
|
||||
<div class="col text-right p-r-0 all-caps">
|
||||
<div class="row">
|
||||
<div class="col"></div>
|
||||
<div class="col fs-10">
|
||||
<span class="bold text-danger" v-if="!this.order.complete">{{this.order.current_step.details.initial_name}}</span>
|
||||
<span class="bold text-success" v-if="this.order.complete">Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row fs-9" >
|
||||
<div class="col muted">
|
||||
<span class="inline v-align-middle" v-if="!this.order.complete">{{this.order.current_step.details.description}}</span>
|
||||
<span class="inline v-align-middle" v-if="this.order.complete">Order has been delivered</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="fs-11 muted">Status: </span>
|
||||
<span class="text-capitalize bold text-danger fs-11" v-if="!this.order.complete">{{this.order.current_step.details.initial_name}}</span>
|
||||
<span class="text-capitalize bold text-success fs-11" v-if="this.order.complete">Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" >
|
||||
<div class="col text-right muted">
|
||||
<span class="fs-11 inline v-align-middle" v-if="!this.order.complete">{{this.order.current_step.details.description}}</span>
|
||||
<span class="fs-11 inline v-align-middle" v-if="this.order.complete">Order has been delivered</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<order-action-component :data="this.data"></order-action-component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col p-l-0">
|
||||
<div class="row m-l-0 m-r-0 p-b-15 relative order-history" v-for="detail in this.order.details">
|
||||
<div class="row m-l-0 m-r-0 relative order-history" v-for="(detail, index) in this.order.details " :class="{'p-b-15': index !== 3}" v-if="index <= 3">
|
||||
<div class="absolute bullet-connector hint-text"></div>
|
||||
<div class="col" :class="[{'text-danger': detail.type === 0}, {'text-success': detail.type === 2}, {'bold': detail.type === 2}]">
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<div class="row align-items-center justify-content-center fs-10">
|
||||
<div class="col-auto p-r-10">
|
||||
<div class="bg-master-light btn-rounded hint-text" style="width: 8px;height: 8px;" ></div>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<div class="row m-b-15">
|
||||
<div class="col">
|
||||
<div class="row m-b-5">
|
||||
<div class="col"><span class="all-caps muted fs-9">Warehouse</span></div>
|
||||
<div class="col"><span class="all-caps muted fs-9">Origin Warehouse</span></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@@ -190,9 +190,9 @@
|
||||
<small class="all-caps text-complete pointer requestModal" data-type="packingList" :class="{'hide': showArrangements}">Edit List</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="order.packing_list !== null">
|
||||
<div class="row" v-if="order.packages !== null">
|
||||
<div class="col">
|
||||
<div class="row align-items-center justify-content-center b-b b-grey" v-for="(package, index) in order.packing_list.packages">
|
||||
<div class="row align-items-center justify-content-center b-b b-grey" v-for="(package, index) in order.packages">
|
||||
<div class="col bg-white p-t-15 p-b-15 b-r b-grey"><small class="text-info bold all-caps">{{index + 1}}. {{package.description}}</small></div>
|
||||
<div class="col-1" v-show="!showArrangements"></div>
|
||||
<div class="col-4" :class="[{'col-5': showArrangements}, {'col-4': !showArrangements}, ]">
|
||||
@@ -221,7 +221,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-master-lighter" v-show="order.packing_list === null">
|
||||
<div class="row bg-master-lighter" v-show="order.packages === null">
|
||||
<div class="col text-center">
|
||||
<div class="row p-t-50 m-t-25">
|
||||
<div class="col">
|
||||
@@ -737,7 +737,7 @@
|
||||
<modal-component type="packingList" large>
|
||||
<div class="card card-default no-border">
|
||||
<div class="card-block no-padding">
|
||||
<packing-list-form-component :attachments="this.order.packing_list" :data="this.orderId"></packing-list-form-component>
|
||||
<packing-list-form-component :attachments="this.order.packages" :data="this.orderId"></packing-list-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</modal-component>
|
||||
@@ -859,7 +859,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -910,8 +909,8 @@
|
||||
},
|
||||
totalCBM(){
|
||||
let total = 0;
|
||||
if(this.order.packing_list !== null){
|
||||
$.each(this.order.packing_list.packages, function(key, object){
|
||||
if(this.order.packages.length){
|
||||
$.each(this.order.packages, function(key, object){
|
||||
total += (((object.width/100) * (object.length/100) * (object.height/100)) * object.quantity)
|
||||
});
|
||||
}
|
||||
@@ -919,8 +918,8 @@
|
||||
},
|
||||
totalPackages(){
|
||||
let total = 0;
|
||||
if(this.order.packing_list !== null) {
|
||||
$.each(this.order.packing_list.packages, function (key, object) {
|
||||
if(this.order.packages.length) {
|
||||
$.each(this.order.packages, function (key, object) {
|
||||
total += object.quantity
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row fs-12 p-t-15 p-b-15 m-l-0 m-r-0 ">
|
||||
<div class="col">
|
||||
<div class="row no-margin">
|
||||
<div class="col no-padding relative b-a b-grey b-dashed qr-container">
|
||||
<a :href="route('order.download.qr', {orderId: this.order.id, type: 'pdf'})" target="_blank">
|
||||
<div class="absolute padding-10 bg-white b-b b-l b-grey b-dashed pdf-button" style="right: 0; top: 0;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="30" height="30"
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g><path d="M22.575,162.325v-152.65h80.195l38.055,38.055v114.595z" fill="#ffffff"></path><path d="M102.34,10.75l37.41,37.41v113.09h-116.1v-150.5h78.69M103.2,8.6h-81.7v154.8h120.4v-116.1l-38.7,-38.7z" fill="#c74343"></path><path d="M102.125,48.375v-38.7h0.645l38.055,38.055v0.645z" fill="#ffd9d9"></path><path d="M103.2,11.61l35.69,35.69h-35.69v-35.69M103.2,8.6h-2.15v40.85h40.85v-2.15l-38.7,-38.7zM52.245,129c-3.01,0 -4.945,-2.365 -4.945,-4.515c0,-5.805 7.74,-10.75 17.845,-14.19c4.3,-7.525 8.385,-16.985 11.18,-25.585c-2.365,-6.235 -3.87,-12.04 -3.87,-16.125c0,-2.365 0.43,-4.3 1.29,-5.59c1.075,-1.72 2.795,-2.795 4.73,-2.795c1.935,0 3.44,1.075 4.3,2.795c0.645,1.29 1.075,3.01 1.075,5.375c0,4.085 -1.075,9.89 -3.225,16.555c2.795,7.095 7.095,14.405 12.04,19.78c7.74,-0.645 13.975,-0.43 17.845,0.86c4.3,1.505 5.375,3.87 5.375,5.805c0,1.935 -0.86,6.235 -7.955,6.235c-6.02,0 -11.825,-3.44 -16.77,-8.385c-7.955,0.86 -16.125,2.58 -23.005,4.945c-5.16,8.385 -10.75,14.835 -15.91,14.835zM51.6,124.485c0,0 0.215,0.215 0.645,0.215c2.365,0 5.59,-3.225 9.03,-8.17c-5.805,2.58 -9.675,5.375 -9.675,7.955zM97.18,108.575c3.44,2.795 7.095,4.515 10.965,4.515c3.655,0 3.655,-1.29 3.655,-1.935c0,-0.86 -1.72,-1.505 -2.365,-1.72c-2.15,-0.645 -5.16,-1.075 -9.03,-1.075c-1.075,0.215 -2.15,0.215 -3.225,0.215zM78.905,90.73c-2.15,6.02 -4.73,12.255 -7.74,17.845c5.375,-1.505 11.18,-2.58 16.555,-3.225c-3.44,-4.515 -6.45,-9.675 -8.815,-14.62zM78.475,64.5c-0.43,0 -0.645,0 -1.075,0.645c-0.215,0.43 -0.645,1.505 -0.645,3.44c0,2.58 0.43,5.59 1.505,9.03c0.86,-3.655 1.29,-6.88 1.29,-9.46c0,-1.935 -0.43,-3.01 -0.43,-3.44c-0.215,-0.215 -0.43,-0.215 -0.645,-0.215z" fill="#c74343"></path></g></g></svg>
|
||||
</div>
|
||||
</a>
|
||||
<img :src='this.qrURL()' class="w-100" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hide">
|
||||
<div class="col">
|
||||
<div class="row m-b-15">
|
||||
<div class="col">
|
||||
@@ -15,8 +30,11 @@
|
||||
</div>
|
||||
<order-delivery-address-component :data="this.data"></order-delivery-address-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-9 p-l-0">
|
||||
<div class="row m-l-0 m-r-0 m-b-15">
|
||||
<div class="row m-l-0 m-r-0 m-b-10">
|
||||
<div class="col p-l-0">
|
||||
<small class="muted all-caps">Order History</small>
|
||||
</div>
|
||||
@@ -27,7 +45,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.pdf-button {
|
||||
visibility: hidden;
|
||||
}
|
||||
.qr-container:hover .pdf-button {
|
||||
visibility: visible;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
@@ -45,5 +70,11 @@
|
||||
this.order = this.data;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
route: route,
|
||||
qrURL(){
|
||||
return 'https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl={"hash":"{1*23456}","id":'+this.order.id+'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,7 +1,7 @@
|
||||
<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>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" data-type="arrival">Order Arrived</div>
|
||||
<confirm-modal-component
|
||||
title="Order Arrival"
|
||||
:message="'Are you sure this order has arrived to warehouse?'"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="inline">
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal" data-type="confirmOrder">Confirm Warehouse</div>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" data-type="confirmOrder">Confirm Warehouse</div>
|
||||
<modal-component type="confirmOrder">
|
||||
<loading-component style="left: 0;" v-show="isLoading"></loading-component>
|
||||
<div class="card card-default no-border">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="inline">
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal" v-if="!arrangementExist" data-type="deliveryArrangement">Delivery Arrangement</div>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal" v-if="arrangementExist" data-type="deliveryComplete">Successful Delivery</div>
|
||||
<div class="btn btn-sm btn-warning text-black b-rad-none requestModal" v-if="arrangementExist" data-type="deliveryArrangement">Reschedule Delivery</div>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" v-if="!arrangementExist" data-type="deliveryArrangement">Delivery Arrangement</div>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" v-if="arrangementExist" data-type="deliveryComplete">Successful Delivery</div>
|
||||
<!--<div class="btn btn-sm btn-warning text-black b-rad-none requestModal p-t-10 p-b-10 " v-if="arrangementExist" data-type="deliveryArrangement">Reschedule Delivery</div>-->
|
||||
<modal-component type="deliveryArrangement">
|
||||
<div class="card card-default no-border">
|
||||
<div class="card-block no-padding">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<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>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" v-if="this.confirmed" data-type="packed">Order Packed</div>
|
||||
<div class="btn btn-sm btn-complete b-rad-none requestModal p-t-10 p-b-10" v-if="!this.confirmed" data-type="packingList">Packing List</div>
|
||||
<modal-component type="packingList" large>
|
||||
<div class="card card-default no-border">
|
||||
<div class="card-block no-padding">
|
||||
@@ -25,14 +25,9 @@
|
||||
<div class="col no-padding">
|
||||
<div class="row fs-12">
|
||||
<div class="col no-padding b-a b-grey">
|
||||
<div class="row bg-white all-caps muted p-t-10 p-b-10 b-b b-grey">
|
||||
<div class="col">
|
||||
<small class="bold all-caps">Packing List No: <span class="bold text-info m-l-10">{{packingList.reference_no}}</span></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col no-padding">
|
||||
<div class="row align-items-center justify-content-center b-b b-grey" v-for="(item, index) in packingList.packages">
|
||||
<div class="row align-items-center justify-content-center b-b b-grey" v-for="(item, index) in packages">
|
||||
<div class="col-4 bg-white p-t-15 p-b-15 b-r b-grey"><small class="text-info bold all-caps">{{index + 1}}. {{item.description}}</small></div>
|
||||
<div class="col-1"></div>
|
||||
<div class="col-2">
|
||||
@@ -93,28 +88,25 @@
|
||||
required: true
|
||||
},
|
||||
'attachments': {
|
||||
type: Object
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
packingList: {
|
||||
reference_no: '',
|
||||
confirmed: 0,
|
||||
packages: []
|
||||
},
|
||||
packages: [],
|
||||
confirmed: false,
|
||||
complete_date: null,
|
||||
showCompleteDate: false
|
||||
}
|
||||
},
|
||||
created(){
|
||||
if(this.attachments !== null){
|
||||
this.packingList = this.attachments;
|
||||
this.packages = this.attachments;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'attachments': function() {
|
||||
this.packingList = this.attachments;
|
||||
this.packages = this.attachments;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -123,7 +115,7 @@
|
||||
},
|
||||
totalCBM(){
|
||||
var total = 0;
|
||||
$.each(this.packingList.packages, function(key, object){
|
||||
$.each(this.packages, function(key, object){
|
||||
total += (((object.width/100) * (object.length/100) * (object.height/100)) * object.quantity)
|
||||
});
|
||||
return total.toFixed(4);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="inline">
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal" data-type="receiveNote">Warehouse Received</div>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" 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>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="inline">
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal" v-if="!arrangementExist" data-type="shippingArrangement">Shipping Arrangement</div>
|
||||
<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="shippingArrangement">Reschedule Shipping</div>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" v-if="!arrangementExist" data-type="shippingArrangement">Shipping Arrangement</div>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" v-if="arrangementExist" data-type="shippingComplete">Port Arrival</div>
|
||||
<!--<div class="btn btn-sm btn-warning text-black b-rad-none requestModal p-t-10 p-b-10" v-if="arrangementExist" data-type="shippingArrangement">Reschedule Shipping</div>-->
|
||||
<modal-component type="shippingArrangement">
|
||||
<div class="card card-default no-border">
|
||||
<div class="card-block no-padding">
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<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>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" data-type="packed">Order Packed</div>
|
||||
<confirm-modal-component
|
||||
title="Order Packed"
|
||||
:message="'Are you sure supplier has packed this order?'"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<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>
|
||||
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" data-type="unpacked">Order Unpacked</div>
|
||||
<confirm-modal-component
|
||||
title="Order UnPacked"
|
||||
:message="'Are you sure this order has been unpacked?'"
|
||||
|
||||
@@ -31,6 +31,26 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10">
|
||||
<div class="col no-padding">
|
||||
<div class="row m-b-10" v-show="this.showWarehouse">
|
||||
<div class="col no-padding">
|
||||
<div class="form-group form-group-default form-group-default-select2 b-rad-none m-b-0" >
|
||||
<label class="muted" style="z-index: 10000;">Warehouse</label>
|
||||
<select-component :options="this.warehouses" v-model="order.warehouse_id"></select-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto padding-5 bg-master-lighter pointer hide" @click="showWarehouse = !showWarehouse; order.warehouse_id = null">
|
||||
<div class="row align-items-center justify-content-center h-100">
|
||||
<div class="col">
|
||||
<i class="fa fa-times text-danger m-l-5 m-r-5"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<action-date-component v-model="complete_date"></action-date-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right no-padding">
|
||||
<div class="row">
|
||||
@@ -60,11 +80,17 @@
|
||||
return {
|
||||
order: {
|
||||
marking: '',
|
||||
name: ''
|
||||
name: '',
|
||||
warehouse_id: null
|
||||
},
|
||||
complete_date: null,
|
||||
warehouses: [],
|
||||
showWarehouse: true,
|
||||
showCompleteDate: false,
|
||||
isLoading: false
|
||||
}
|
||||
},
|
||||
|
||||
mounted: function() {
|
||||
$(this.$el).find('form').validate({
|
||||
rules: {
|
||||
@@ -89,8 +115,26 @@
|
||||
},
|
||||
created() {
|
||||
this.generateMarking();
|
||||
this.fetchWarehouses();
|
||||
},
|
||||
methods: {
|
||||
fetchWarehouses(){
|
||||
//turn on loading animation
|
||||
this.isLoading = true;
|
||||
|
||||
fetch(route('api.warehouse.list', {'all': true})).then(response => response.json())
|
||||
.then(response => {
|
||||
|
||||
this.warehouses = $.map(response.data, function(value){
|
||||
return {'id': value.id, 'text': value.name};
|
||||
});
|
||||
|
||||
//turn off loading animation
|
||||
this.isLoading = false;
|
||||
|
||||
})
|
||||
.catch(error => console.log(error))
|
||||
},
|
||||
addOrder() {
|
||||
if($(this.$el).find('form').valid()) {
|
||||
let notification = this.$refs.notification;
|
||||
@@ -127,10 +171,13 @@
|
||||
}
|
||||
},
|
||||
generateMarking(){
|
||||
this.order.marking = Math.floor(Math.random() * 799999) + 200000;
|
||||
this.order.marking = Math.floor(Math.random() * 79999999) + 20000000;
|
||||
},
|
||||
clearForm(){
|
||||
this.generateMarking();
|
||||
this.order.warehouse_id = null;
|
||||
this.complete_date = null;
|
||||
this.showCompleteDate = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,23 +5,15 @@
|
||||
<div class="row p-t-30">
|
||||
<div class="col no-padding">
|
||||
<div class="b-l b-success p-l-15 m-b-15" style="border-left-width: 3px;">
|
||||
<h6 class="bold all-caps no-margin text-success">Packing List</h6>
|
||||
<h6 class="bold all-caps no-margin text-success">Packages</h6>
|
||||
<div class="muted all-caps fs-12">Order Packages Details</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-group-default input-group">
|
||||
<div class="row w-100">
|
||||
<div class="col no-padding">
|
||||
<label class="muted block">Packing List No.</label>
|
||||
<input class="form-control block" v-model="packingList.reference_no">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0 m-b-15">
|
||||
<div class="col no-padding">
|
||||
<div class="row packages" v-for="i in Math.ceil(packingList.packages.length / 3)">
|
||||
<div class="col-4 b-r b-grey bg-master-lightest no-padding text-center package-thumbnail" v-for="(item, index) in packingList.packages.slice((i - 1) * 3, i * 3)">
|
||||
<div class="row packages" v-for="i in Math.ceil(packages.length / 3)">
|
||||
<div class="col-4 b-r b-grey bg-master-lightest no-padding text-center package-thumbnail" v-for="(item, index) in packages.slice((i - 1) * 3, i * 3)">
|
||||
<div class="row">
|
||||
<div class="col no-padding">
|
||||
<div class="row">
|
||||
@@ -181,7 +173,7 @@
|
||||
<div class="row">
|
||||
<div class="col text-right no-padding">
|
||||
<button class="btn b-rad-none btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn b-rad-none btn-success" @click="updatePackingList" data-dismiss="modal">Confirm</button>
|
||||
<button type="submit" class="btn b-rad-none btn-success" @click="updatePackages" data-dismiss="modal">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -237,26 +229,22 @@
|
||||
required: true
|
||||
},
|
||||
'attachments': {
|
||||
type: Object
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
packingList: {
|
||||
reference_no: '',
|
||||
confirmed: 0,
|
||||
packages: []
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
if(this.attachments !== null){
|
||||
this.packingList = this.attachments;
|
||||
this.packages = this.attachments;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'attachments': function() {
|
||||
this.packingList = this.attachments;
|
||||
this.packages = this.attachments;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -270,12 +258,12 @@
|
||||
$(event.target).parents('.package-thumbnail').find('.dropdown-menu input').first().select();
|
||||
}
|
||||
},
|
||||
updatePackingList() {
|
||||
updatePackages() {
|
||||
//turn on loading animation
|
||||
this.isLoading = true;
|
||||
fetch(route('api.order.attachment.packages.update', {orderId: this.data}), {
|
||||
method: 'post',
|
||||
body: JSON.stringify(this.packingList),
|
||||
body: JSON.stringify({packages:this.packages}),
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
@@ -296,7 +284,7 @@
|
||||
});
|
||||
},
|
||||
AddPackage(type){
|
||||
this.packingList.packages.push({
|
||||
this.packages.push({
|
||||
description: '',
|
||||
type: type,
|
||||
quantity: 1,
|
||||
@@ -322,7 +310,7 @@
|
||||
}
|
||||
},
|
||||
removePackage(index){
|
||||
this.packingList.packages.splice(index, 1);
|
||||
this.packages.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>order-qr-{{$order->marking}}</title>
|
||||
</head>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'HanWangYenHeavy';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(http://eclecticgeek.com/dompdf/fonts/cjk/fireflysung.ttf) format('truetype');
|
||||
}
|
||||
@page { margin: 0px; }
|
||||
body { margin: 0px; }
|
||||
body {
|
||||
font-family: Firefly Sung, DejaVu Sans, sans-serif;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<table style="width: 100%; border: 2px solid #000000;">
|
||||
<tbody>
|
||||
@for ($i = 0; $i < 4; $i++)
|
||||
<tr>
|
||||
<td align="center" width="30%" style="border: 2px solid #000000;">
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr align="center">
|
||||
<td>
|
||||
<img src="{{ url('https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl={"hash":"{1*23456}","id":"1"}') }}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
<td>
|
||||
<h5 style="margin: 0 !important;"><strong>#{{$order->marking}}</strong></h5>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td width="70%" style="border: 2px solid #000000; padding: 15px !important;">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="border-bottom: solid 2px #000000;">
|
||||
<h2 style="margin-top: 0px !important; margin-bottom: 10px !important;">{{$company->marking}}</h2>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-bottom: solid 1px #000000;">
|
||||
<h5 style="margin-top: 10px !important; margin-bottom: 10px !important; word-wrap: break-word">{{$delivery_address->street_one.' '.$delivery_address->street_two.' '.$delivery_address->city.' '.$delivery_address->post_code.' '.$delivery_address->state}}</h5>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p style="font-size: 12px; margin-bottom: 0 !important; margin-top: 10px !important;">仓库地址:</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 5px !important; word-wrap: break-word; font-size: 16px;">广州市世通行进出口有限公司 广州市白云区白云湖街大朗南路自编13号世通行7号仓库(高德地图导航:广州市世通行) 邮箱偏号:510450</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 12px;">联系电话:杨先生 13900055019 / 梁先生 18529309778</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endfor
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function
|
||||
Route::post('/bulk-receive-notes', 'BulkReceiveNotesController@create')->name('bulk.receive.update');
|
||||
|
||||
Route::group(['prefix' => 'attachment', 'as' => 'attachment.', 'namespace' => 'Attachments'], function () {
|
||||
Route::post('/{orderId}/packing-list', 'UpdatePackingListController@update')->name('packages.update');
|
||||
Route::post('/{orderId}/packages', 'UpdatePackagesController@update')->name('packages.update');
|
||||
Route::post('/{orderId}/tracking-number', 'UpdateTrackingNumberController@update')->name('tracking.update');
|
||||
|
||||
Route::post('/{orderId}/shipping-arrangement', 'UpdateShippingArrangementController@update')->name('shipping.update');
|
||||
|
||||
@@ -66,6 +66,8 @@ Route::group(['middleware' => ['secure', 'clearcache']], function (): void {
|
||||
return view('pages.orders.receive_note', ['warehouseId' => $warehouseId]);
|
||||
})->name('order.bulk.receive_note');
|
||||
|
||||
Route::get('/{orderId}/qr/{type}/download', 'Orders\OrderController@download')->name('order.download.qr');
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user