MT#60864 Fix Sync Email Templates button behavior

The 'Sync Email Templates' button is shown in the Email Templates
page in case some templates is missing for a reseller.
The problem is that the button takes into consideration also
resellers that are already terminated and for which the template
is not needed anymore.

Thus the query has been in fixed in order adding:
r.status != 'terminated'

Change-Id: I2dd551166ae777c8967eae3bda989b669b46b5c0
mr13.1
Marco Capetta 7 months ago
parent e83588874b
commit 97adbaf8e7

@ -34,9 +34,10 @@ sub tmpl_list :Chained('/') :PathPart('emailtemplate') :CaptureArgs(0) :Does(ACL
#select r.id as reseller_id,r.name as reseller_name, etd.id as email_template_id, etd.name as email_template_name from resellers r
#join email_templates etd on etd.reseller_id is null
#left join email_templates et on et.name=etd.name and et.reseller_id=r.id
#where et.id is null order by r.id,etd.id;
#where r.status != 'terminated' and et.id is null order by r.id,etd.id;
my $tmpl_missed_rs = $c->model('DB')->resultset('resellers')->search_rs({
'et.id' => undef,
'me.status' => { '!=' => 'terminated' },
},{
'select' => [
{ '' => \'concat(me.id,"/",etd.id)', -as => 'id' },

Loading…
Cancel
Save