Index: civicrm/trunk/sites/all/modules/queue2civicrm/queue2civicrm.module |
— | — | @@ -222,11 +222,12 @@ |
223 | 223 | } |
224 | 224 | |
225 | 225 | watchdog('queue2civicrm', 'Contribution (pre-conversion):<pre>' . check_plain(print_r($msg, TRUE)) . '</pre>'); |
| 226 | + |
| 227 | + // round the amounts and do exchange rate conversion |
| 228 | + $msg['fee'] = round( exchange_rate_convert($msg['original_currency'], $msg['fee'], $msg['date']), 2 ); |
| 229 | + $msg['gross'] = round( exchange_rate_convert($msg['original_currency'], $msg['gross'], $msg['date']), 2 ); |
| 230 | + $msg['net'] = round( exchange_rate_convert($msg['original_currency'], $msg['net'], $msg['date']), 2 ); |
226 | 231 | |
227 | | - $msg['fee'] = exchange_rate_convert($msg['currency'], $msg['fee'], $msg['date']); |
228 | | - $msg['gross'] = exchange_rate_convert($msg['currency'], $msg['gross'], $msg['date']); |
229 | | - $msg['net'] = exchange_rate_convert($msg['currency'], $msg['net'], $msg['date']); |
230 | | - |
231 | 232 | $msg['gateway_txn_id'] .= ' ' . time(); |
232 | 233 | |
233 | 234 | //dsm($contribution); |
— | — | @@ -284,7 +285,7 @@ |
285 | 286 | |
286 | 287 | watchdog( 'queue2civicrm', 'Contribution array for civicrm_contribution_add(): ' . print_r($contribution, TRUE)); |
287 | 288 | |
288 | | - $contribution_result = &civicrm_contribution_add( $contribution ); |
| 289 | + $contribution_result = civicrm_contribution_add( $contribution ); |
289 | 290 | |
290 | 291 | watchdog( 'queue2civicrm', 'Contribution result from civicrm_contribution_add(): ' . print_r($contribution_result, TRUE)); |
291 | 292 | |
— | — | @@ -322,7 +323,7 @@ |
323 | 324 | $form['queue'] = array( |
324 | 325 | '#type' => 'textfield', |
325 | 326 | '#title' => 'Queue to submit to', |
326 | | - '#default_value' => '/queue/test_pending_pfp', |
| 327 | + '#default_value' => '/queue/test_donations', |
327 | 328 | '#required' => TRUE |
328 | 329 | ); |
329 | 330 | |