Skip to content
Snippets Groups Projects
Commit 35c60d32 authored by Shani's avatar Shani
Browse files

Merge branch 'BRCD_3595_new_features_mdb4' into 'new_features_mdb4'

BRCD-3595 :  Fix for future subscribers being charged in (relative) past cycles

See merge request sdoc/billrun!4586
parents 7c36d209 f15d8748
Branches
Tags new_features_mdb4_20220830_1
No related merge requests found
......@@ -18,6 +18,11 @@ class Billrun_Plans_Charge_Upfront_Custom extends Billrun_Plans_Charge_Upfront_M
protected function getFractionOfMonth() {
//got a future subscriber for some reason.
if( $this->activation >= $this->cycle->end()) {
return null;
}
if ((empty($this->deactivation) || $this->deactivation >= $this->cycle->end() ) && $this->activation < $this->cycle->start() ) {
return 1;
}
......
......@@ -19,6 +19,10 @@ class Billrun_Plans_Charge_Upfront_Month extends Billrun_Plans_Charge_Upfront {
* @return int
*/
protected function getFractionOfMonth() {
//got a future subscriber for some reason.
if( $this->activation >= $this->cycle->end()) {
return null;
}
if (empty($this->deactivation) && $this->activation < $this->cycle->start() ) {
return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment