Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
72019708
Commit
72019708
authored
3 months ago
by
benjamin
Committed by
totten
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix broken date offsets in deferred revenue test
parent
705a2d46
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Report/Form/Contribute/DeferredRevenue.php
+1
-1
1 addition, 1 deletion
CRM/Report/Form/Contribute/DeferredRevenue.php
tests/phpunit/api/v3/ReportTemplateTest.php
+4
-4
4 additions, 4 deletions
tests/phpunit/api/v3/ReportTemplateTest.php
with
5 additions
and
5 deletions
CRM/Report/Form/Contribute/DeferredRevenue.php
+
1
−
1
View file @
72019708
...
...
@@ -362,7 +362,7 @@ class CRM_Report_Form_Contribute_DeferredRevenue extends CRM_Report_Form {
public
function
where
()
{
parent
::
where
();
$startDate
=
date
(
'Y-m-01'
);
$endDate
=
date
(
'Y-m-t'
,
strtotime
(
date
(
'ymd'
)
.
'+11 month'
)
);
$endDate
=
(
new
DateTime
(
'+11 month'
))
->
format
(
'Y-m-t'
);
$this
->
_where
.
=
" AND
{
$this
->
_aliases
[
'civicrm_financial_trxn_1'
]
}
.trxn_date BETWEEN '
{
$startDate
}
' AND '
{
$endDate
}
'"
;
}
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/api/v3/ReportTemplateTest.php
+
4
−
4
View file @
72019708
...
...
@@ -1037,14 +1037,14 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
[
'contact_id'
=>
$this
->
ids
[
'Contact'
][
'first'
],
'receive_date'
=>
'2016-10-01'
,
'revenue_recognition_date'
=>
date
(
'Y-m-t'
,
strtotime
(
date
(
'ymd'
)
.
'+3 month'
)
),
'revenue_recognition_date'
=>
(
new
DateTime
(
'+3 month'
))
->
format
(
'Y-m-t'
),
'financial_type_id'
=>
2
,
]
);
$this
->
contributionCreate
(
[
'contact_id'
=>
$this
->
ids
[
'Contact'
][
'first'
],
'revenue_recognition_date'
=>
date
(
'Y-m-t'
,
strtotime
(
date
(
'ymd'
)
.
'+22 month'
)
),
'revenue_recognition_date'
=>
(
new
DateTime
(
'+22 month'
))
->
format
(
'Y-m-t'
),
'financial_type_id'
=>
4
,
'trxn_id'
=>
NULL
,
'invoice_id'
=>
NULL
,
...
...
@@ -1053,7 +1053,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
$this
->
contributionCreate
(
[
'contact_id'
=>
$this
->
ids
[
'Contact'
][
'second'
],
'revenue_recognition_date'
=>
date
(
'Y-m-t'
,
strtotime
(
date
(
'ymd'
)
.
'+1 month'
)
),
'revenue_recognition_date'
=>
(
new
DateTime
(
'+1 month'
))
->
format
(
'Y-m-t'
),
'financial_type_id'
=>
4
,
'trxn_id'
=>
NULL
,
'invoice_id'
=>
NULL
,
...
...
@@ -1063,7 +1063,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
[
'contact_id'
=>
$this
->
ids
[
'Contact'
][
'second'
],
'receive_date'
=>
'2016-03-01'
,
'revenue_recognition_date'
=>
date
(
'Y-m-t'
,
strtotime
(
date
(
'ymd'
)
.
'+4 month'
)
),
'revenue_recognition_date'
=>
(
new
DateTime
(
'+4 month'
))
->
format
(
'Y-m-t'
),
'financial_type_id'
=>
2
,
'trxn_id'
=>
NULL
,
'invoice_id'
=>
NULL
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment