Skip to main content

Charge Repetition

This section describes the BfmChargeRepetitionComponent component.

Usage

You need to import it in your module and use it in your template.

charge-repetition.component.ts
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:

charge-repetition.component.html
<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

tip

When emitting an individual invoice, set chargeType to CHARGE_TYPE.none and emitInvoice to true

TypeDefault
CHARGE_TYPE enum from @celerofinancas/core-tsCHARGE_TYPE.none

companyPk

Company identifier

Type
string

disableValueField

Whether the value field should be disabled

TypeDefault
booleanfalse

emitInvoice

Whether the charge will also emit invoices

tip

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

TypeDefault
booleantrue

enableApplyToAll

Whether the "apply to all" functionality should be enabled

TypeDefault
booleantrue

installmentNumber

Installment number

TypeDefault
number0

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

TypeDefault
booleantrue

isMultiInvoice

Whether each bill has its own invoice

TypeDefault
booleanfalse

isRecurring

Whether charge is recurring or a progress payment

TypeDefault
booleanfalse

shouldApplyDescriptionToAll

Whether it should initialize with apply to all option enabled

TypeDefault
booleanfalse

showServiceDiscountField

Whether the service discount field should be shown

TypeDefault
booleanfalse

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