@php $total_overheads_fixed=0; $files[]=''; $total_taxes =0; $critères[]=[]; $m=0; $total_overheads_scalablee=0; $dataPlan =[]; $total_mensualite=0; $total_rest=0; $total_rem=0; $total_interets=0; $total_van=0; $total_van_verify=0; $total_cash=0; $tri=0; $bp_evolution_rate = isset($data ->financial_data->evolution_rate) ? $data ->financial_data->evolution_rate : 0; // Financial Plan $bp_financial_plan_totals = 0; $bp_financial_plan_total = 0; if(isset($data->financial_data->financial_plan)){ foreach ($data ->financial_data->financial_plan as $item) { $bp_financial_plan_totals += $item->value; }} if(isset($data->financial_data->financial_plan_loans)){ foreach ($data ->financial_data->financial_plan_loans as $item) { $arrytwer['name']=$item->label; $arrytwer['value']= number_format($bp_financial_plan_totals !=0?$item->value/$bp_financial_plan_totals *100:0,0, ',', ' '); array_push($dataPlan, $arrytwer); $bp_financial_plan_totals += $item->value; }} if(isset($data->financial_data->financial_plan)){ foreach ($data ->financial_data->financial_plan as $item) { $arrytwer['name']=$item->label; $arrytwer['value']= number_format($bp_financial_plan_totals !=0?$item->value/$bp_financial_plan_totals *100:0,0, ',', ' '); array_push($dataPlan, $arrytwer); } } //$coount=0; if (isset($data->financial_data->financial_plan_loans)) { foreach ($data->financial_data->financial_plan_loans as $item) { $bp_financial_plan_total += $item->value; } } // Investment Program $bp_investment_program_total = 0; $total_taxe_amortisement=0; if (isset($data ->financial_data->startup_needs)) { foreach ($data ->financial_data->startup_needs as $item) { $bp_investment_program_total += $item->value ?? 0; if($item->value!=0 && $item->rate!=0){ $total_taxe_amortisement+=($item->value/($item->rate/100))/(1+$item->duration/100); } } } //dd( $total_taxe_amortisement); //total charge $total1=0; $total2=0; $total3=0; $total4=0; $total5=0; if(isset($data ->financial_data->overheads_scalable)){ foreach ($data ->financial_data->overheads_scalable as $item){ if ($item->label != NULL) { $total1=$total1+ $item->value; $total2+= $item->value + ($item->value * $bp_evolution_rate / 100); $total3+= ($item->value+ ($item->value * $bp_evolution_rate / 100)) + ($item->value + ($item->value * $bp_evolution_rate / 100)) * $bp_evolution_rate / 100; $total4+=$total3+ ($item->value + ($item->value * $bp_evolution_rate / 100)) * $bp_evolution_rate / 100; $total5+=$total4+ ($item->value + ($item->value * $bp_evolution_rate / 100)) * $bp_evolution_rate / 10; } } } // Parameters $bp_turnover_products_total = 0; $bp_turnover_products_total1 = 0; $bp_turnover_products_total2 = 0; $bp_turnover_products_totals=0; $total_mensuel_p=0; $total_mensuel_s=0; $total_mensuel=0; $total_p=0; $total_s=0; $bp_profit_margin_rate = 0; $achat_t=0; $saisonalite=isset($data ->financial_data->saisonnalite)? $data ->financial_data->saisonnalite:0; if (isset($data ->financial_data->products_turnover_forecast)){ foreach ($data ->financial_data->products_turnover_forecast as $total){ if(isset($total->duration)){ $achat_t=(1-($total->duration/100)); }else{ $achat_t=0; } if(isset($total->otherValue)){ if(isset($total->organisme)){ $bp_turnover_products_total1 = $bp_turnover_products_total1 +(($total->otherValue *$total->organisme)*$achat_t) ; $total_p +=$total->otherValue*$total->organisme; $bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; }else{ $bp_turnover_products_total1 = $bp_turnover_products_total1 +(( $total->otherValue*$saisonalite)* $achat_t) ; $total_p += ( $total->otherValue *$saisonalite) ; $bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; } }else{ if(isset($total->organisme)){ $bp_turnover_products_total1 = $bp_turnover_products_total1 +(( $total->rate * $total->value*$total->organisme)*$achat_t) ; $total_p += $total->rate * $total->value*$total->organisme; $bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; }else{ $bp_turnover_products_total1 = $bp_turnover_products_total1 +(( $total->rate * $total->value*$saisonalite)* $achat_t) ; $total_p += ( $total->rate * $total->value*$saisonalite) ; $bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; } } } } //dd($total_p); if (isset($data ->financial_data->services_turnover_forecast_c)){ foreach ($data ->financial_data->services_turnover_forecast_c as $total){ if(isset($total->duration)){ $achat_t=(1-($total->duration/100)); }else{ $achat_t=0; } if(isset($total->otherValue)){ if(isset($total->organisme)){ $bp_turnover_products_total2 = $bp_turnover_products_total2 +(($total->otherValue *$total->organisme)* $achat_t) ; $total_s +=$total->otherValue*$total->organisme; $bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; }else{ $bp_turnover_products_total2 = $bp_turnover_products_total2 +(( $total->otherValue*$saisonalite)* $achat_t) ; $total_s += ( $total->otherValue *$saisonalite) ; $bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; } }else{ if(isset($total->organisme)){ if(isset($total->rate)){ $bp_turnover_products_total2 = $bp_turnover_products_total2+(( $total->rate * $total->value*$total->organisme)* $achat_t) ; $total_s += $total->rate * $total->value*$total->organisme; $bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; } }else{ if(isset($total->rate)){ $bp_turnover_products_total2 = $bp_turnover_products_total2 +(( $total->rate * $total->value*$saisonalite)* $achat_t) ; $total_s += ( $total->rate * $total->value*$saisonalite) ; $bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; } } } //$bp_profit_margin_rate= $bp_profit_margin_rate + $total->duration; } } $perPage=6; $tablepage=[]; $result=[]; if (isset($data ->financial_data->products_turnover_forecast)&& isset($data ->financial_data->services_turnover_forecast_c)){ $result = array_merge((array)$data ->financial_data->services_turnover_forecast_c, (array)$data ->financial_data->products_turnover_forecast); for($i=0; $ifinancial_data->products_turnover_forecast)){ foreach ($data ->financial_data->products_turnover_forecast as $total){ if(isset($total->otherValue)){ if(isset( $total->organisme)){ $total_mensuel_p = $total_mensuel_p+$total->otherValue; } }else{ if(isset( $total->rate)){ $total_mensuel_p = $total_mensuel_p+( $total->rate * $total->value) ; } } } } if (isset($data ->financial_data->services_turnover_forecast_c)){ foreach ($data ->financial_data->services_turnover_forecast_c as $total){ if(isset($total->otherValue)){ if(isset( $total->organisme)){ $total_mensuel_p = $total_mensuel_p+$total->otherValue; }}else{ if(isset( $total->rate)){ $total_mensuel_s = $total_mensuel_s +( $total->rate * $total->value) ; } } } } //dd($total_s); $bp_turnover_products_total= $bp_turnover_products_total2+ $bp_turnover_products_total1; $bp_turnover_products_totals=$total_s+$total_p; $total_mensuel=$total_mensuel_p+$total_mensuel_s; //dd($total_s); $bp_turnover_services_total = isset($data ->financial_data->services_turnover_forecast) ? $data ->financial_data->services_turnover_forecast : 0 ; // Loans Amortization $bp_loan_periodic_rate = 0; $bp_loan_monthly_payment = 0; $bp_loan_monthly_payments_count = 0; $bp_loan_amount = 0; $bp_loans_first_year_total = 0; $bp_loans_second_year_total = 0; $bp_loans_third_year_total = 0; $bp_loans_four_year_total = 0; $bp_loans_five_year_total = 0; if(isset($data ->financial_data->financial_plan_loans)) { foreach ($data ->financial_data->financial_plan_loans as $item) { $bp_loan_amount = $item->value; $bp_loan_periodic_rate = $item->rate/ 12; $bp_loan_interest_fee = $bp_loan_amount * $bp_loan_periodic_rate / 100; $bp_loan_monthly_payments_count = 12 * $item->duration; if ((((1 + ($bp_loan_periodic_rate / 100)) ** $bp_loan_monthly_payments_count) - 1)!=0){ $bp_loan_monthly_payment = $item->value * ($bp_loan_periodic_rate / 100) * ((1 + ($bp_loan_periodic_rate / 100)) ** $bp_loan_monthly_payments_count) / (((1 + ($bp_loan_periodic_rate / 100)) ** $bp_loan_monthly_payments_count) - 1); } for ($i = 1; $i <= $bp_loan_monthly_payments_count; $i++) { $i == 1 ? $current_remaining_reimbursment = $bp_loan_amount : $current_remaining_reimbursment = $previous_remaining_reimbursment; $previous_remaining_reimbursment = $current_remaining_reimbursment - ($bp_loan_monthly_payment - ($current_remaining_reimbursment * $bp_loan_periodic_rate / 100)); if ($i <= 12) { $bp_loans_first_year_total += ($current_remaining_reimbursment * $bp_loan_periodic_rate / 100); } elseif ($i > 12 && $i <= 24) { $bp_loans_second_year_total += ($current_remaining_reimbursment * $bp_loan_periodic_rate / 100); } elseif ($i > 24 && $i <= 36) { $bp_loans_third_year_total += ($current_remaining_reimbursment * $bp_loan_periodic_rate / 100); } elseif ($i > 36 && $i <= 48) { $bp_loans_four_year_total += ($current_remaining_reimbursment * $bp_loan_periodic_rate / 100); } elseif ($i > 48 && $i <= 60) { $bp_loans_five_year_total += ($current_remaining_reimbursment * $bp_loan_periodic_rate / 100); } } } } //////////////////////////////////// $Taux_interet=0; $differe=isset($data ->financial_data->duration_différe)?$data ->financial_data->duration_différe:0; $montant=0; $capital_rest=0; $capital_rem=0; $interets=0; $mensualite=0; $monthsCalcul=[]; $yearsCalcul=[]; $duree_pret=0; if(isset($data ->financial_data->financial_plan_loans)) { foreach ($data ->financial_data->financial_plan_loans as $item) { $Taux_interet=$item->rate/100; $montant=$item->value; $duree_pret=$item->duration; }} //dd($montant); $months=$duree_pret*12; //$mensualite=($montant*$Taux_interet)/(12*(1-pow(1+$Taux_interet/12,-$months+$differe))); $capital_rest_fee=0; $capital_rest_fee=$montant*(1+$Taux_interet*$differe/12); $capital_rest_zero=round($montant,2); //dd($capital_rest); for ($i=0; $i < $months ; $i++) { //dd($mensualite); if($i>=$differe){ $mensualite=round(($capital_rest_fee*($Taux_interet/12))/(1-pow(1+$Taux_interet/12,-$months+$differe)),2); $i==0 ? $capital_rest=$montant : $capital_rest=$capital_rest; $interets=round(($capital_rest*$Taux_interet)/12,2); $capital_rem= round($mensualite-$interets,2); $capital_rest= round($capital_rest,2)-($mensualite-$interets) ; }else{ $i==0 ? $capital_rest= $capital_rest_zero+round(($capital_rest_zero*$Taux_interet*1/12),2) : $capital_rest=0; $mensualite=0; $interets=0; $capital_rem= 0; $capital_rest=$capital_rest_zero+round(($capital_rest_zero*(($Taux_interet)*($i+1)/12)),2); } array_push($monthsCalcul,(object) ["mensualite"=>$mensualite,"interets"=>$interets,"capital_rem"=>$capital_rem,"capital_rest"=>$capital_rest]); } for ($i=1; $i <= $duree_pret; $i++) { $mensualiteYear=0; $interetsYear=0; $capital_remYear=0; $capital_restYear=0; for ($j=($i-1)*12; $j < $i*12; $j++) { if($j>=count($monthsCalcul))break; $mensualiteYear += $monthsCalcul[$j]->mensualite; $interetsYear += $monthsCalcul[$j]->interets; $capital_remYear += $monthsCalcul[$j]->capital_rem; $capital_restYear = $monthsCalcul[$j]->capital_rest; } array_push($yearsCalcul,(object) ["mensualite"=>$mensualiteYear,"interets"=>$interetsYear,"capital_rem"=>$capital_remYear,"capital_rest"=>$capital_restYear]); } // foreach ($monthsCalcul as $key => $monthData) { // dd($monthData->interets); // } //dd($yearsCalcul); //dd($monthsCalcul); // foreach ($yearsCalcul as $key => $yearData) { // dd( number_format($yearData->mensualite,10,'','')); // } //Turnover $taxe_impot_first_year=0; $taxe_impot_second_year=0; $taxe_impot_third_year=0; $taxe_impot_four_year=0; $taxe_impot_five_year=0; $total_impot_taxe1=0; $total_impot_taxe2=0; $total_impot_loyer=0; $imp_project=isset($data->company->implantation_project)?$data->company->implantation_project:''; //dd($data->company->implantation_project); $taxe=0; $total_taxe1 =0; $total_taxe2 =0; if($imp_project=='Urbain'){ $taxe=0.105 ; }elseif($imp_project=='Rural'){ $taxe=0.065 ; } if(isset($data->financial_data->overheads_fixed)){ foreach ($data->financial_data->overheads_fixed as $item) { if($item->label=='loyer'|| $item->label=='loyers'|| $item->label=='Loyer'){ $total_impot_taxe1= $item->value*12*$taxe; }} } if(isset($data->financial_data->overheads_fixed)){ foreach ($data->financial_data->overheads_fixed as $item) { if($item->label=='loyer'|| $item->label=='loyers'|| $item->label=='Loyer'){ $total_impot_loyer= $item->value*12; }} } if(isset($data->financial_data->startup_needs)){ foreach ($data->financial_data->startup_needs as $item) { if(isset($item->label)){ if($item->label !='Frais preliminaires' && $item->label !='Matériel de transport' ){ $total_impot_taxe2+=($item->value/(1+($item->duration/100))*0.03)*$taxe; }} } } $total_autre_taxe=0; if(isset($data->financial_data->taxes)){ foreach ($data->financial_data->taxes as $item) { $total_autre_taxe+= $item->value; } } $taxe_impot_first_year=$total_impot_taxe1+$total_impot_taxe2+ $total_autre_taxe; $taxe_impot_second_year=$total_impot_taxe1+$total_impot_taxe2+ $total_autre_taxe; $taxe_impot_third_year=$total_impot_taxe1+$total_impot_taxe2 + $total_autre_taxe; $taxe_impot_four_year=($total_impot_taxe1*1.1)+$total_impot_taxe2 + $total_autre_taxe; $taxe_impot_five_year=($total_impot_taxe1*1.1)+$total_impot_taxe2+ $total_autre_taxe; /////////// $bp_turnover_first_year =0; $bp_turnover_second_year=0; $bp_turnover_third_year=0; $bp_turnover_four_year=0; $bp_turnover_five_year=0; if($bp_evolution_rate>0){ $bp_turnover_first_year = $bp_turnover_products_totals; $bp_turnover_second_year = ($bp_turnover_first_year * (1+$bp_evolution_rate / 100)); $bp_turnover_third_year = ($bp_turnover_second_year * (1+$bp_evolution_rate / 100)); $bp_turnover_four_year = ($bp_turnover_third_year * (1+$bp_evolution_rate / 100)); $bp_turnover_five_year = ($bp_turnover_four_year * (1+$bp_evolution_rate / 100)); }else{ $bp_turnover_first_year =$bp_turnover_products_totals; $bp_turnover_second_year=$bp_turnover_products_totals; $bp_turnover_third_year=$bp_turnover_products_totals; $bp_turnover_four_year=$bp_turnover_products_totals; $bp_turnover_five_year=$bp_turnover_products_totals; } if($bp_evolution_rate>0){ $bp_purchase_first_year = $bp_turnover_products_total ; $bp_purchase_second_year = $bp_purchase_first_year *(1+$bp_evolution_rate/100); $bp_purchase_third_year = $bp_purchase_second_year *(1+$bp_evolution_rate/100); $bp_purchase_four_year = $bp_purchase_third_year*(1+$bp_evolution_rate/100); $bp_purchase_five_year = $bp_purchase_four_year *(1+$bp_evolution_rate/100); }else{ $bp_purchase_first_year = $bp_turnover_products_total ; $bp_purchase_second_year = $bp_turnover_products_total ; $bp_purchase_third_year = $bp_turnover_products_total ; $bp_purchase_four_year = $bp_turnover_products_total ; $bp_purchase_five_year = $bp_turnover_products_total ; } // Gross Margin $bp_gross_margin_first_year = $bp_turnover_first_year - $bp_purchase_first_year; //dd($bp_purchase_first_year); $bp_gross_margin_second_year = $bp_turnover_second_year - $bp_purchase_second_year; $bp_gross_margin_third_year = $bp_turnover_third_year - $bp_purchase_third_year; $bp_gross_margin_four_year = $bp_turnover_four_year - $bp_purchase_four_year; $bp_gross_margin_five_year = $bp_turnover_five_year - $bp_purchase_five_year; $bp_overheads_fixed_first_year = 0; $bp_overheads_fixed_second_year = 0; $bp_overheads_fixed_third_year = 0; $bp_overheads_fixed_four_year=0; $bp_overheads_fixed_five_year =0; if(isset($data ->financial_data->overheads_fixed)) { foreach ($data ->financial_data->overheads_fixed as $item) { if(isset($item->otherValue)){ if($item->label!='loyer'){ if($item->otherValue=='Annuel'){ $bp_overheads_fixed_first_year += $item->value; $bp_overheads_fixed_second_year += $item->value; $bp_overheads_fixed_third_year += $item->value; $bp_overheads_fixed_four_year += $item->value ; $bp_overheads_fixed_five_year += $item->value; }elseif($item->otherValue=='Mensuel'){ $bp_overheads_fixed_first_year += $item->value*12; $bp_overheads_fixed_second_year += $item->value*12; $bp_overheads_fixed_third_year += $item->value*12; $bp_overheads_fixed_four_year += $item->value *12; $bp_overheads_fixed_five_year += $item->value*12; } } } } } //dd($bp_overheads_fixed_first_year); // Overheads Scalable $total_charge_var=0; if(isset($data ->financial_data->overheads_scalable)){ foreach ($data ->financial_data->overheads_scalable as $item) { if(isset($item->otherValue)){ if($item->otherValue=='Annuel'){ $total_charge_var += $item->value; }elseif($item->otherValue=='Mensuel'){ $total_charge_var += $item->value*12; } } }} $bp_overheads_scalable_first_year = 0; $bp_overheads_scalable_second_year = 0; $bp_overheads_scalable_third_year = 0; $bp_overheads_scalable_four_year=0; $bp_overheads_scalable_five_year=0; if($bp_evolution_rate>0){ if(isset($data ->financial_data->overheads_scalable)){ foreach ($data ->financial_data->overheads_scalable as $item) { if(isset($item->otherValue)){ if($item->otherValue=='Annuel'){ $bp_overheads_scalable_first_year += $item->value; }elseif($item->otherValue=='Mensuel'){ $bp_overheads_scalable_first_year += $item->value*$saisonalite; } $bp_overheads_scalable_second_year = $bp_overheads_scalable_first_year* (1+$bp_evolution_rate / 100); $bp_overheads_scalable_third_year = $bp_overheads_scalable_second_year*(1+$bp_evolution_rate / 100); $bp_overheads_scalable_four_year = $bp_overheads_scalable_third_year *(1+$bp_evolution_rate / 100); $bp_overheads_scalable_five_year = $bp_overheads_scalable_four_year* (1+$bp_evolution_rate / 100); } } } }else{ $bp_overheads_scalable_first_year = $total_charge_var; $bp_overheads_scalable_second_year = $total_charge_var; $bp_overheads_scalable_third_year = $total_charge_var; $bp_overheads_scalable_four_year=$total_charge_var; $bp_overheads_scalable_five_year=$total_charge_var; } //autre charge externe $autre_charge_externe_first_year=0; $autre_charge_externe_second_year=0; $autre_charge_externe_third_year=0; $autre_charge_externe_four_year=0; $autre_charge_externe_five_year=0; $autre_charge_externe_first_year=$bp_overheads_scalable_first_year+$bp_overheads_fixed_first_year+$total_impot_loyer; $autre_charge_externe_second_year=$bp_overheads_scalable_second_year+$bp_overheads_fixed_second_year+$total_impot_loyer ; $autre_charge_externe_third_year=$bp_overheads_scalable_third_year+$bp_overheads_fixed_third_year+$total_impot_loyer ; $autre_charge_externe_four_year=$bp_overheads_scalable_four_year+$bp_overheads_fixed_four_year+$total_impot_loyer*1.1 ; $autre_charge_externe_five_year=$bp_overheads_scalable_five_year+$bp_overheads_fixed_five_year+$total_impot_loyer*1.1 ; //dd($bp_overheads_scalable_first_year); // Added Value $bp_added_value_first_year = $bp_gross_margin_first_year - $autre_charge_externe_first_year; $bp_added_value_second_year = $bp_gross_margin_second_year - $autre_charge_externe_second_year; $bp_added_value_third_year = $bp_gross_margin_third_year - $autre_charge_externe_third_year; $bp_added_value_four_year = $bp_gross_margin_four_year - $autre_charge_externe_four_year; $bp_added_value_five_year = $bp_gross_margin_five_year - $autre_charge_externe_five_year; // Human Ressources $bp_human_ressources_total = 0; $bp_human_ressources_rows = 0; $nombre_salary=0; if(isset($data ->financial_data->human_ressources)) { foreach ($data ->financial_data->human_ressources as $item) { if(isset($item->duration)){ if($item->duration==0){ $nombre_salary+=$item->value; $bp_human_ressources_total += ($item->value * $item->rate*12); }else{ $bp_human_ressources_total += ($item->value * $item->rate*$item->duration); $nombre_salary+=$item->value; } $bp_human_ressources_rows++; } } } if(isset($data->business_model_arab->nombre_ress)){ $nombre_salary = $data->business_model_arab->nombre_ress; } $bp_human_ressources_social_fees_total = $bp_human_ressources_total * 0.2109; $bp_human_ressources_social_assurance=$bp_human_ressources_total*0.03; $total_frais_personnel= $bp_human_ressources_total+$bp_human_ressources_social_fees_total +$bp_human_ressources_social_assurance; $bp_taxes_total = 0; if(isset($data ->financial_data->taxes)) { foreach ($data ->financial_data->taxes as $item) { $bp_taxes_total += $item->value; } } // Gross Surplus $gross_surplus_first_year = $bp_added_value_first_year -$total_frais_personnel- $taxe_impot_first_year; $gross_surplus_second_year = $bp_added_value_second_year -$total_frais_personnel- $taxe_impot_second_year; $gross_surplus_third_year = $bp_added_value_third_year - $total_frais_personnel*1.05- $taxe_impot_third_year; $gross_surplus_four_year = $bp_added_value_four_year - $total_frais_personnel*1.05- $taxe_impot_four_year; $gross_surplus_five_year = $bp_added_value_five_year - $total_frais_personnel*1.05- $taxe_impot_five_year; // $gross_surplus_first_year = $bp_gross_margin_first_year - ( $bp_overheads_scalable_first_year+$bp_overheads_fixed_first_year); // $gross_surplus_second_year = $bp_added_value_second_year - $bp_human_ressources_total - $bp_human_ressources_social_fees_total - $bp_taxes_total; // $gross_surplus_third_year = $bp_added_value_third_year - $bp_human_ressources_total - $bp_human_ressources_social_fees_total - $bp_taxes_total; // $gross_surplus_four_year = $bp_added_value_four_year - $bp_human_ressources_total - $bp_human_ressources_social_fees_total - $bp_taxes_total; // $gross_surplus_five_year = $bp_added_value_five_year - $bp_human_ressources_total - $bp_human_ressources_social_fees_total - $bp_taxes_total; // dd( $bp_added_value_five_year); // Amortization $bp_amortization_yearly = 0; if (isset($data ->financial_data->startup_needs)) { foreach ($data ->financial_data->startup_needs as $item) { // dd( $item); (isset($item->value) && isset($item->rate) && isset($item->duration)) ? $bp_amortization_yearly += ($item->value/(1+$item->duration/100))*$item->rate/100 : NULL; } } //dd($bp_amortization_yearly); // Gross Income $bp_gross_income_first_year = $gross_surplus_first_year - $bp_amortization_yearly ; $bp_gross_income_second_year = $gross_surplus_second_year - $bp_amortization_yearly ; $bp_gross_income_third_year = $gross_surplus_third_year - $bp_amortization_yearly ; $bp_gross_income_four_year = $gross_surplus_four_year - $bp_amortization_yearly ; $bp_gross_income_five_year = $gross_surplus_five_year - $bp_amortization_yearly ; //dd( $bp_gross_income_four_year ); // Financial Products $bp_financial_products_first_year = 0; $bp_financial_products_second_year = 0; $bp_financial_products_third_year = 0; $bp_financial_products_four_year = 0; $bp_financial_products_five_year = 0; $bp_financial_expenses_first_year=0; $bp_financial_expenses_second_year=0; $bp_financial_expenses_third_year=0; $bp_financial_expenses_four_year=0; $bp_financial_expenses_five_year=0; //dd($yearsCalcul[0]->interets); foreach ($yearsCalcul as $key => $yearData) { //dd($key); if($key==0){ $bp_financial_expenses_first_year = $yearData->interets; } elseif ($key==1) { $bp_financial_expenses_second_year = $yearData->interets; }elseif ($key==2) { $bp_financial_expenses_third_year = $yearData->interets; } elseif ($key==3) { $bp_financial_expenses_four_year = $yearData->interets; } elseif($key==4) { $bp_financial_expenses_five_year = $yearData->interets; } } // Financial Expenses // Financial Result $bp_financial_result_first_year = $bp_financial_products_first_year - $bp_financial_expenses_first_year; $bp_financial_result_second_year = $bp_financial_products_second_year - $bp_financial_expenses_second_year; $bp_financial_result_third_year = $bp_financial_products_third_year - $bp_financial_expenses_third_year; $bp_financial_result_four_year = $bp_financial_products_four_year - $bp_financial_expenses_four_year; $bp_financial_result_five_year = $bp_financial_products_five_year - $bp_financial_expenses_five_year; // Current Result $bp_current_result_first_year = $bp_gross_income_first_year + $bp_financial_result_first_year; $bp_current_result_second_year = $bp_gross_income_second_year + $bp_financial_result_second_year; $bp_current_result_third_year = $bp_gross_income_third_year + $bp_financial_result_third_year; $bp_current_result_four_year = $bp_gross_income_four_year + $bp_financial_result_four_year; $bp_current_result_five_year = $bp_gross_income_five_year + $bp_financial_result_five_year; // dd( $bp_current_result_five_year); //dd($bp_financial_result_third_year); // Income Before Taxes $bp_income_before_taxes_first_year = $bp_current_result_first_year; $bp_income_before_taxes_second_year = $bp_current_result_second_year; $bp_income_before_taxes_third_year = $bp_current_result_third_year; $bp_income_before_taxes_four_year = $bp_current_result_four_year; $bp_income_before_taxes_five_year = $bp_current_result_five_year; // Corporate Taxe $bp_corporate_tax_first_year = 0; $bp_corporate_tax_second_year = 0; $bp_corporate_tax_third_year = 0; $bp_corporate_tax_four_year=0; $bp_corporate_tax_five_year=0; $is=0; $rest=0; if (($data ->company->applied_tax ?? '') == 'IS') { // dd($bp_income_before_taxes_first_year); switch (true) { case ($bp_income_before_taxes_first_year > 0 && $bp_income_before_taxes_first_year <= 300000): $is=$bp_income_before_taxes_first_year * 10 / 100; $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 10 / 100; if($bp_corporate_tax_first_year <3000){ $bp_corporate_tax_first_year =3000; } break; case ($bp_income_before_taxes_first_year > 300000 && $bp_income_before_taxes_first_year <= 1000000): // $firstTranche = 300000 - 300000 * 0.1; //$secondTranche = $bp_income_before_taxes_first_year * 0.2; $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 0.2; //$bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 17.5 / 100; break; case ($bp_income_before_taxes_first_year > 1000000): // $rest = $bp_income_before_taxes_first_year - 300000; // $firstTranche = 300000 - 300000 * 0.1; // $rest = $rest - 1000000; // $secondTranche = 1000000 - 1000000 * 0.2; // if ($rest < 0) { // $rest = 0; // } // $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year* 0.31; break; } switch (true) { case ($bp_income_before_taxes_second_year > 0 && $bp_income_before_taxes_second_year<= 300000): $bp_corporate_tax_second_year = $bp_income_before_taxes_second_year * 10 / 100; break; case ($bp_income_before_taxes_second_year > 300000 && $bp_income_before_taxes_second_year <= 1000000): $bp_corporate_tax_second_year = $bp_income_before_taxes_second_year *0.2; break; case ($bp_income_before_taxes_second_year > 1000000): $bp_corporate_tax_second_year = $bp_income_before_taxes_second_year *0.31; break; } switch (true) { case ($bp_income_before_taxes_third_year> 0 && $bp_income_before_taxes_third_year <= 300000): // $is=$bp_income_before_taxes_first_year * 10 / 100; $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 10 / 100; break; case ($bp_income_before_taxes_third_year > 300000 && $bp_income_before_taxes_third_year <= 1000000): // $firstTranche = 300000 - 300000 * 0.1; // $secondTranche = $bp_income_before_taxes_third_year - 300000 - ($bp_income_before_taxes_third_year - 300000) * 0.2; $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year*0.2; // $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 17.5 / 100; break; case ($bp_income_before_taxes_third_year > 1000000): // $rest = $bp_income_before_taxes_third_year - 300000; // $firstTranche = 300000 - 300000 * 0.1; // $rest = $rest - 1000000; // $secondTranche = 1000000 - 1000000 * 0.2; // if ($rest < 0) { // $rest = 0; // } // $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year*0.31; //$bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 31 / 100; break; } switch (true) { case ($bp_income_before_taxes_four_year> 0 && $bp_income_before_taxes_four_year <= 300000): $is=$bp_income_before_taxes_four_year * 10 / 100; $bp_corporate_tax_four_year = $bp_income_before_taxes_four_year * 10 / 100; // $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 10 / 100; break; case ($bp_income_before_taxes_four_year > 300000 && $bp_income_before_taxes_four_year <= 1000000): // $firstTranche = 300000 - 300000 * 0.1; // $secondTranche = $bp_income_before_taxes_four_year - 300000 - ($bp_income_before_taxes_four_year - 300000) * 0.2; $bp_corporate_tax_four_year = $bp_income_before_taxes_four_year*0.2; // $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 17.5 / 100; break; case ($bp_income_before_taxes_four_year > 1000000): // $rest = $bp_income_before_taxes_four_year - 300000; // $firstTranche = 300000 - 300000 * 0.1; // $rest = $rest - 1000000; // $secondTranche = 1000000 - 1000000 * 0.2; // if ($rest < 0) { // $rest = 0; // } // $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_four_year = $bp_income_before_taxes_four_year*0.31; //$bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 31 / 100; break; } switch (true) { case ($bp_income_before_taxes_five_year> 0 && $bp_income_before_taxes_five_year <= 300000): $is=$bp_income_before_taxes_five_year * 10 / 100; $bp_corporate_tax_five_year = $bp_income_before_taxes_five_year * 10 / 100; // $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 10 / 100; break; case ($bp_income_before_taxes_five_year > 300000 && $bp_income_before_taxes_five_year <= 1000000): // $firstTranche = 300000 - 300000 * 0.1; // $secondTranche = $bp_income_before_taxes_five_year - 300000 - ($bp_income_before_taxes_five_year - 300000) * 0.2; $bp_corporate_tax_five_year = $bp_income_before_taxes_five_year*0.2; // $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 17.5 / 100; break; case ($bp_income_before_taxes_five_year > 1000000): // $rest = $bp_income_before_taxes_five_year - 300000; // $firstTranche = 300000 - 300000 * 0.1; // $rest = $rest - 1000000; // $secondTranche = 1000000 - 1000000 * 0.2; // if ($rest < 0) { // $rest = 0; // } // $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_five_year = $bp_income_before_taxes_five_year*0.31; //$bp_corporate_tax_third_year = $bp_income_before_taxes_third_year * 31 / 100; break; } } elseif (($data ->company->applied_tax ?? '') == 'IR') { // dd($bp_income_before_taxes_second_year); switch (true) { case ($bp_income_before_taxes_first_year > 0 && $bp_income_before_taxes_first_year <= 30000): $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year; break; case ($bp_income_before_taxes_first_year > 30000 && $bp_income_before_taxes_first_year <= 50000): $is = $bp_income_before_taxes_first_year * 10 / 100; $bp_corporate_tax_first_year = $is-$bp_income_before_taxes_first_year * 10 / 100; break; case ($bp_income_before_taxes_first_year > 50000 && $bp_income_before_taxes_first_year <= 60000): $firstTranche = 50000 - 50000 * 0.1; $secondTranche = $bp_income_before_taxes_first_year - 50000 - ($bp_income_before_taxes_first_year - 50000) * 0.2; $bp_corporate_tax_first_year = $firstTranche + $secondTranche; break; case ($bp_income_before_taxes_first_year > 60000 && $bp_income_before_taxes_first_year <= 80000): $rest = $bp_income_before_taxes_first_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; if ($rest < 0) { $rest = 0; } $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_first_year = $firstTranche + $secondTranche + $thirdTranche; break; case ($bp_income_before_taxes_first_year > 80000 && $bp_income_before_taxes_first_year <= 180000): $rest = $bp_income_before_taxes_first_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; if ($rest < 0) { $rest = 0; } $fourTranche = $rest - $rest * 0.34; $bp_corporate_tax_first_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche; // $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 34 / 100; break; case ($bp_income_before_taxes_first_year > 180000): $rest = $bp_income_before_taxes_first_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; $rest = $rest - 180000; $fourTranche = 180000 - 180000 * 0.34; if ($rest < 0) { $rest = 0; } $fiveTranche = $rest - $rest * 0.38; $bp_corporate_tax_first_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche + $fiveTranche; //$bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 38 / 100; break; } switch (true) { case ($bp_income_before_taxes_second_year > 0 && $bp_income_before_taxes_second_year <= 30000): $bp_corporate_tax_second_year = $bp_income_before_taxes_second_year; break; case ($bp_income_before_taxes_second_year > 30000 && $bp_income_before_taxes_second_year <= 50000): $is = $bp_income_before_taxes_second_year * 10 / 100; $bp_corporate_tax_second_year = $is-$bp_income_before_taxes_second_year * 10 / 100; break; case ($bp_income_before_taxes_second_year > 50000 && $bp_income_before_taxes_second_year <= 60000): $firstTranche = 50000 - 50000 * 0.1; $secondTranche = $bp_income_before_taxes_second_year - 50000 - ($bp_income_before_taxes_second_year - 50000) * 0.2; $bp_corporate_tax_second_year = $firstTranche + $secondTranche; break; case ($bp_income_before_taxes_second_year > 60000 && $bp_income_before_taxes_second_year <= 80000): $rest = $bp_income_before_taxes_second_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; if ($rest < 0) { $rest = 0; } $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_second_year = $firstTranche + $secondTranche + $thirdTranche; break; case ($bp_income_before_taxes_second_year > 80000 && $bp_income_before_taxes_second_year <= 180000): $rest = $bp_income_before_taxes_second_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; if ($rest < 0) { $rest = 0; } $fourTranche = $rest - $rest * 0.34; $bp_corporate_tax_second_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche; // $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 34 / 100; break; case ($bp_income_before_taxes_second_year > 180000): $rest = $bp_income_before_taxes_second_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; $rest = $rest - 180000; $fourTranche = 180000 - 180000 * 0.34; if ($rest < 0) { $rest = 0; } $fiveTranche = $rest - $rest * 0.38; $bp_corporate_tax_second_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche + $fiveTranche; //$bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 38 / 100; break; } switch (true) { case ($bp_income_before_taxes_third_year > 0 && $bp_income_before_taxes_third_year <= 30000): $bp_corporate_tax_third_year = $bp_income_before_taxes_third_year; break; case ($bp_income_before_taxes_third_year > 30000 && $bp_income_before_taxes_third_year <= 50000): $is = $bp_income_before_taxes_third_year * 10 / 100; $bp_corporate_tax_third_year = $is-$bp_income_before_taxes_third_year * 10 / 100; break; case ($bp_income_before_taxes_third_year > 50000 && $bp_income_before_taxes_third_year <= 60000): $firstTranche = 50000 - 50000 * 0.1; $secondTranche = $bp_income_before_taxes_third_year - 50000 - ($bp_income_before_taxes_third_year - 50000) * 0.2; $bp_corporate_tax_third_year = $firstTranche + $secondTranche; break; case ($bp_income_before_taxes_third_year > 60000 && $bp_income_before_taxes_third_year <= 80000): $rest = $bp_income_before_taxes_third_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; if ($rest < 0) { $rest = 0; } $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_third_year = $firstTranche + $secondTranche + $thirdTranche; break; case ($bp_income_before_taxes_third_year > 80000 && $bp_income_before_taxes_third_year <= 180000): $rest = $bp_income_before_taxes_third_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; if ($rest < 0) { $rest = 0; } $fourTranche = $rest - $rest * 0.34; $bp_corporate_tax_third_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche; // $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 34 / 100; break; case ($bp_income_before_taxes_third_year > 180000): $rest = $bp_income_before_taxes_third_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; $rest = $rest - 180000; $fourTranche = 180000 - 180000 * 0.34; if ($rest < 0) { $rest = 0; } $fiveTranche = $rest - $rest * 0.38; $bp_corporate_tax_third_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche + $fiveTranche; //$bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 38 / 100; break; } switch (true) { case ($bp_income_before_taxes_four_year > 0 && $bp_income_before_taxes_four_year <= 30000): $bp_corporate_tax_four_year = $bp_income_before_taxes_four_year; break; case ($bp_income_before_taxes_four_year > 30000 && $bp_income_before_taxes_four_year <= 50000): $is = $bp_income_before_taxes_four_year * 10 / 100; $bp_corporate_tax_four_year = $is-$bp_income_before_taxes_four_year * 10 / 100; break; case ($bp_income_before_taxes_four_year > 50000 && $bp_income_before_taxes_four_year <= 60000): $firstTranche = 50000 - 50000 * 0.1; $secondTranche = $bp_income_before_taxes_four_year - 50000 - ($bp_income_before_taxes_four_year - 50000) * 0.2; $bp_corporate_tax_four_year = $firstTranche + $secondTranche; break; case ($bp_income_before_taxes_four_year > 60000 && $bp_income_before_taxes_four_year <= 80000): $rest = $bp_income_before_taxes_four_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; if ($rest < 0) { $rest = 0; } $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_four_year = $firstTranche + $secondTranche + $thirdTranche; break; case ($bp_income_before_taxes_four_year > 80000 && $bp_income_before_taxes_four_year <= 180000): $rest = $bp_income_before_taxes_four_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; if ($rest < 0) { $rest = 0; } $fourTranche = $rest - $rest * 0.34; $bp_corporate_tax_four_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche; // $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 34 / 100; break; case ($bp_income_before_taxes_four_year > 180000): $rest = $bp_income_before_taxes_four_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; $rest = $rest - 180000; $fourTranche = 180000 - 180000 * 0.34; if ($rest < 0) { $rest = 0; } $fiveTranche = $rest - $rest * 0.38; $bp_corporate_tax_four_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche + $fiveTranche; //dd($bp_income_before_taxes_four_year); //dd($bp_corporate_tax_four_year); //$bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 38 / 100; break; } switch (true) { case ($bp_income_before_taxes_five_year > 0 && $bp_income_before_taxes_five_year <= 30000): $bp_corporate_tax_five_year = $bp_income_before_taxes_five_year; break; case ($bp_income_before_taxes_five_year > 30000 && $bp_income_before_taxes_five_year <= 50000): $is = $bp_income_before_taxes_five_year * 10 / 100; $bp_corporate_tax_five_year = $is-$bp_income_before_taxes_five_year * 10 / 100; break; case ($bp_income_before_taxes_five_year > 50000 && $bp_income_before_taxes_five_year <= 60000): $firstTranche = 50000 - 50000 * 0.1; $secondTranche = $bp_income_before_taxes_five_year - 50000 - ($bp_income_before_taxes_five_year - 50000) * 0.2; $bp_corporate_tax_five_year = $firstTranche + $secondTranche; break; case ($bp_income_before_taxes_five_year > 60000 && $bp_income_before_taxes_five_year <= 80000): $rest = $bp_income_before_taxes_third_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; if ($rest < 0) { $rest = 0; } $thirdTranche = $rest - $rest * 0.31; $bp_corporate_tax_five_year = $firstTranche + $secondTranche + $thirdTranche; break; case ($bp_income_before_taxes_five_year > 80000 && $bp_income_before_taxes_five_year <= 180000): $rest = $bp_income_before_taxes_third_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; if ($rest < 0) { $rest = 0; } $fourTranche = $rest - $rest * 0.34; $bp_corporate_tax_five_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche; // $bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 34 / 100; break; case ($bp_income_before_taxes_five_year > 180000): $rest = $bp_income_before_taxes_five_year - 50000; $firstTranche = 50000 - 50000 * 0.1; $rest = $rest - 60000; $secondTranche = 60000 - 60000 * 0.2; $rest = $rest - 80000; $thirdTranche = 80000 - 80000 * 0.3; $rest = $rest - 180000; $fourTranche = 180000 - 180000 * 0.34; if ($rest < 0) { $rest = 0; } $fiveTranche = $rest - $rest * 0.38; $bp_corporate_tax_five_year = $firstTranche + $secondTranche + $thirdTranche + $fourTranche + $fiveTranche; //$bp_corporate_tax_first_year = $bp_income_before_taxes_first_year * 38 / 100; break; } } elseif (($data ->company->applied_tax ?? '') == 'Auto-entrepreneur activité commerciale, industrielle ou artisanale') { $bp_corporate_tax_first_year =$bp_turnover_first_year * 0.5 / 100; $bp_corporate_tax_second_year =$bp_turnover_second_year* 0.5 / 100; $bp_corporate_tax_third_year = $bp_turnover_third_year * 0.5 / 100; $bp_corporate_tax_four_year = $bp_turnover_four_year * 0.5 / 100; $bp_corporate_tax_five_year = $bp_turnover_five_year * 0.5 / 100; } elseif (($data ->company->applied_tax ?? '') == 'Auto-entrepreneur prestataire de services') { $bp_corporate_tax_first_year = $bp_turnover_first_year * 1 / 100; $bp_corporate_tax_second_year = $bp_turnover_second_year* 1 / 100; $bp_corporate_tax_third_year =$bp_turnover_third_year * 1 / 100; $bp_corporate_tax_four_year =$bp_turnover_four_year * 1 / 100; $bp_corporate_tax_five_year =$bp_turnover_five_year * 1 / 100; } //dd( $bp_income_before_taxes_four_year); // Net Profiti $bp_net_profit_first_year = $bp_income_before_taxes_first_year - $bp_corporate_tax_first_year; $bp_net_profit_second_year = $bp_income_before_taxes_second_year - $bp_corporate_tax_second_year; $bp_net_profit_third_year = $bp_income_before_taxes_third_year - $bp_corporate_tax_third_year; $bp_net_profit_four_year = $bp_income_before_taxes_four_year - $bp_corporate_tax_four_year; $bp_net_profit_five_year = $bp_income_before_taxes_five_year - $bp_corporate_tax_five_year; // Cash Flow $bp_cash_flow_first_year = $bp_net_profit_first_year + $bp_amortization_yearly; $bp_cash_flow_second_year = $bp_net_profit_second_year + $bp_amortization_yearly; $bp_cash_flow_third_year = $bp_net_profit_third_year + $bp_amortization_yearly; $bp_cash_flow_four_year = $bp_net_profit_four_year + $bp_amortization_yearly; $bp_cash_flow_five_year = $bp_net_profit_five_year + $bp_amortization_yearly; $total_achat=0; $cumul_first_year= -$bp_investment_program_total+$bp_cash_flow_first_year ; $cumul_second_year=$cumul_first_year+$bp_cash_flow_second_year ; $cumul_third_year=$cumul_second_year+$bp_cash_flow_third_year ; $cumul_four_year=$cumul_third_year+$bp_cash_flow_four_year ; $cumul_five_year=$cumul_four_year+$bp_cash_flow_five_year ; // Profitability $bp_roi_delay=" "; if ( $cumul_first_year>0) { $bp_profitability_status = 'Rentable'; $bp_roi_delay = 'Dans 1 ans'; } elseif ($cumul_second_year > 0) { $bp_profitability_status = 'Rentable'; $bp_roi_delay = 'Dans 2 ans'; } elseif ($cumul_third_year > 0) { $bp_profitability_status = 'Rentable'; $bp_roi_delay = 'Dans 3 ans'; } elseif($cumul_four_year>0) { $bp_profitability_status = 'Défavorable'; $bp_roi_delay = 'Dans 4 ans'; }elseif($cumul_five_year>0) { $bp_profitability_status = 'Défavorable'; $bp_roi_delay = 'Dans 5 ans'; } @endphp fiche synthètique @if(isset($tablepage)) @foreach ($tablepage as $key =>$page) @if($key!=1 ) @endif @endforeach @endif @if(isset($data->business_model_arab->fiche_syn)) @foreach ($files as $item) @if($item!='') @endif @endforeach @endif