個別報酬
このトピックでは、個別報酬プロセスの実装に関する考慮事項を示します。
報酬の設定管理、個別報酬および個人報酬
通常は、このような場合にフィールド値のデフォルト設定と検証を使用できます。
- 従業員のみが次の四半期の1日より後に報奨を作成できるようにする日付のデフォルト。
- 従業員のみが次の四半期の1日以降に報奨を作成できることを確認します。
- ライン・マネージャの特定のプランが除外されていることを確認します。
- 現在の会計年度(4月1日から3月31日)の日付を検証します。
- 臨時賞与が2024年4月1日または2024年10月1日に有効であることを検証します
- 新規採用賞与が$3000を超えないことを検証します
- 自動車手当の増加が10%以下であることを検証します。
- 新規報酬が月の17日以前に開始されることを検証します
- 報奨提示が一度に1つのみ送信されることを検証します
- バスとタクシーの払戻が一緒に請求されていないことを検証します
- ボーナスを6か月以内に1回のみ配賦できることを確認します。
この表は、報酬の設定管理、個別報酬および個人報酬に対してサポートされている属性、例外および実装に関する推奨事項を示しています。
これは、「自分のクライアント・グループ」タブからアクセスする「報酬管理」ページ、自分のチームからアクセスする「個別報酬」ページ、および「自分」タブからアクセスする「自分のクライアント・グループ」タブおよび「自分」タブからアクセスする「個人拠出」ページに適用されます。
値のデフォルト設定の条件内 | フィールド値のデフォルト設定 | 値の検証の条件内 | フィールド値の検証 | 実装ガイドライン |
---|---|---|---|---|
*性能に影響を与えることができます |
|
「時期」セクション
「報酬」セクション
|
該当なし |
|
例
「デフォルト報奨が次の四半期の1日より後に従業員のみが作成できる日付」.
拡張式
let effectiveDate = new Date();
let currentQuarter = Math.floor((effectiveDate.getMonth() + 3) / 3);
// Get first date of current quarter
effectiveDate.setDate(1);
effectiveDate.setMonth((currentQuarter - 1) * 3);
// Use this technique for year rollover
effectiveDate.setMonth(effectiveDate.getMonth() + 3);
return effectiveDate.toISOString().slice(0, 10);
現在の会計年度(4月1日から3月31日)になるように「時期」の日付を検証します
拡張式
let effectiveDate = $fields.individualCompensationDetails.EffectiveDate.$value();
if (effectiveDate) {
// Fetch current financial year start date
let currentDate = new Date();
let fyStartDate = null, fyEndDate = null;
if (currentDate.getMonth() + 1 <= 3) {
fyStartDate = new Date(currentDate.getFullYear() - 1, 3, 1);
fyEndDate = new Date(currentDate.getFullYear(), 2, 31);
} else {
fyStartDate = new Date(currentDate.getFullYear(), 3, 1);;
fyEndDate = new Date(currentDate.getFullYear() + 1, 2, 31);
}
return (new Date(effectiveDate) < fyStartDate || new Date(effectiveDate) > fyEndDate);
}
return false;
新規採用賞与が$3000を超えないことを検証します
拡張式
if ($fields.individualCompensationDetails.PlanId.$value() === '100000018708168'
&& Number($fields.individualCompensationDetails.ValueString.$value()) > 3000) {
return true;
}
return false;
車両手当増加が10%以下であることを検証します
拡張式
if ($fields.individualCompensationDetails.ComponentId.$numberValue() === 300100010424490
&& $fields.individualCompensationDetails.Mode.$initialValue() === 'EDIT') {
let proposedValue = Number($fields.individualCompensationDetails.ValueString.$value());
let currentValue = Number($fields.individualCompensationDetails.ValueString.$initialValue());
if (proposedValue > (1.1 * currentValue))
return true;
}
return false;
この例では、ModeのinitialValueを使用して、有効日更新シナリオを処理します。
有効日更新の場合、新規レコードは新しく生成された分割であるため、新規レコードのモードは「CREATE」になります。
月の17日以前に開始する新規報奨の検証
拡張式
if ($fields.individualCompensationDetails.Mode.$value() == 'CREATE'
&& $fields.individualCompensationDetails.EffectiveStartDate.$value()) {
let planSD = new Date($fields.individualCompensationDetails.EffectiveStartDate.$value());
return (planSD.getDate() > 17)
}
return false;
報奨提示が一度に1つのみ送信されることを検証します
拡張式
let currentAllocations = $fields.individualCompensationDetails.CurrentAllocations.$value();
if (currentAllocations && currentAllocations.length) {
let newAllocationCount = 0;
for (let allocation of currentAllocations) {
if (allocation.Mode == 'CREATE')
newAllocationCount++;
}
if(newAllocationCount > 1)
return true;
}
return false;
バスとタクシーの払戻が一緒に請求されていないことを検証します
拡張式
let currentAllocations = $fields.individualCompensationDetails.CurrentAllocations.$value();
if (currentAllocations && currentAllocations.length) {
let busBonusPresent = false;
let taxiBonusPresent = false;
for (let allocation of currentAllocations) {
if (allocation.PlanId == '300100113565911')
busBonusPresent = true;
else if (allocation.PlanId == '300100113565893')
taxiBonusPresent = true;
}
return (busBonusPresent && taxiBonusPresent);
}
return false;
ボーナスが6か月に1回のみ割り当てられていることの検証
if ($fields.individualCompensationDetails.PlanId.$numberValue() === 300100090079227
&& $fields.individualCompensationDetails.Mode.$value() === 'CREATE') {
let startDate = new Date($fields.individualCompensationDetails.EffectiveStartDate.$value());
let minusSixMonth = new Date(startDate.getFullYear(), startDate.getMonth() - 6, startDate.getDay());
minusSixMonth = minusSixMonth.toISOString().slice(0, 10);
let priorAllocations = $fields.individualCompensationDetails.PriorAllocations.$value();
if (priorAllocations?.length) {
let priorSpotBonus = priorAllocations.find(record => record.PlanId == '300100004468561');
if (priorSpotBonus?.EffectiveStartDate > minusSixMonth) {
return true;
}
}
}
return false;
フィールド詳細
フィールド | フィールド・アクセサ | タイプ | コメント |
---|---|---|---|
処理日 | $fields.individualCompensationDetails.EffectiveDate.$value() |
||
レコード・レベル属性 | |||
プラン | $fields.individualCompensationDetails.PlanId.$value() | 数値 | PlanId計画名を表示する計画値リストを使用して選択 |
プラン・オプション | $fields.individualCompensationDetails.ComponentId.$value() |
数値 | OptionId: <Plan Name> - <Option Name>の形式で値を表示するオプションLOVを使用して選択 |
開始日 | $fields.individualCompensationDetails.EffectiveStartDate.$value() |
文字列 |
割当て開始日(文字列「(フォーマット): yyyy-MM-dd)」) 日付の比較には拡張式モードが必要です。 |
終了日 | $fields.individualCompensationDetails.EffectiveEndDate.$value() |
文字列 |
割当て終了日(文字列「(フォーマット): yyyy-MM-dd)」) 日付の比較には拡張式モードが必要です。 |
値 | $fields.individualCompensationDetails.ValueString.$value() |
文字列 |
文字列としてのプライマリ入力パラメータ。 文字列以外のプライマリ入力値には拡張式モードが必要です。 数値フィールドの場合、算術演算では値を数値に型キャストする必要があります。 同様に、日付フィールドの場合、日付比較では値を「日付:至」と入力する必要があります。 |
通貨 | $fields.individualCompensationDetails.DisplayCurrency.$value() |
文字列 | 通貨プライマリ入力パラメータの通貨 |
法的エンティティ | $fields.individualCompensationDetails.LegalEntityId.$value() |
数値 | LegalEntityId LE名を表示する法的エンティティ値リストを使用して選択 |
作成または編集 | $fields.individualCompensationDetails.Mode.$value() |
文字列 | モード属性は、レコードを新規に作成するか、既存のレコードを作成するかを決定します。 |
セクション・レベル属性 | |||
現在の割付 | $fields.individualCompensationDetails.CurrentAllocations.$value() |
配列 | オブジェクト構造
|
前回の割当 | $fields.individualCompensationDetails.PriorAllocations.$value() |
配列 | オブジェクト構造
|
トラブルシューティング
個別報酬オブジェクトのすべての属性を出力するには:
- 条件なしで検証ルールを作成
- 次の式を使用して、提案された値を表示するメッセージを追加:
[[ JSON.stringify($fields.individualCompensationDetails.$value(), null, 2) ]]
- 次の式を使用して、initialValue (EDITの場合のレコードのデータベース値)を表示する別のメッセージを追加:
[[ JSON.stringify($fields.individualCompensationDetails.$initialValue(), null, 2) ]]
- 新しい割当ての場合、initialValueはデータベースに存在しないためnullになります
-
セクション・レベルの検証についても同様です。 続行/送信時にトリガーされます。
-
CurrentAllocations配列の値を確認するには、メッセージの重大度を「error」に設定します。それ以外の場合は、送信を許可するか、次のセクションに移動します。
検証ルール定義

結果
