Charge Repetition
This section describes the BfmChargeRepetitionComponent component.
Usage
You need to import it in your module and use it in your template.
import { BfmChargeRepetitionComponent } from '@celerofinancas/ui-charges';
@Component({
standalone: true,
selector: 'charge-repetition',
imports: [BfmChargeRepetitionComponent],
templateUrl: './charge-repetition.component.html',
})
export class ChargeRepetitionComponent {}
Then, in your template, you can use the component like this:
<bfm-charge-repetition
[activeBillKeychain]="activeBillKeychain"
[billForm]="billForm"
[chargeType]="CHARGE_TYPE.none"
[companyPk]="'companyPk'"
[disableValueField]="false"
[emitInvoice]="true"
[enableApplyToAll]="true"
[installmentNumber]="0"
[invoiceForm]="invoiceForm"
[isFixedDateEmission]="true"
[isMultiInvoice]="false"
[isRecurring]="false"
[shouldApplyDescriptionToAll]="false"
[showServiceDiscountField]="false"
(applyToAll)="handleApplyToAll($event)"
/>
Inputs
The BfmChargeRepetitionComponent component has the following inputs:
activeBillKeychain
The bill keychain that will be used for the emission
| Type |
|---|
KEYCHAINS enum from @celerofinancas/core-ts |
billForm
Charge installment's bill FormGroup
| Type |
|---|
A FormGroup of Charge.Creation.Bill interface from @celerofinancas/core-ts |
chargeType
Charge type
When emitting an individual invoice, set chargeType to CHARGE_TYPE.none and emitInvoice to true
| Type | Default |
|---|---|
CHARGE_TYPE enum from @celerofinancas/core-ts | CHARGE_TYPE.none |
companyPk
Company identifier
| Type |
|---|
| string |
disableValueField
Whether the value field should be disabled
| Type | Default |
|---|---|
| boolean | false |
emitInvoice
Whether the charge will also emit invoices
When emitting a bill + invoice, set chargeType to bill and emitInvoice to true
When emitting a single invoice, set chargeType to none and emitInvoice to true
| Type | Default |
|---|---|
| boolean | true |
enableApplyToAll
Whether the "apply to all" functionality should be enabled
| Type | Default |
|---|---|
| boolean | true |
installmentNumber
Installment number
| Type | Default |
|---|---|
| number | 0 |
invoiceForm
Charge installment's invoice FormGroup
| Type |
|---|
A FormGroup of Charge.Creation.Invoice interface from @celerofinancas/core-ts |
isFixedDateEmission
Whether the invoices have a fixed date emission
| Type | Default |
|---|---|
| boolean | true |
isMultiInvoice
Whether each bill has its own invoice
| Type | Default |
|---|---|
| boolean | false |
isRecurring
Whether charge is recurring or a progress payment
| Type | Default |
|---|---|
| boolean | false |
shouldApplyDescriptionToAll
Whether it should initialize with apply to all option enabled
| Type | Default |
|---|---|
| boolean | false |
showServiceDiscountField
Whether the service discount field should be shown
| Type | Default |
|---|---|
| boolean | false |
Events
The BfmChargeRepetitionComponent component has the following Events:
applyToAll
Emits an object with keys bills and invoices, each with a { key: value } pair of the field that should be "applied to all"
| Type |
|---|
| EventEmitter |