You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BusinessController.php 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <?php
  2. namespace App\Http\Controllers\Form;
  3. use Illuminate\Http\Request;
  4. use App\Http\Controllers\Controller;
  5. use Illuminate\Support\Facades\Auth;
  6. use App\Mail\CustomerBInvoice;
  7. use App\Jobs\SendCustomerInvoiceB;
  8. use Carbon\Carbon;
  9. use Validator;
  10. use File;
  11. use App\Model\Coverage;
  12. use App\Model\Product;
  13. use App\Model\Form;
  14. use App\Model\Subscriber;
  15. use App\Model\PackageDetail;
  16. use App\Model\FormStatus;
  17. use App\Staff;
  18. use App\Model\StaffDetail;
  19. class BusinessController extends Controller
  20. {
  21. public function successSubmit(){
  22. return view('sales.form.after_submit_form');
  23. }
  24. public function successVerified(){
  25. return view('sales.form.success_verify');
  26. }
  27. public function sendInvoice($subscriber_id) {
  28. $subscriber = Subscriber::with('Form')->where('subscriber_id',$subscriber_id)->first();
  29. $form = Form::with('Subscriber','PackageDetail')->where('_id',$subscriber->_id)->first();
  30. $product = Product::where('speed',$form->PackageDetail->name)->where('formT',$form->type_application)->first();
  31. SendCustomerInvoiceB::dispatch($form, $product, $form->Subscriber->email);
  32. return $form->_id;
  33. }
  34. function random_code($limit) {
  35. return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit);
  36. }
  37. public function viewFormAddress($package) {
  38. $dealer_id = '';
  39. $coverage = Coverage::where('Type','B')->orderBy('building_name')->get();
  40. return view('sales.form.business_address', compact('coverage','package','dealer_id'));
  41. }
  42. public function viewFormApplication(Request $request) {
  43. $data = array();
  44. array_push($data, array(
  45. 'coverage' => $request->coverage,
  46. 'unit' => $request->unit,
  47. 'street' => $request->street,
  48. 'package' => $request->package
  49. ));
  50. return view('sales.form.business_application_information', compact('data'));
  51. }
  52. public function viewFormPackage(Request $request)
  53. {
  54. $data = array();
  55. array_push($data, array(
  56. 'coverage' => $request->coverage,
  57. 'unit' => $request->unit,
  58. 'street' => $request->street,
  59. 'package' => $request->package,
  60. 'application' => $request->application,
  61. 'company_name' => $request->company_name,
  62. 'company_register' => $request->company_register,
  63. 'company_number' => $request->company_number,
  64. 'company_fax' => $request->company_fax,
  65. 'full_name' => $request->full_name,
  66. 'nric_passport' => $request->nric_passport,
  67. 'designation' => $request->designation,
  68. 'contact_primary' => $request->contact_primary,
  69. 'contact_secondary' => $request->contact_secondary,
  70. 'email' => $request->email,
  71. ));
  72. $pg = $request->package;
  73. return view('sales.form.business_package', compact('data','pg'));
  74. }
  75. public function viewFormPreview(Request $request){
  76. $data = array();
  77. $coverage = Coverage::where('_id',$request->coverage)->first();
  78. $product = Product::where('formT','B')->where('package_name',$request->package)->first();
  79. $otc = 0.0;
  80. $total_monthly = 0;
  81. $gst ='';
  82. $promo_st = '';
  83. $voice = "No";
  84. if($request->voice == "Yes"){
  85. $voice = $request->voice;
  86. $voice_price = 20;
  87. }else {
  88. $voice = "No";
  89. $voice_price = 0;
  90. }
  91. $ip_fee = 0; $ip_tax = 0;
  92. if ($request->ip == "1 Fixed IP RM200/1P/Month") {
  93. $ip_fee = 200 ;
  94. $ip_tax = number_format((floatval($ip_fee) * 1.06),2);
  95. }elseif ($request->ip == "5 Fixed IP RM400/1P/Month") {
  96. $ip_fee = 400;
  97. $ip_tax = number_format((floatval($ip_fee) * 1.06),2);
  98. }
  99. if ($request->package != "1Gbps" && $request->subscription == '24'){
  100. $promo_price = number_format(floatval($product->retail_price) - 10);
  101. $promo_st = number_format(floatval($promo_price) * 1.06,2);
  102. $total_monthly = number_format($promo_st + ($voice_price * 1.06) + $ip_tax, 2);
  103. }
  104. else if ($request->package == "1Gbps"){
  105. if ($request->ip == "1 Fixed IP RM200/1P/Month") {
  106. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  107. $total_monthly = 3920.94;
  108. }elseif ($request->ip == "5 Fixed IP RM400/1P/Month") {
  109. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  110. $total_monthly = 4132.94;
  111. }else{
  112. $gst = 3708.94;
  113. $total_monthly = 3708.94;
  114. }
  115. }else{
  116. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  117. $total_monthly = number_format($gst + ($voice_price * 1.06) + $ip_tax, 2);
  118. }
  119. if($request->subscription == '12' && $voice == 'No'){
  120. $otc = 300;
  121. $deposit = $product->deposit;
  122. }else if( $request->subscription == '12' && $voice == 'Yes'){
  123. $otc = 300 + 100;
  124. $deposit = $product->deposit;
  125. }else {
  126. $otc = 0.0;
  127. $deposit = $product->deposit;
  128. }
  129. $otc_st = number_format(floatval($otc) * 1.06,2);
  130. $upfront_total = number_format(floatval($otc_st) + $deposit,2);
  131. $total = number_format((floatval($product->retail_price) * 1.06) + ($otc * 1.06) + $deposit + $ip_tax, 2);
  132. array_push($data, array(
  133. 'coverage' => $request->coverage,
  134. 'unit' => $request->unit,
  135. 'street' => $request->street,
  136. 'package' => $request->package,
  137. 'application' => $request->application,
  138. 'company_name' => $request->company_name,
  139. 'company_register' => $request->company_register,
  140. 'company_number' => $request->company_number,
  141. 'company_fax' => $request->company_fax,
  142. 'full_name' => $request->full_name,
  143. 'nric_passport' => $request->nric_passport,
  144. 'designation' => $request->designation,
  145. 'contact_primary' => $request->contact_primary,
  146. 'contact_secondary' => $request->contact_secondary,
  147. 'email' => $request->email,
  148. 'subscription' => $request->subscription,
  149. 'billing' => $request->billing,
  150. 'voice' => $voice,
  151. 'ip' => $request->ip,
  152. 'ip_fee' => $ip_fee,
  153. 'ip_tax' => $ip_tax,
  154. 'thedate' => $request->thedate,
  155. ));
  156. return view('sales.form.business_preview', compact('data','coverage','product','deposit','otc', 'otc_st','gst','promo_price','promo_st','total_monthly', 'upfront_total'));
  157. }
  158. public function storeFormData(Request $request){
  159. $su_id = ''; $pathIconF = ''; $pathIconB = ''; $pathForm9 = '';
  160. do {
  161. $su_id = strtoupper('CBB-'.$this->random_code(6).'B');
  162. } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
  163. $destinationPath = 'document/'.$su_id;
  164. // create folder/dir if not exist
  165. if(!File::exists(public_path().'/'.$destinationPath)){
  166. File::makeDirectory(public_path().'/'.$destinationPath,0777,true);
  167. }
  168. if($request->hasfile('front_ic')){
  169. $icon = $request->file('front_ic');
  170. $icon->move($destinationPath,'frontic.'.$icon->getClientOriginalExtension());
  171. $pathIconF = '/'.$destinationPath.'/frontic.'.$icon->getClientOriginalExtension();
  172. }
  173. if($request->hasfile('back_ic')){
  174. $icon = $request->file('back_ic');
  175. $icon->move($destinationPath,'backic.'.$icon->getClientOriginalExtension());
  176. $pathIconB = '/'.$destinationPath.'/backic.'.$icon->getClientOriginalExtension();
  177. }
  178. if($request->hasfile('form9')){
  179. $icon = $request->file('form9');
  180. $icon->move($destinationPath,'formD.'.$icon->getClientOriginalExtension());
  181. $pathForm9 = '/'.$destinationPath.'/formD.'.$icon->getClientOriginalExtension();
  182. }
  183. if($pathForm9 != '' && $pathIconB != '' && $pathIconF != ''){
  184. $coverage = Coverage::where('_id',$request->coverage)->first();
  185. $product = Product::where('formT','B')->where('package_name',$request->package)->first();
  186. $sl = Form::create([
  187. 'type_service' => $request->application,
  188. 'type_application' => 'B',
  189. 'project_type' => $coverage->project_type,
  190. 'status_payment' => 'paid',
  191. 'status_email' => 'unverified',
  192. 'remark_form' => ''
  193. ]);
  194. $sdl = new Subscriber();
  195. $sdl->subscriber_id = $su_id;
  196. $sdl->name = $request->full_name;
  197. $sdl->ic = $request->nric_passport;
  198. $sdl->company_name = $request->company_name;
  199. $sdl->company_reg = $request->company_register;
  200. $sdl->company_num = $request->company_number;
  201. $sdl->company_fax = $request->company_fax;
  202. $sdl->designation = $request->designation;
  203. $sdl->email = $request->email;
  204. $sdl->phone1 = $request->contact_primary;
  205. $sdl->phone2 = $request->contact_secondary;
  206. $sdl->unit_no = $request->unit;
  207. $sdl->building_name = $coverage->building_name;
  208. $sdl->street = $request->street;
  209. $sdl->postcode = $coverage->postcode;
  210. $sdl->city = $coverage->city;
  211. $sdl->state = $coverage->state;
  212. $sdl->front_ic = $pathIconF;
  213. $sdl->back_ic = $pathIconB;
  214. $sdl->form9_44 = $pathForm9;
  215. $packageD = new PackageDetail();
  216. $packageD->contract = $request->subscription;
  217. $packageD->name = $product->speed;
  218. if ($request->gst != null){
  219. $packageD->montly_fee = $request->gst;
  220. }else {
  221. $packageD->montly_fee = $request->promo_st;
  222. }
  223. $packageD->voice_fee = $request->voice;
  224. $packageD->ip = $request->ip;
  225. $packageD->deposit = $request->deposit;
  226. $packageD->upfront_payment = $request->otc;
  227. $packageD->ip_tax = $request->ip_tax;
  228. $packageD->rfs = $request->rfs;
  229. $sl->subscriber()->save($sdl);
  230. $sl->packagedetail()->save($packageD);
  231. $f_id = $this->sendInvoice($su_id);
  232. $stat = new FormStatus();
  233. $stat->form_id = $f_id;
  234. $stat->status_id = 1;
  235. $stat->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
  236. $stat->status = 'Submitted';
  237. $stat->desc = 'The form already been submit';
  238. $sl->formstatus()->save($stat);
  239. return redirect('http://db.citybroadband.my/business/application-form/success-submit');
  240. }
  241. }
  242. /***
  243. ** Dealer
  244. ***/
  245. public function viewFormAddressD($package,$dealer_id) {
  246. $coverage = Coverage::where('Type','B')->orderBy('building_name')->get();
  247. return view('sales.form.dealer.business_address', compact('coverage','package','dealer_id'));
  248. }
  249. public function viewFormApplicationD(Request $request) {
  250. $data = array();
  251. array_push($data, array(
  252. 'coverage' => $request->coverage,
  253. 'unit' => $request->unit,
  254. 'street' => $request->street,
  255. 'package' => $request->package,
  256. 'dealer_id' => $request->dealer_id,
  257. ));
  258. return view('sales.form.dealer.business_application_information', compact('data'));
  259. }
  260. public function viewFormPackageD(Request $request)
  261. {
  262. $data = array();
  263. array_push($data, array(
  264. 'coverage' => $request->coverage,
  265. 'unit' => $request->unit,
  266. 'street' => $request->street,
  267. 'package' => $request->package,
  268. 'application' => $request->application,
  269. 'company_name' => $request->company_name,
  270. 'company_register' => $request->company_register,
  271. 'company_number' => $request->company_number,
  272. 'company_fax' => $request->company_fax,
  273. 'full_name' => $request->full_name,
  274. 'nric_passport' => $request->nric_passport,
  275. 'ip' => $request->ip,
  276. 'designation' => $request->designation,
  277. 'contact_primary' => $request->contact_primary,
  278. 'contact_secondary' => $request->contact_secondary,
  279. 'email' => $request->email,
  280. 'dealer_id' => $request->dealer_id,
  281. ));
  282. $pg = $request->package;
  283. return view('sales.form.dealer.business_package', compact('data','pg'));
  284. }
  285. public function viewFormPreviewD(Request $request){
  286. $data = array();
  287. $coverage = Coverage::where('_id',$request->coverage)->first();
  288. $product = Product::where('formT','B')->where('package_name',$request->package)->first();
  289. $otc = 0.0;
  290. $total_monthly = 0;
  291. $gst ='';
  292. $promo_st = '';
  293. $voice = "No";
  294. if($request->voice == "Yes"){
  295. $voice = $request->voice;
  296. $voice_price = 20;
  297. }else {
  298. $voice = "No";
  299. $voice_price = 0;
  300. }
  301. $ip_fee = 0; $ip_tax = 0;
  302. if ($request->ip == "1 Fixed IP RM200/1P/Month") {
  303. $ip_fee = 200 ;
  304. $ip_tax = number_format((floatval($ip_fee) * 1.06),2);
  305. }elseif ($request->ip == "5 Fixed IP RM400/1P/Month") {
  306. $ip_fee = 400;
  307. $ip_tax = number_format((floatval($ip_fee) * 1.06),2);
  308. }
  309. if ($request->package != "1Gbps" && $request->subscription == '24'){
  310. $promo_price = number_format(floatval($product->retail_price) - 10);
  311. $promo_st = number_format(floatval($promo_price) * 1.06,2);
  312. $total_monthly = number_format($promo_st + ($voice_price * 1.06) + $ip_tax, 2);
  313. }
  314. else if ($request->package == "1Gbps"){
  315. if ($request->ip == "1 Fixed IP RM200/1P/Month") {
  316. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  317. $total_monthly = 3920.94;
  318. }elseif ($request->ip == "5 Fixed IP RM400/1P/Month") {
  319. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  320. $total_monthly = 4132.94;
  321. }else{
  322. $gst = 3708.94;
  323. $total_monthly = 3708.94;
  324. }
  325. }
  326. else{
  327. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  328. $total_monthly = number_format($gst + ($voice_price * 1.06) + $ip_tax, 2);
  329. }
  330. if($request->subscription == '12' && $voice == 'No'){
  331. $otc = 300;
  332. $deposit = $product->deposit;
  333. }else if( $request->subscription == '12' && $voice == 'Yes'){
  334. $otc = 300 + 100;
  335. $deposit = $product->deposit;
  336. }else {
  337. $otc = 0.0;
  338. $deposit = $product->deposit;
  339. }
  340. $otc_st = number_format(floatval($otc) * 1.06,2);
  341. $upfront_total = number_format(floatval($otc_st) + $deposit,2);
  342. $total = number_format((floatval($product->retail_price) * 1.06) + ($otc * 1.06) + $deposit + $ip_tax, 2);
  343. array_push($data, array(
  344. 'coverage' => $request->coverage,
  345. 'unit' => $request->unit,
  346. 'street' => $request->street,
  347. 'package' => $request->package,
  348. 'application' => $request->application,
  349. 'company_name' => $request->company_name,
  350. 'company_register' => $request->company_register,
  351. 'company_number' => $request->company_number,
  352. 'company_fax' => $request->company_fax,
  353. 'full_name' => $request->full_name,
  354. 'nric_passport' => $request->nric_passport,
  355. 'designation' => $request->designation,
  356. 'contact_primary' => $request->contact_primary,
  357. 'contact_secondary' => $request->contact_secondary,
  358. 'email' => $request->email,
  359. 'subscription' => $request->subscription,
  360. 'billing' => $request->billing,
  361. 'voice' => $voice,
  362. 'ip' => $request->ip,
  363. 'ip_fee' => $ip_fee,
  364. 'ip_tax' => $ip_tax,
  365. 'thedate' => $request->thedate,
  366. 'dealer_id' => $request->dealer_id,
  367. ));
  368. return view('sales.form.dealer.business_preview', compact('data','coverage','product','deposit','otc', 'otc_st','gst','promo_price','promo_st','total_monthly', 'upfront_total'));
  369. }
  370. public function storeFormDataD(Request $request){
  371. $su_id = ''; $pathIconF = ''; $pathIconB = ''; $pathForm9 = ''; $pathPaymentReceipt = ''; $pathSoForm = '';
  372. do {
  373. $su_id = strtoupper('CBB-'.$this->random_code(6).'B');
  374. } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
  375. $destinationPath = 'document/'.$su_id;
  376. // create folder/dir if not exist
  377. if(!File::exists(public_path().'/'.$destinationPath)){
  378. File::makeDirectory(public_path().'/'.$destinationPath,0777,true);
  379. }
  380. if($request->hasfile('front_ic')){
  381. $icon = $request->file('front_ic');
  382. $icon->move($destinationPath,'frontic.'.$icon->getClientOriginalExtension());
  383. $pathIconF = '/'.$destinationPath.'/frontic.'.$icon->getClientOriginalExtension();
  384. }
  385. if($request->hasfile('back_ic')){
  386. $icon = $request->file('back_ic');
  387. $icon->move($destinationPath,'backic.'.$icon->getClientOriginalExtension());
  388. $pathIconB = '/'.$destinationPath.'/backic.'.$icon->getClientOriginalExtension();
  389. }
  390. if($request->hasfile('form9')){
  391. $icon = $request->file('form9');
  392. $icon->move($destinationPath,'formD.'.$icon->getClientOriginalExtension());
  393. $pathForm9 = '/'.$destinationPath.'/formD.'.$icon->getClientOriginalExtension();
  394. }
  395. if($request->hasfile('paymentReceipt')){
  396. $icon = $request->file('paymentReceipt');
  397. $icon->move($destinationPath,'paymentReceipt.'.$icon->getClientOriginalExtension());
  398. $pathPaymentReceipt = '/'.$destinationPath.'/paymentReceipt.'.$icon->getClientOriginalExtension();
  399. }
  400. if($request->hasfile('soForm')){
  401. $icon = $request->file('soForm');
  402. $icon->move($destinationPath,'soForm.'.$icon->getClientOriginalExtension());
  403. $pathSoForm = '/'.$destinationPath.'/soForm.'.$icon->getClientOriginalExtension();
  404. }
  405. if($pathForm9 != '' && $pathIconB != '' && $pathIconF != ''){
  406. $staff = Staff::with('StaffDetail')->where('_id',$request->dealer_id)->first();
  407. if(!empty($staff)){
  408. $coverage = Coverage::where('_id',$request->coverage)->first();
  409. $product = Product::where('formT','B')->where('package_name',$request->package)->first();
  410. $sl = new Form();
  411. $sl->type_service = $request->application;
  412. $sl->type_application = 'B';
  413. $sl->project_type = $coverage->project_type;
  414. $sl->status_payment = 'paid';
  415. $sl->status_email = 'unverified';
  416. $sl->remark_form = '';
  417. $sl->dealer_id = $request->dealer_id;
  418. $sl->company_id = $staff->StaffDetail->company_id;
  419. $staff->form()->save($sl);
  420. $sdl = new Subscriber();
  421. $sdl->subscriber_id = $su_id;
  422. $sdl->name = $request->full_name;
  423. $sdl->ic = $request->nric_passport;
  424. $sdl->company_name = $request->company_name;
  425. $sdl->company_reg = $request->company_register;
  426. $sdl->company_num = $request->company_number;
  427. $sdl->company_fax = $request->company_fax;
  428. $sdl->designation = $request->designation;
  429. $sdl->email = $request->email;
  430. $sdl->phone1 = $request->contact_primary;
  431. $sdl->phone2 = $request->contact_secondary;
  432. $sdl->unit_no = $request->unit;
  433. $sdl->building_name = $coverage->building_name;
  434. $sdl->street = $request->street;
  435. $sdl->postcode = $coverage->postcode;
  436. $sdl->city = $coverage->city;
  437. $sdl->state = $coverage->state;
  438. $sdl->front_ic = $pathIconF;
  439. $sdl->back_ic = $pathIconB;
  440. $sdl->form9_44 = $pathForm9;
  441. $sdl->paymentReceipt = $pathPaymentReceipt;
  442. $sdl->soForm = $pathSoForm;
  443. $packageD = new PackageDetail();
  444. $packageD->contract = $request->subscription;
  445. $packageD->name = $product->speed;
  446. if ($request->gst != null){
  447. $packageD->montly_fee = $request->gst;
  448. }else {
  449. $packageD->montly_fee = $request->promo_st;
  450. }
  451. $packageD->voice_fee = $request->voice;
  452. $packageD->ip = $request->ip;
  453. $packageD->ip_tax = $request->ip_tax;
  454. $packageD->deposit = $request->deposit;
  455. $packageD->upfront_payment = $request->otc;
  456. $packageD->rfs = $request->rfs;
  457. $sl->subscriber()->save($sdl);
  458. $sl->packagedetail()->save($packageD);
  459. $f_id = $this->sendInvoice($su_id);
  460. $stat = new FormStatus();
  461. $stat->form_id = $f_id;
  462. $stat->status_id = 1;
  463. $stat->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
  464. $stat->status = 'Submitted';
  465. $stat->desc = 'The form already been submit';
  466. $sl->formstatus()->save($stat);
  467. return redirect('http://db.citybroadband.my/business/application-form/success-submit');
  468. }
  469. }
  470. }
  471. public function verifyEmail($subscriber_id){
  472. $subscriber = Subscriber::where('subscriber_id',$subscriber_id)->first();
  473. if(!empty($subscriber)){
  474. $form = Form::where('_id',$subscriber->_id)->first();
  475. if(!empty($form)){
  476. if($form->status_email == 'unverified'){
  477. $form->status_email = 'verified';
  478. $form->save();
  479. $stat = new FormStatus();
  480. $stat->form_id = $form->_id;
  481. $stat->status_id = 2;
  482. $stat->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
  483. $stat->status = 'Verified';
  484. $stat->desc = 'Email already been verified by customer';
  485. $form->formstatus()->save($stat);
  486. return redirect('http://db.citybroadband.my/business/application-form/success-verified');
  487. }
  488. }
  489. }
  490. }
  491. public function checkEmailTemplate($subscriber_id){
  492. $subscriber = Subscriber::where('subscriber_id',$subscriber_id)->first();
  493. if(!empty($subscriber)){
  494. $form = Form::where('_id',$subscriber->_id)->first();
  495. $product = Product::where('speed',$form->PackageDetail->name)->where('formT',$form->type_application)->first();
  496. }
  497. return view('email.invoiceb', compact ('form', 'product'));
  498. }
  499. }