Index: civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module |
— | — | @@ -263,7 +263,7 @@ |
264 | 264 | $queue2civicrm_dbs = _queue2civicrm_get_dbs(); |
265 | 265 | $queue2civicrm_dbs->use_civicrm(); |
266 | 266 | $query = "UPDATE {civicrm_contribution_recur} SET next_sched_contribution='%s'"; |
267 | | - db_query( $query, date('Y-m-d H:i:s', strtotime( "+" . $msg[ 'frequency_interval' ] . " " . $msg[ 'frequency_unit' ], $msg[ 'payment_date' ] ))); |
| 267 | + db_query( $query, date('Y-m-d H:i:s', strtotime( "+" . $recur_record->frequency_interval . " " . $recur_record->frequency_unit, $msg[ 'payment_date' ] ))); |
268 | 268 | $queue2civicrm_dbs->use_default(); |
269 | 269 | |
270 | 270 | // construct an array of useful info to invocations of queue2civicrm_import |
— | — | @@ -350,9 +350,8 @@ |
351 | 351 | installments, |
352 | 352 | start_date, |
353 | 353 | create_date, |
354 | | - trxn_id, |
355 | | - next_sched_contribution ) |
356 | | - VALUES ( %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s' )"; |
| 354 | + trxn_id ) |
| 355 | + VALUES ( %d, %d, '%s', %d, '%s', '%s', '%s', '%s' )"; |
357 | 356 | |
358 | 357 | $queue2civicrm_dbs = _queue2civicrm_get_dbs(); |
359 | 358 | $queue2civicrm_dbs->use_civicrm(); |
— | — | @@ -365,7 +364,6 @@ |
366 | 365 | date( 'Y-m-d H:i:s', $msg[ 'start_date' ] ), |
367 | 366 | date( 'Y-m-d H:i:s', $msg[ 'create_date' ] ), |
368 | 367 | $msg[ 'subscr_id' ], |
369 | | - date( 'Y-m-d H:i:s', strtotime( "+" . $msg[ 'frequency_interval' ] . " " . $msg[ 'frequency_unit' ], $msg[ 'start_date' ] )) |
370 | 368 | ); |
371 | 369 | $queue2civicrm_dbs->use_default(); |
372 | 370 | |
— | — | @@ -474,7 +472,7 @@ |
475 | 473 | $msg[ 'frequency_unit' ], |
476 | 474 | $msg[ 'frequency_interval' ], |
477 | 475 | date( 'Y-m-d H:i:s', $msg[ 'modified_date' ] ), |
478 | | - date( 'Y-m-d H:i:s', strtotime( "+" . $msg[ 'frequency_interval' ] . " " . $msg[ 'frequency_unit' ], $msg[ 'start_date' ] )), |
| 476 | + date( 'Y-m-d H:i:s', strtotime( "+" . $recur_record->frequency_interval . " " . $recur_record->frequency_unit, $msg[ 'start_date' ] )), |
479 | 477 | $msg[ 'subscr_id' ] |
480 | 478 | ); |
481 | 479 | $queue2civicrm_dbs->use_default(); |
Index: civicrm/trunk/sites/all/modules/queue2civicrm/queue2civicrm_common.inc |
— | — | @@ -250,6 +250,11 @@ |
251 | 251 | function _queue2civicrm_contribution_insert( $msg, $contact, $recur_id=NULL ) { |
252 | 252 | require_once 'api/v2/Contribute.php'; |
253 | 253 | |
| 254 | + $trxn_id = strtoupper( $msg[ 'gateway' ] . ' ' . $msg[ 'gateway_txn_id' ] ); |
| 255 | + if ( $recur_id ) { |
| 256 | + $trxn_id = 'RECURRING ' . $trxn_id; |
| 257 | + } |
| 258 | + |
254 | 259 | // Insert the contribution record |
255 | 260 | $contribution = array( |
256 | 261 | 'contact_id' => $contact[ 'contact_id' ], |
— | — | @@ -258,7 +263,7 @@ |
259 | 264 | 'payment_instrument_id' => 6, // contribution @fixme see above |
260 | 265 | 'fee_amount' => $msg['fee'], |
261 | 266 | 'net_amount' => $msg['net'], |
262 | | - 'trxn_id' => strtoupper($msg['gateway']) . ' ' . $msg['gateway_txn_id'], |
| 267 | + 'trxn_id' => $trxn_id, |
263 | 268 | 'receive_date' => date('Y-m-d H:i:s', $msg['date']), |
264 | 269 | 'currency' => 'USD', |
265 | 270 | 'source' => $msg['original_currency'] . ' ' . $msg['original_gross'], |