Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.13.0-b1
-
Component/s: None
-
Labels:None
Description
domains_plugin.php around line 1431 change
$client_groups = $this->ClientGroups->getAll(Configure::get('Blesta.company_id'));
foreach ($client_groups as $client_group) {
$inv_days_before_renewal = $this->ClientGroups->getSetting($client_group->id, 'inv_days_before_renewal');
$pre_renewal_invoice_date = $this->Date->modify(
date('c'),
'-' . (($renewal_days->value ?? 0) + ($inv_days_before_renewal->value ?? 0) + 1) . ' days',
'Y-m-d 00:00:00',
Configure::get('Blesta.company_timezone')
);
$filters = [
'services' => [
['column' => 'date_renews', 'operator' => '>=', 'value' => $pre_renewal_invoice_date]
],
'clients' => [
['column' => 'client_group_id', 'operator' => '=', 'value' => $client_group->id]
],
];
$services = $this->DomainsDomains->getAll([], ['date_added' => 'DESC'], $filters);
$this->synchronizeDomainServices($services, $renewal_days);
}
To
$client_groups = $this->ClientGroups->getAll(Configure::get('Blesta.company_id'));
foreach ($client_groups as $client_group) {
$inv_days_before_renewal = $this->ClientGroups->getSetting($client_group->id, 'inv_days_before_renewal');
$pre_renewal_invoice_date = $this->Date->modify(
date('c'),
'+' . (($inv_days_before_renewal->value ?? 0) + 5) . ' days',
'Y-m-d 00:00:00',
Configure::get('Blesta.company_timezone')
);
$filters = [
'services' => [
['column' => 'date_renews', 'operator' => '<=', 'value' => $pre_renewal_invoice_date]
],
'clients' => [
['column' => 'client_group_id', 'operator' => '=', 'value' => $client_group->id]
],
];
$services = $this->DomainsDomains->getAll([], ['date_added' => 'DESC'], $filters);
$this->synchronizeDomainServices($services, $renewal_days);
}
One customer that implemented this shared a screenshot of the module log that seemed to indicate the sync sync'd the same exact domain 3 times in a row as part of the same sync run. Not sure the cause in that case, but we should make sure that this implementation does not allow for this.