Пример #1
0
 def get(self, clientKeyUrlSafe):
     user = Authorization.isAuthenticated()
     if user:
         client = ClientService.get(clientKeyUrlSafe)
         template_values = {
             'client':client,
             'buttonName' : 'Update',
             'postURL' : '/clientDetail/'+clientKeyUrlSafe,
         }
         template = JINJA_ENVIRONMENT.get_template('partials/clientEditable.html')
         self.response.write(template.render(template_values))
     else:
         self.redirect('/')
Пример #2
0
 def get(self, lineItemKeyUrlSafe, clientKeyUrlSafe):
     user = Authorization.isAuthenticated()
     if user:
         client = ClientService.get(clientKeyUrlSafe)
         lineItem = LineItemService.get(lineItemKeyUrlSafe)
         services = ServiceService.getAll()
         template_values = {
             "client": client,
             "lineItem": lineItem,
             "services": services,
             "postURL": "/lineItemUpdate/" + lineItemKeyUrlSafe + "/client/" + clientKeyUrlSafe,
         }
         template = JINJA_ENVIRONMENT.get_template("partials/lineItemUpdate.html")
         self.response.write(template.render(template_values))
     else:
         self.redirect("/")
Пример #3
0
 def get(self, clientKeyUrlSafe):
     user = Authorization.isAuthenticated()
     if user:
         monthStart = DateService.getFirstDateOfMonth().strftime('%m/%d/%Y')
         monthEnd = DateService.getLastDateOfMonth().strftime('%m/%d/%Y')
         try:
             radLineItemType = LineItemsClient.radLineItemType
         except:
             radLineItemType = 'irregular'
         try:
             dateFrom = LineItemsClient.dateFrom
             dateTo = LineItemsClient.dateTo
         except:
             dateFrom = monthStart
             dateTo = monthEnd
         try:
             viewDateFrom = LineItemsClient.viewDateFrom
             viewDateTo = LineItemsClient.viewDateTo
         except:
             viewDateFrom = monthStart
             viewDateTo = monthEnd
         try:
             serviceKeyUrlSafe = LineItemsClient.serviceKeyUrlSafe
         except:
             serviceKeyUrlSafe = ''
         services = ServiceService.getAll()
         client = ClientService.get(clientKeyUrlSafe)
         # lineItems = LineItemService.getAll(clientKeyUrlSafe)
         lineItems = LineItemService.getAllInRange(clientKeyUrlSafe, viewDateFrom, viewDateTo)
         template_values = {
             'services':services,
             'client' : client,
             'postUrl' : '/lineItem/client/' + clientKeyUrlSafe,
             'lineItems' : lineItems,
             'getUrl' : '/lineItem/client/' + clientKeyUrlSafe,
             'viewDateFrom' : viewDateFrom,
             'viewDateTo' : viewDateTo,
             'dateFrom' : dateFrom,
             'dateTo' : dateTo,
             'serviceKeyUrlSafe' : serviceKeyUrlSafe,
             'radLineItemType' : radLineItemType
         }
         template = JINJA_ENVIRONMENT.get_template('partials/lineItemClient.html')
         self.response.write(template.render(template_values))
     else:
         self.redirect('/')