MaintainBillDetail
MaintainBillDetail Business Rule enables editing existing bill detail records. This rule will be attached to a transaction and included in the TransactionBusinessRulesPacket. This rule will allow the modification of existing bill detail records as well as their soft deletion (expiration) including changing the value of any existing dynamic field as well as the following fixed fields on AsBillDetail.
- BillGroupGUID
- BillGroupType
- ReceivableDueType
- Amount
- DueDate
The MaintainBillDetail BR allows a collection of fields to be used as below.
- If the BILLDETAILGUID is specified in the rule header then the <From> configuration should be used in the <CopyToBillDetailFields> (as the rule currently works).
- If the BILLDETAILGUID is specified in the rule header and no <From> configuration is specified an error message should be thrown 'The XML element <From> is missing'.
- If the BILLDETAILGUID is NOT specified in the rule header then the <FromCollection> configuration should be used in the <CopyToBillDetailFields>.
- If the BILLDETAILGUID is NOT specified in the rule header and no <FromCollection> configuration is specified an error message should be thrown 'The XML element <FromCollection> is missing'.
- The collection pair consists of the BillDetaiGUID and the value to be populated into the respective field.
- The use of a single BillDetailGUID or Collection should be mutually exclusive within the BR configuration.
- <ShadowBillDetail> and <ReconcileBillDetail> configuration is retained and defines whether to delete the record (set the status to Shadowed) or Reconciled manually without connecting money to be used in a write off scenario.
- If different BillDetails need to use different <ShadowBillDetail> and <ReconcileBillDetail> then these can be passed in collections <ShadowBillDetailCollection> and <ReconcileBillDetailCollection>. This functionality works in the same way as when a single bill detail is passed.
- If the same bill detail is passed in both <ShadowBillDetailCollection> and <ReconcileBillDetailCollection> then the same rules should be applied as if both were passed in <ShadowBillDetail> and <ReconcileBillDetail>.
The rule can be configured with <UpdateBillDetailStatus> or <UpdateBillDetailStatusCollection> to update one or more bill detail records from one valid status to another valid status without affecting any of its associated bill details ( the BillDetail record status updates will not affect any reconciliation records that are associated to them). The rule supports the following statuses:
- Pending - indicates a bill detail, which has been created, but yet to be billed.
- Billed - indicates a bill detail, which has been billed already.
- UnderRecon - indicates a bill detail that is partially reconciled.
-
Reconciled – indicates a bill detail that is fully reconciled.
-
Shadowed – indicates a bill detail that is shadowed.
Element/Tag | Parent Element | Definition | Attribute | Element/Attribute Value and Description |
---|---|---|---|---|
<MaintainBillDetail> |
The opening and closing tag of the MaintainBillDetail Business Rule. |
|
||
<MaintainBillDetail> |
|
BILLDETAILGUID |
Optional: Identifies the bill detail record to be updated unless a <FromCollection> under <Fields> element is configured or <ShadowBillDetail> or <ShadowBillDetailCollection> is configured. Values: Math variable |
|
<CopyToMaintainBillDetailFields> |
<MaintainBillDetail> |
Optional element: This is the opening element for defining fields that can be updated. It may exist with <ShadowBillDetail> element or <UpdateBillDetailStatus>.
|
||
<Fields> |
<CopyToMaintainBillDetailFields> |
Required element: Contains the field configuration that defines the bill detail fields to update. |
||
<Field> |
<Fields> |
Required, Repeatable element Standard field configuration. |
||
<From> |
<Field> |
Required element: Identifies the field or math variable containing a value to which the field should be updated. When a single bill detail should be updated, use <From>. <From> and <FromCollection> are mutually exclusive in the same rule and any one of them must be configured. |
|
Values: Math variable or a field |
<FromCollection> | <Field> |
Required element: The element references a math variable of type collection whose keys are BillDetailGUIDs and their values are the field's new values. When there is a potential to update multiple bill detail records, use <FromCollection>. <From> and <FromCollection> are mutually exclusive in the same rule and any one of them must be configured. |
Value: Collection | |
<To> |
<Field> |
Required element: Identifies the field name to which the updated value should be applied. |
|
Value: Literal |
<ShadowBillDetail> |
<MaintainBillDetail> |
Optional: This element updates the bill detail record identified by the BILLDETAILGUID attribute to a shadowed status. This element may co-exist with CopyToBillDetailFields section in the same rule. |
|
Values: Math variable or Literal with "Yes" or "No" values. Default value is "No". Note: If the value is "Yes" then <ShadowBillDetail> takes precedence over <ReconcileBillDetail> and <ReconcileBillDetailCollection>. It will take lesser precedence when configured in combination with <UpdateBillDetailStatus> and <UpdateBillDetailStatusCollection>. |
<ReconcileBillDetail> | <MaintainBillDetail> | Optional: This element updates a single bill detail record identified by the BILLDETAILGUID attribute to reconciled status. This element may co-exist with CopyToBillDetailFields section in the same rule. |
Values: Math variable or Literal with "Yes" or "No" values. Default value is "No". Note: If configured in combination with <ShadowBillDetail> = "Yes" or <ReconcileBillDetailCollection> then this element is ignored. |
|
<ReconcileBillDetailCollection> | <MaintainBillDetail> | Optional: This element updates multiple bill detail records to reconciled status. The collection should be built with the keys as a BillDetailGUIDs and value as the reconciled amount. |
Value: Collection Note: If configured in combination with <ShadowBillDetail> = "Yes" then this element is ignored. This element takes precedence when configured in combination with <ReconciledBillDetail>. |
|
<UpdateBillDetailStatus> | <MaintainBillDetail> | Optional: This element updates a single BillDetail record identified by the attribute BILLDETAILGUID to the element's value. The element's value is validated against any of the code values from AsCodeBillDetailStatusCode. |
Value: Code value Note: If the element is configured in combination with <ShadowBillDetail> = "Yes" or <ReconcileBillDetail>, <UpdateBillDetailStatus>, then UpdateBillDetailStatus>will take precedence. |
|
<UpdateBillDetailStatusCollection> | <MaintainBillDetail> | Optional: This element updates multiple BillDetail records through the element's referenced collection. The collection should be built with the keys as a BillDetailGUIDs and values as a code value from AsCodeBillDetailStatusCode. These must be valid values. |
Value: Collection Note: If this element is configured in combination with <ShadowBillDetail> = "Yes" or <ReconcileBillDetail> or <UpdateBillDetailStatusCollection>, then <UpdateBillDetailStatusCollection> element will take precedence. |
XML Schema
<MaintainBillDetail BILLDETAILGUID="[variable]"> <CopyToBillDetailFields> <Fields> <Field> <From>[variable | field]</From> <To>[literal]</To> </Field> <Field>. . .</Field> </Fields> </CopyToBillDetailFields> <ShadowBillDetail>[Yes | No | variable]</ShadowBillDetail> <ReconcileBillDetail>[Yes | No | variable]</ReconcileBillDetail> <UpdateBillDetailStatus>[code value]</UpdateBillDetailStatus> </MaintainBillDetail>
OR
<MaintainBillDetail> <CopyToBillDetailFields> <Fields> <Field> <FromCollection>[collection]</FromCollection> <To>[literal]</To> </Field> <Field>. . .</Field> </Fields> </CopyToBillDetailFields> <UpdateBillDetailStatusCollection>[collection]</UpdateBillDetailStatusCollection> </MaintainBillDetail>
XML Example
MaintainBillDetail with Single Bill Detail
<MaintainBillDetail BILLDETAILGUID="BillDetailGUIDMV">
<CopyToBillDetailFields>
<Fields>
<Field>
<From>Activity:NewAmount</From>
<To>Amount</To>
</Field>
</Fields>
<Field>
<From>BillDetailChangeDateMV</From>
<To>BillDetailChangeDate</To>
</Field>
</Fields>
</CopyToBillDetailFields>
<ShadowBillDetail>Yes</ShadowBillDetail>
</MaintainBillDetail>
MaintainBillDetail with Multiple Bill Details (the BillDetailGUID defined in the collections as a key-value pair)
<MaintainBillDetail>
<CopyToBillDetailFields>
<Fields>
<Field>
<FromCollection>NewAmountCollection</From>
<To>Amount</To>
</Field>
<Field>
<FromCollection>BillDetailChangeDateCollection</From>
<To>BillDetailChangeDate</To>
</Field>
</Fields>
</CopyToBillDetailFields>
<ShadowBillDetail>Yes</ShadowBillDetail>
</MaintainBillDetail>
Activity Configuration to Create a Collection
<MathVariable VARIABLENAME=" BillDetailChangeDateCollection" TYPE="COLLECTION" OPERATION="CREATE" DATATYPE="MAP"></MathVariable>
<MathVariable VARIABLENAME="BillDetailChangeDateCollection" TYPE="COLLECTION" OPERATION="SETVALUE" DATATYPE="DATE" KEY="BillDetailGUID1">NewDateMV</MathVariable>
<MathVariable VARIABLENAME="BillDetailChangeDateCollection" TYPE="COLLECTION" OPERATION="SETVALUE" DATATYPE="DATE" KEY="BillDetailGUID2">NewDateMV</MathVariable>