Mass Punch of weekdays in CV 12.6.5

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
andy
Posts: 19
Joined: Mon Aug 18, 2008 1:08 pm

Mass Punch of weekdays in CV 12.6.5

Post by andy »

I just installed a new version after using a *much* older version and there used to be a Mass Punch function where you could select 1 or more people and give them an in-punch at a particular time for a range of dates. The old version has the option to do weekdays only by selecting which of the 7 days to include.

I'm not seeing that on the current version (CV 12.6.5). There is a grayed out thing called Mass Edit.... if that is where I should do what I want, how to I enable it?

I found a way to semi-do a mass punch for one person by selecting a range of dates before doing the punch, but there is no automatic way to omit the weekends.

In a related question, is there a way to set up a schedule where people are supposed to work M-F only? Would that solve this somehow?

Thanks!!!!
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Mass Punch of weekdays in CV 12.6.5

Post by shaunw »

Attendance -> Punches, click "New", then click the icon in the date field to open the date selection box, there you can select a range or any number of individual dates that you wish. Not quite as easy as just picking M-F, but slightly more flexible.

If you are primarily interested in auto-punching employees, the Professional Edition of TimeTrex offers the capability to fully automate that on any recurring basis.
andy
Posts: 19
Joined: Mon Aug 18, 2008 1:08 pm

Re: Mass Punch of weekdays in CV 12.6.5

Post by andy »

Can you point me to where I can access the code that generates and deals with the screen to enter a date range and individual date entry? I'd like to try to modify it by adding a button that filters weekdays.

Thanks!
andy
Posts: 19
Joined: Mon Aug 18, 2008 1:08 pm

Re: Mass Punch of weekdays in CV 12.6.5

Post by andy »

Still hoping for a little help. Where in the installation can I find the code to creates this page and submits the data of what punches to add?

URL:
localhost/timetrex/interface/html5/?desktop=1#!m=TimeSheet&user_id=05bb247f-e465-479a-b963-692f581b6f47&show_wage=0&mode=punch&a=new&t=punch&tab=Punch

Looks like:

Image

Thanks!
andy
Posts: 19
Joined: Mon Aug 18, 2008 1:08 pm

Re: Mass Punch of weekdays in CV 12.6.5

Post by andy »

Looks like this is happening in this file:
/usr/share/timetrex/html/interface/html5/views/attendance/punches/PunchesViewController.js

Is that correct?

Is this where to do additional parsing of the dates to check the day of week before adding them to the list?

parserDatesRange( date ) {
var dates = date.split( ' - ' );
var resultArray = [];
var beginDate = Global.strToDate( dates[0] );
var endDate = Global.strToDate( dates[1] );

var nextDate = beginDate;

while ( nextDate.getTime() < endDate.getTime() ) {
resultArray.push( nextDate.format() );
nextDate = new Date( new Date( nextDate.getTime() ).setDate( nextDate.getDate() + 1 ) );
}

resultArray.push( dates[1] );

return resultArray;
}

----------------


Is there any documentation about how the data is dealt with here:
buildMassEditSaveRecord( mass_edit_record_ids, changed_fields ) {
var $this = this;
var mass_records = [];
$.each( mass_edit_record_ids, function( index, value ) {
var common_record = Global.clone( changed_fields );
common_record.id = value;
mass_records.push( common_record );
} );
return mass_records;
}

buildMassAddRecord( current_edit_record ) {
var record = [];
var dates_array = current_edit_record.punch_dates;

if ( dates_array.indexOf( ' - ' ) > 0 ) {
dates_array = this.parserDatesRange( dates_array );
}

for ( var i = 0; i < dates_array.length; i++ ) {
var common_record = Global.clone( current_edit_record );
delete common_record.punch_dates;
common_record.punch_date = dates_array[ i ];
var user_id = this.current_edit_record.user_id;

if ( Global.isArray( user_id ) ) {
for ( var j = 0; j < user_id.length; j++ ) {
var final_record = Global.clone( common_record );
final_record.user_id = this.current_edit_record.user_id[ j ];
final_record = this.uniformVariable( final_record );
record.push( final_record );
}
} else {
common_record = this.uniformVariable( common_record );
record.push( common_record );
}

}
-----------
Thanks!
Post Reply