GL BRANCH - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of GL BRANCH.php

  1. <?php
  2.  
  3. $service_charge = '10.00';
  4. $product_amount = '150.00';
  5. $total_amount = '165.00';
  6. $printing_cost = '1.30';
  7. $additional_charge = '5.00';
  8. $coverage_amt = '75000.00';
  9. $cbo_unit = '3';
  10.  
  11. $service_charge         = number_format(round($service_charge,2), 2);                                 
  12. $product_amount         = number_format(round($product_amount,2), 2);                                  
  13. $total_amount           = number_format(round($total_amount,2), 2);                                    
  14. $commission             = number_format(round($service_charge * $cbo_unit,2), 2);                      
  15. $net_of_vat_admin_fee   = number_format(round($commission / 1.12,2), 2);                              
  16. $wh_tax                 = number_format(round($net_of_vat_admin_fee * 0.02,2), 2);                     
  17. $tax_admin_fee          = number_format(round($commission - $wh_tax,2), 2);                           
  18. $printing_cost          = number_format(round($printing_cost,2), 2);                                    
  19. $printing_cost_net_vat  = number_format(round($printing_cost / 1.12,2), 2);                                    
  20. $wh_tax_oe              = number_format(round($printing_cost_net_vat * 0.02,2), 2);                                   
  21. $net_premium            = number_format(round(($product_amount - ($commission - $wh_tax) - ($printing_cost - $wh_tax_oe)),2),2);  
  22. $coverage_amt           = number_format(round($coverage_amt * $cbo_unit,2), 2);                        
  23. $insurance_commission   = number_format(round(($service_charge + $commission + $additional_charge) / 1.12,2), 2);             
  24. $vat                    = number_format(round($insurance_commission * 0.12,2), 2);
  25. $misc                   = number_format(round($printing_cost-$printing_cost_net_vat,2), 2);
  26. $wt_tax_computed        = number_format(round($wh_tax+$wh_tax_oe,2), 2);
  27.  
  28.  
  29. //Printing Cost Net Vat = 1.1607 (Printing Cost / 1.12)
  30. //Miscellaneous = 0.1393 (Printing Cost - Printing Cost Net Vat)
  31.  
  32. //Insurance Commission = 40.1785 (Service Charge + Commission + Additional) / 1.12
  33. //Vat = 4.8214 (Insurance Commission x 0.12)
  34.  
  35. echo 'COH: '.number_format(round($total_amount+$wt_tax_computed,2), 2).'<br><br>';
  36. echo 'Creditable WTAX: '.number_format(round($wt_tax_computed,2), 2).'<br><br>';
  37. echo 'OUTPUT TAX: '.number_format(round($vat+$misc,2), 2).'<br><br>';
  38. echo 'COMM INSURANCE: '.number_format(round($insurance_commission,2), 2).'<br><br>';
  39. echo 'MISCE: '.number_format(round($printing_cost-$printing_cost_net_vat,2), 2).'<br><br>';
File Description
  • GL BRANCH
  • PHP Code
  • 29 Oct-2020
  • 2.46 Kb
You can Share it: