Advertisement
Guest User

Módulo cartão

a guest
Jun 13th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. // Créditos aplicados à fatura
  2. $invoiceCredit = (int)($GetInvoiceResults['credit'] * 100);
  3.  
  4. if ( $invoiceCredit > 0 and $discount_item > 0 ) {
  5. $whmcs_discount = (int)($invoiceCredit + $discount_item);
  6. }
  7. elseif ( $invoiceCredit > 0 and !$discount_item ) {
  8. $whmcs_discount = (int)$invoiceCredit;
  9. }
  10. elseif ( !$invoiceCredit and $discount_item > 0 ) {
  11. $whmcs_discount = (int)$discount_item;
  12. }
  13.  
  14. if ( $whmcs_discount > 0 ) {
  15. $discount = [
  16. 'type' => 'currency',
  17. 'value' => $whmcs_discount,
  18. ];
  19. $_SESSION['discount'] = $discount;
  20. }
  21.  
  22. if ($debug) {
  23. echo '<pre class="debug"><p class="ok">Itens calculáveis da Fatura</p>';
  24. print_r($invoiceItemsItem);
  25. echo '<br>';
  26. print_r($items);
  27. echo '$discount:<br>', print_r($discount), '<br>';
  28. echo '</pre>';
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement