示例#1
0
 $uwlf = new UserWageListFactory();
 $uwlf->getByUserIdAndStartDateAndEndDate($user_id, $wage_effective_date, $wage_effective_date);
 if ($uwlf->getRecordCount() == 1) {
     $uwf = $uwlf->getCurrent();
     echo "(U) ";
 } else {
     $uwf = new UserWageFactory();
 }
 $uwf->setUser($user_id);
 if (isset($mapped_row['wage_type_id']) and $mapped_row['wage_type_id'] != '') {
     $uwf->setType(Misc::importCallInputParseFunction('wage_type_id', $mapped_row['wage_type_id'], $filtered_import_map['wage_type_id']['default_value'], $filtered_import_map['wage_type_id']['parse_hint']));
 }
 if (isset($mapped_row['wage']) and $mapped_row['wage'] != '') {
     $uwf->setWage(Misc::importCallInputParseFunction('wage', $mapped_row['wage'], $filtered_import_map['wage']['default_value'], $mapped_row['wage_type_id']));
 }
 if ($uwf->getType() == 20) {
     if (isset($mapped_row['wage_weekly_time']) and $mapped_row['wage_weekly_time'] != '') {
         $uwf->setWeeklyTime(Misc::importCallInputParseFunction('wage_weekly_time', $mapped_row['wage_weekly_time'], $filtered_import_map['wage_weekly_time']['default_value'], $filtered_import_map['wage_weekly_time']['parse_hint']));
     }
 }
 if (isset($mapped_row['labor_burden_percent']) and $mapped_row['labor_burden_percent'] != '') {
     $uwf->setLaborBurdenPercent(Misc::importCallInputParseFunction('labor_burden_percent', $mapped_row['labor_burden_percent'], $filtered_import_map['labor_burden_percent']['default_value'], $filtered_import_map['labor_burden_percent']['parse_hint']));
 }
 $uwf->setEffectiveDate($wage_effective_date);
 echo "Effective: " . TTDate::getDate('DATE', $wage_effective_date);
 unset($wage_effective_date);
 if ($uwf->isValid()) {
     $uwf->Save();
     echo " \t\t\tSuccess!\n";
 } else {
     echo " \t\t\tFailed!\n";