-
-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix https://issues.civicrm.org/jira/browse/CRM-19149 #8982
Conversation
Can one of the admins verify this patch? |
jenkins, ok to test |
@wahyukodar please fix failing tests |
@wahyukodar Wahyu can you please do git rebase -i core repo alias/master and only pick commits for this PR |
@seamuslee001 Hi, can you help me what command to write on the terminal? |
@wahyukodar Wahyu What you want to do is in your terminal cd to the civicrm root. then do git rebase -i civirepo-alias/master and then follow the prompts. as per the docs here https://git-scm.com/docs/git-rebase |
@seamuslee001 Hi, I'm done git rebase, but it's still fail test.. Alert in jenkins "No report files were found. Configuration error".. What should I do? |
@wahyukodar can you do another git rebase but when you get the list of commits ONLY include the ones relevant to this Pull and no merge commits. |
@seamuslee001 , when I run git rebase -i civirepo/master, I get pick 122250e fix issue https://issues.civicrm.org/jira/browse/CRM-19149 |
ok so what you want to do is to do pick 122250e fix issue https://issues.civicrm.org/jira/browse/CRM-19149 |
so add in the # where i have suggested and then do git push origin master -f |
I can't push, this log my terminal
|
ok do git commit --allow-empty and then git rebase --continue |
git rebase --continue error
|
ok now do git mergetool and you should see some errors like <<< etc and remove and fix merge and then do git rebase --continue |
nice work @wahyukodar :-) |
@seamuslee001 Thank you very much.. :) |
…ty_transaction record is created
Fix up errors in to_account_id and ensure that financial_item is enti…
@tamarmeir with the latest commits i think your problems are fixed |
Almost there - financial transactions associated with contribution look good: But api explore is still showing issues with the net amount of the financial transactions created upon editing - this time, it's the negative credit card transaction (id = 96) that shows a positive amount in the "net amount" field:
} |
$params['trxnParams']['to_financial_account_id'] = $params['to_financial_account_id']; | ||
$params['trxnParams']['payment_instrument_id'] = $params['contribution']->payment_instrument_id; | ||
if ($params['total_amount'] < 0) { | ||
$params['trxnParams']['net_amount'] = $params['trxnParams']['total_amount']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wahyukodar Wahyu could you move this line up to L3645 i.e. just after the elseif, That should then solve the last issue found by Tamar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 3645? are you sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wahyukodar good pickup i mean L3465 :-) reads closer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will move thi
$params['trxnParams']['net_amount'] = $params['trxnParams']['total_amount'];
@seamuslee001
to L3465? Right?
Houston, we have lift off with the financial transactions! Not sure why there is a result of "All checks failed" in the last merge build - I will leave it to you, though since you have effectively resolved this issue with the last changes made. Thanks and kind regards, |
@totten @monishdeb I think this can be merged now tested pretty thoroughly |
Jenkins test this please |
unrelated failure |
$prevFinancialItem = CRM_Financial_BAO_FinancialItem::getPreviousFinancialItem($fieldValues['id']); | ||
if (!CRM_Utils_Rule::currencyCode($trxn->currency)) { | ||
$trxn->currency = CRM_Core_Config::singleton()->defaultCurrency; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think line 3611-3613 is not required.
'entity_id' => $prevFinancialItem->id, | ||
'financial_trxn_id' => $trxn->id, | ||
'amount' => $trxn->total_amount, | ||
'currency' => $trxn->currency, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
civicrm_entity_financial_trxn doesn't have currency column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is as per
$entityFinancialTrxnParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, its not required in either of the place. Can you remove them as cruft?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure I'll do a tidy up PR
); | ||
$entityTrxn = new CRM_Financial_DAO_EntityFinancialTrxn(); | ||
$entityTrxn->copyValues($entityFinancialTrxnParams); | ||
$entityTrxn->save(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not using api here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better idea
@@ -3592,6 +3604,28 @@ public static function updateFinancialAccounts(&$params, $context = NULL, $skipT | |||
} | |||
} | |||
} | |||
if ($context == 'changePaymentInstrument') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this as per the dataflow for accounting?
https://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow#CiviAccountsDataFlow-ChangePaymentInstrumentforaPartlyPaidorCompletedcontribution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pradpnayak all this is doing is adding in a linkage back to the financial_item without it the display on the contribution tab does not show all financial_trxns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, agreed. Can you please update the wiki and also inform @JoeMurray about the changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure will give it a shot @pradpnayak
else { | ||
$params['trxnParams']['to_financial_account_id'] = $params['to_financial_account_id']; | ||
$params['trxnParams']['payment_instrument_id'] = $params['contribution']->payment_instrument_id; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seamuslee001 line 3474-3481 and 3484-3492 looks duplicate. Can we re-write line from 3472-3492 as
if (!empty($lastFinancialTrxnId['financialTrxnId'])) {
if ($params['total_amount'] != $params['trxnParams']['total_amount']) {
$params['trxnParams']['to_financial_account_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $lastFinancialTrxnId['financialTrxnId'], 'to_financial_account_id');
$params['trxnParams']['payment_instrument_id'] = $params['prevContribution']->payment_instrument_id;
}
else {
$params['trxnParams']['to_financial_account_id'] = $params['to_financial_account_id'];
$params['trxnParams']['payment_instrument_id'] = $params['contribution']->payment_instrument_id;
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pradpnayak see followup pr #9055
Issue on JIRA https://issues.civicrm.org/jira/browse/CRM-19149