Fix broadband plan change update
This commit is contained in:
@@ -96,6 +96,7 @@ class ServiceController extends Controller
|
||||
$co->save();
|
||||
|
||||
$o->product_id = Arr::get($request->broadband,'product_id');
|
||||
$o->price = Arr::get($request->broadband,'price');
|
||||
$o->order_status = 'ACTIVE';
|
||||
$o->save();
|
||||
|
||||
@@ -345,7 +346,7 @@ class ServiceController extends Controller
|
||||
$co->type = $iio->item_type;
|
||||
$co->start_at = $start_at;
|
||||
$co->stop_at = $iio->stop_at;
|
||||
$co->amount = $po->base_charge;
|
||||
$co->amount = Arr::get($request->broadband,'price') ?: $po->base_charge;
|
||||
$co->taxable = TRUE; // @todo this should be determined
|
||||
$co->quantity = $start_at->diff($iio->stop_at)->days/$iio->start_at->diff($iio->stop_at)->days;
|
||||
$charges->push($co);
|
||||
|
@@ -32,6 +32,7 @@ class ServiceChangeRequest extends FormRequest
|
||||
return [
|
||||
'broadband.product_id' => 'required|exists:products,id',
|
||||
'broadband.change_fee' => 'nullable|numeric',
|
||||
'broadband.price' => 'nullable|numeric',
|
||||
'broadband.start_at' => 'required|date', // @todo Check that it is not more than 1 billing cycle ago, and not future.
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user