|
@@ 232-240 (lines=9) @@
|
| 229 |
|
context_object_name = 'CustomerBalance' |
| 230 |
|
paginate_by = 10 |
| 231 |
|
|
| 232 |
|
def get_queryset(self): |
| 233 |
|
qs = super(BalanceHistoryCustView, self).get_queryset() |
| 234 |
|
try: |
| 235 |
|
self.usercompany = Person.objects.get(user=self.request.user) |
| 236 |
|
self.company = get_object_or_404(Company, name=self.usercompany.company) |
| 237 |
|
return CompanyBalanceHistory.objects.filter(company=self.company.pk).filter(operation_type='customer').order_by('-date_modified') |
| 238 |
|
except Person.DoesNotExist: |
| 239 |
|
messages.error(self.request, _(u"""This user is not linked to a customer !""")) |
| 240 |
|
return qs.none() |
| 241 |
|
|
| 242 |
|
def get_context_data(self, **kwargs): |
| 243 |
|
context = super(BalanceHistoryCustView, self).get_context_data(**kwargs) |
|
@@ 159-167 (lines=9) @@
|
| 156 |
|
paginate_by = 10 |
| 157 |
|
model = CustomerDirectory |
| 158 |
|
|
| 159 |
|
def get_queryset(self): |
| 160 |
|
qs = super(SipAccountCustView, self).get_queryset() |
| 161 |
|
try: |
| 162 |
|
self.usercompany = Person.objects.get(user=self.request.user) |
| 163 |
|
self.company = get_object_or_404(Company, name=self.usercompany.company) |
| 164 |
|
return CustomerDirectory.objects.filter(company=self.company.pk).order_by('id') |
| 165 |
|
except Person.DoesNotExist: |
| 166 |
|
messages.error(self.request, _(u"""This user is not linked to a customer !""")) |
| 167 |
|
return qs.none() |
| 168 |
|
|
| 169 |
|
|
| 170 |
|
class CdrReportCustView(LoginRequiredMixin, FormMixin, ListView): |