display cost code

This commit is contained in:
2019-07-22 20:49:54 -05:00
parent 59808c1374
commit 90db71b2e3

View File

@@ -25,21 +25,27 @@ class SRPController extends Controller
}
public function displayPayoutAmounts() {
$shipTypes = array();
$payoutCodes = array();
$payouts = array();
$count = 0;
$shipType = SrpShipType::all();
$srpPayout = SrpPayout::all();
foreach($shipType as $ship) {
//Don't process if the code is None
if($ship->code != 'None') {
$tempCode = $ship->code;
$tempDescription = $ship->description;
$temp = SrpPayout::where(['code' => $ship->code])->get();
$tempPayout = $temp->payout;
$shipTypesTemp = SrpShipType::all();
$payoutCodesTemp = SrpPayout::all();
$block = [
'code' => $tempCode,
'description' => $tempDescription,
'payout' => $tempPayout,
];
foreach($shipTypesTemp as $type) {
$temp = [
'code' => $type->code,
'description' => $type->description,
'payout' => $payoutCodesTemp[$type->code],
];
array_push($payouts, $temp);
array_push($payouts, $block);
}
}
return view('srp.payouts')->with('payouts', $payouts);