Example #1
0
 def post(self):
     wo = WorkOrder.get_by_id(long(self['work_order']))
     ret_val = {}
     params = {}
     if self['params']:
         params_str = self['params']
         entry_strs = params_str.split(';')
         for entry_str in entry_strs:
             entry = entry_str.split(':')
             params[entry[0]] = entry[1]
     ret_val = wo.update_state(params, self.session['role'])
     self.write(json.dumps(ret_val))
Example #2
0
 def post(self):
     wo = WorkOrder.get_by_id(long(self['work_order']))
     print(self['params'])
     ret_val = wo.estimate(self['approval'], self['params'])
     self.write(json.dumps(ret_val))
Example #3
0
 def post(self):
     wo = WorkOrder.get_by_id(long(self['work_order']))
     wo.cancel()
     self.write(json.dumps({'status':'success'}))
Example #4
0
 def get(self):
     path = 'work_order_estimate.html'
     action = self['action'] if self['action'] else ''
     wo = WorkOrder.get_by_id(long(self['work_order']))
     template_values = {'work_order':self['work_order'], 'action':action, 'service_date':wo.fix_by_date}
     self.write(self.get_rendered_html(path, template_values), 200)