Skip to content

Commit

Permalink
[IMP]recharge cut
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish.gohil committed Jul 12, 2021
1 parent 2dd8cbe commit 17bbdbb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions database/astpp-5.0.1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ CREATE DEFINER=`root`@`localhost` EVENT `staging_cdrs` ON SCHEDULE EVERY 1 MINUT

DELIMITER ;

-- ------------------------------12-07-2021

DELETE FROM `system` WHERE `name`="paypal_status";

INSERT INTO `system` (`id`, `name`, `display_name`, `value`, `field_type`, `comment`, `timestamp`, `reseller_id`, `is_display`, `group_title`, `sub_group`, `field_rules`) VALUES (NULL, 'paypal_status', 'Paypal', '1', 'enable_disable_option', 'Set enable to add paypal as payment gateway option', '0000-00-00 00:00:00.000000', '0', '0', 'payment_methods', 'Paypal', '');

DELETE FROM `system` WHERE `name`="paypal_mode";

INSERT INTO `system` (`id`, `name`, `display_name`, `value`, `field_type`, `comment`, `timestamp`, `reseller_id`, `is_display`, `group_title`, `sub_group`, `field_rules`) VALUES (NULL, 'paypal_mode', 'Environment', '1', 'paypal_mode', 'Set paypal mode. Sandbox for testing', '0000-00-00 00:00:00.000000', '0', '0', 'payment_methods', 'Paypal', '');
4 changes: 2 additions & 2 deletions freeswitch/fs/lib/astpp.cdr.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,13 @@ function get_reseller_cdr_string($dataVariable, $accountid, $account_type, $actu
*/
function update_balance($user_id, $amount, $entity_id, $logger, $db, $config, $dataVariable) {
/*If not realtime billing */
if ($config ['realtime_billing'] == '1') {
//if ($config ['realtime_billing'] == '1') {
$math_sign = ($entity_id == 0 || $entity_id == 1) ? '-' : '+';
$tmp_prefix=($dataVariable['intcall']==1)?'int_':'';
$query = "UPDATE accounts SET ".$tmp_prefix."balance=IF(posttoexternal=1,".$tmp_prefix."balance+" . $amount . ",".$tmp_prefix."balance-" . $amount . ") WHERE id=" . $user_id;
$logger->log ( "Balance update : " . $query );
$db->run ( $query );
}
//}
}

// Normalize rate string which we are getting from dialplan
Expand Down

0 comments on commit 17bbdbb

Please sign in to comment.