Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Créditos aplicados à fatura
- $invoiceCredit = (int)($GetInvoiceResults['credit'] * 100);
- if ( $invoiceCredit > 0 and $discount_item > 0 ) {
- $whmcs_discount = (int)($invoiceCredit + $discount_item);
- }
- elseif ( $invoiceCredit > 0 and !$discount_item ) {
- $whmcs_discount = (int)$invoiceCredit;
- }
- elseif ( !$invoiceCredit and $discount_item > 0 ) {
- $whmcs_discount = (int)$discount_item;
- }
- if ( $whmcs_discount > 0 ) {
- $discount = [
- 'type' => 'currency',
- 'value' => $whmcs_discount,
- ];
- $_SESSION['discount'] = $discount;
- }
- if ($debug) {
- echo '<pre class="debug"><p class="ok">Itens calculáveis da Fatura</p>';
- print_r($invoiceItemsItem);
- echo '<br>';
- print_r($items);
- echo '$discount:<br>', print_r($discount), '<br>';
- echo '</pre>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement