示例#1
0
     $pf->setPunchControlID($pf->findPunchControlID());
 }
 if ($pf->isNew()) {
     $pf->setActualTimeStamp($time_stamp);
     $pf->setOriginalTimeStamp($pf->getTimeStamp());
 }
 if ($pf->isValid() == TRUE) {
     if ($pf->Save(FALSE) == TRUE) {
         $pcf = new PunchControlFactory();
         $pcf->setId($pf->getPunchControlID());
         $pcf->setPunchObject($pf);
         if ($i == 0 and $pc_data['user_date_id'] != '') {
             //This is important when editing a punch, without it there can be issues calculating exceptions
             //because if a specific punch was modified that caused the day to change, smartReCalculate
             //may only be able to recalculate a single day, instead of both.
             $pcf->setUserDateID($pc_data['user_date_id']);
         }
         if (isset($pc_data['branch_id'])) {
             $pcf->setBranch($pc_data['branch_id']);
         }
         if (isset($pc_data['department_id'])) {
             $pcf->setDepartment($pc_data['department_id']);
         }
         if (isset($pc_data['job_id'])) {
             $pcf->setJob($pc_data['job_id']);
         }
         if (isset($pc_data['job_item_id'])) {
             $pcf->setJobItem($pc_data['job_item_id']);
         }
         if (isset($pc_data['quantity'])) {
             $pcf->setQuantity($pc_data['quantity']);