Changeset 699536b in tailbone


Ignore:
Timestamp:
07/10/18 17:45:33 (2 years ago)
Author:
Lance Edgar <lance@…>
Branches:
master
Children:
8039af1
Parents:
16ab8b6
Message:

Add "?" for daily time sheet total if partial shift present

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tailbone/views/shifts/lib.py

    r16ab8b6 r699536b  
    443443                    '{}_hours'.format(shift_type): datetime.timedelta(0),
    444444                    '{}_hours_display'.format(shift_type): '',
     445                    'hours_incomplete': False,
    445446                }
    446447
     
    458459                        else:
    459460                            hours_incomplete = True
     461                            empday['hours_incomplete'] = True
    460462                        del employee_shifts[0]
    461463                    else:
     
    465467                if hours:
    466468                    if hours_style == 'pretty':
    467                         empday['{}_hours_display'.format(shift_type)] = pretty_hours(hours)
     469                        display = pretty_hours(hours)
    468470                    else: # decimal
    469                         empday['{}_hours_display'.format(shift_type)] = six.text_type(hours_as_decimal(hours))
     471                        display = six.text_type(hours_as_decimal(hours))
     472                    if empday['hours_incomplete']:
     473                        display = '{} ?'.format(display)
     474                    empday['{}_hours_display'.format(shift_type)] = display
    470475                employee.weekdays[i].update(empday)
    471476
Note: See TracChangeset for help on using the changeset viewer.