$udtf->setBranch($udt_data['branch_id']);
 $udtf->setDepartment($udt_data['department_id']);
 if (isset($udt_data['job_id'])) {
     $udtf->setJob($udt_data['job_id']);
 }
 if (isset($udt_data['job_item_id'])) {
     $udtf->setJobItem($udt_data['job_item_id']);
 }
 if (isset($udt_data['quantity'])) {
     $udtf->setQuantity($udt_data['quantity']);
 }
 if (isset($udt_data['bad_quantity'])) {
     $udtf->setBadQuantity($udt_data['bad_quantity']);
 }
 $udtf->setOverTimePolicyID($udt_data['over_time_policy_id']);
 $udtf->setPremiumPolicyID($udt_data['premium_policy_id']);
 $udtf->setAbsencePolicyID($udt_data['absence_policy_id']);
 $udtf->setMealPolicyID($udt_data['meal_policy_id']);
 $udtf->setTotalTime($udt_data['total_time']);
 $udtf->setPunchControlID((int) $udt_data['punch_control_id']);
 if (isset($udt_data['override']) and $udt_data['override'] == 1) {
     Debug::Text('Setting override to TRUE!', __FILE__, __LINE__, __METHOD__, 10);
     $udtf->setOverride(TRUE);
 } else {
     $udtf->setOverride(FALSE);
 }
 if ($udtf->isValid()) {
     $udtf->setEnableCalcSystemTotalTime(TRUE);
     $udtf->setEnableCalcWeeklySystemTotalTime(TRUE);
     $udtf->setEnableCalcException(TRUE);
     $udtf->Save();