bugs fixes
This commit is contained in:
@@ -117,7 +117,6 @@ class ManageCommissionController extends Controller
|
||||
public function editProduct(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
// dd($request->end_of_trail.' 00:00:00.0');
|
||||
$validator = Validator::make($request->post(), [
|
||||
'commission_type' => 'required',
|
||||
// 'profit_sharing' => 'required',
|
||||
@@ -134,6 +133,24 @@ class ManageCommissionController extends Controller
|
||||
if ($validationMessage) {
|
||||
return response()->json(['status' => 400, 'message' => $validationMessage]);
|
||||
}
|
||||
|
||||
$product = Product::where('id', $request->products_id)->first();
|
||||
$productpresentation = '';
|
||||
|
||||
if($request->has('channel_partner_agreement')) {
|
||||
if($product && $product->channel_partner_aggrement) {
|
||||
if(\File::exists(public_path('/uploads/product/channel_partner_agreement/'.$product->channel_partner_aggrement))) {
|
||||
\File::delete(public_path('/uploads/product/channel_partner_agreement/'.$product->channel_partner_aggrement));
|
||||
}
|
||||
}
|
||||
|
||||
$productpresentation .= time().'_partner_agreement'.'.'.$request->channel_partner_agreement->extension();
|
||||
// dd($productpresentation);
|
||||
$request->channel_partner_agreement->move(public_path('/uploads/product/channel_partner_agreement'),$productpresentation);
|
||||
|
||||
}
|
||||
// dd($productpresentation);
|
||||
|
||||
Product::where('id', $request->products_id)->update([
|
||||
'commission_type' => $request->commission_type,
|
||||
'profit_sharing' => $request->profit_sharing,
|
||||
@@ -143,8 +160,12 @@ class ManageCommissionController extends Controller
|
||||
'gst' => $request->gst,
|
||||
'tds' => $request->tds,
|
||||
'end_of_trail' => $request->end_of_trail,
|
||||
'channel_partner_aggrement'=> $productpresentation,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
$returnType = [
|
||||
'Monthly' => '1 month',
|
||||
'Quarterly' => '3 months',
|
||||
|
||||
Reference in New Issue
Block a user