Skip to content

PaymentDetailsComponent

reference
3 min readUpdated

Kind: Class

Source: Frontend/src/app/components/payments/payment-details/payment-details.component.ts (line 55)

Part of: Frontend

PaymentDetailsComponent manages the payment-details view in the frontend application. It loads payment records, currencies, and tab state; applies authorization and edit checks; prepares table data; and controls actions such as reset and library opening.

Implements: OnInit, ComponentCanDeactivate

Methods

MethodSignatureReturns
GetAuthorizationAccessGetAuthorizationAccess(url: string)void
checkAllowedToEditcheckAllowedToEdit()void
ngOnInitngOnInit()void
getRecordgetRecord()void
getOpenedTabsgetOpenedTabs()void
resetreset()void
openLibraryopenLibrary()void
getCurrenciesgetCurrencies()void
fillTableViewfillTableView()void
disablingAllocatedAmountdisablingAllocatedAmount()void
fillColumnsfillColumns()void
cellUpdated_HandlercellUpdated_Handler(e: InvoicesForPayment)void
ifInOwnCurrencyifInOwnCurrency(dataField: undefined)boolean
displayFormattedCurrencydisplayFormattedCurrency(value: undefined, dataField: undefined, rowData: undefined)void
formatCellsformatCells(e: undefined)void
getClientsgetClients()void
getPrinciplesgetPrinciples()void
getReceivingMethodgetReceivingMethod()void
selectTextselectText(e: undefined)void
applyFilterapplyFilter()void
onKeyDownonKeyDown(e: KeyboardEvent)void
getPaymentByPaymentIDgetPaymentByPaymentID()void
changeTabschangeTabs(targetTab: undefined)void
savePaymentsavePayment(SaveAndLeave: undefined)void
ValidatePaymentValidatePayment()boolean
SelectAccountSelectAccount(ID: undefined)void
DeSelectAccountDeSelectAccount(ID: undefined)void
GetInvoicesbyAccountIDGetInvoicesbyAccountID(withoutNewAllocated: boolean)void
AutomaticAmountDivisionAutomaticAmountDivision()void
displaydisplay(data: undefined)void
DataChangedDataChanged()void
gridItem_KeyPress_NumbergridItem_KeyPress_Number(event: undefined)void
chanegRecievingMethodchanegRecievingMethod(e: undefined)void
getCurrencyRategetCurrencyRate(currency: CurrencyRate)void
currencyChangedcurrencyChanged(e: undefined)void
enteringAmountenteringAmount(e: undefined)void
ngOnDestroyngOnDestroy()void
openPopupopenPopup(n: string, t: string, i: string, btnTxt: string)void
OnOpenedPopupOnOpenedPopup()void
savePopupsavePopup()void
checkcheck()void
closePopupclosePopup()void
saveAndClosesaveAndClose()void
closeclose()void
leavePageleavePage()void
ClosewithDonotSaveClosewithDonotSave()void
canDeactivatecanDeactivate(nextUrl: RouterStateSnapshot)void
changeRateAssistantListchangeRateAssistantList(e: undefined, index: number)void
selectNumberselectNumber(e: undefined, input: undefined)void
disSelectNumberdisSelectNumber(e: undefined, input: undefined)void

Properties

PropertyType
sharedPopupSharedPopupComponent
DataValidatorDxValidationGroupComponent
FileLibraryFilesComponent
attachedDropdownSharedAttachedDocsComponent
environmentany
RelatedToTypeany
displayedInvoicesInvoicesForPayment[]
allocateddInvoicesInvoicesForPayment[]
checkChangesInvoicesInvoicesForPayment[]
allowedtoEditboolean
allowedtoEnableEditboolean
allowedtoNewboolean
IsNewPaymentboolean
paymentIDnumber
_passIdAsInputnumber
firstInitializedboolean
EnableEditingModeboolean
disabledNewAllocationboolean
pendingNavigationUrlRouterStateSnapshot
popupany
scriptPreventionPatternany
receivingPaymentMethodReceivingMethod[]
recevingMethodsEnumany
ModuleEnumIdany
LogModuleIdany
selectedDocsFileData[]
paymentPaymentDetails
oldPaymentPaymentDetails
CompletelyAllocatedInvoicesstring[]
dataSourceany
idColumnsNameany
selectedIDsany[]
clientListClient[]
principalListSupplier[]
NoChange_CanLeaveboolean
Change_Saved_CanLeaveboolean
Change_NoSave_WantLeaveboolean
isLeavingboolean
allowleaveboolean
Changedboolean
DateDisplayFormatany
salesInvoiceTypeboolean
tabsSwitchstring
LodingPanalMessageany
loadingVisibleany
subscriptionSubscription
currencyRateCurrencyRate
defaultCurrencyany
isProcessActiveBooleanboolean
tViewNewBtnaddButton

Where it refuses work

  • PaymentDetailsComponent stops the work with an early return when this.allowedtoEdit.
  • PaymentDetailsComponent stops the work with an early return when this.allowedtoNew.
  • PaymentDetailsComponent stops the work with an early return when dataField == "TotalAmount" || dataField == "PaidAmount" || dataField == "DeductionAmount"….
  • PaymentDetailsComponent stops the work with an early return when !this.ValidatePayment().
  • PaymentDetailsComponent stops the work with an early return when this.NoChange_CanLeave.
  • PaymentDetailsComponent stops the work with an early return when this.Change_Saved_CanLeave.

Diagram

mermaid
graph LR
    Init[ngOnInit] --> Auth[GetAuthorizationAccess]
    Init --> Record[getRecord]
    Init --> Tabs[getOpenedTabs]
    Init --> Currencies[getCurrencies]

    Record --> Table[fillTableView]
    Table --> Allocation[disablingAllocatedAmount]

    Auth --> Edit[checkAllowedToEdit]
    Edit --> Reset[reset]
    Edit --> Library[openLibrary]

Usage

typescript
import { TestBed } from '@angular/core/testing';
import { PaymentDetailsComponent } from './payment-details.component';

const fixture = TestBed.createComponent(PaymentDetailsComponent);
const component = fixture.componentInstance;

// Initialize payment data and access state.
component.ngOnInit();

// Refresh data when the active payment record changes.
component.getRecord();
component.getCurrencies();
component.fillTableView();

// Apply allocation-related field rules after table data is available.
component.disablingAllocatedAmount();

fixture.detectChanges();

AI Coding Instructions

  • Keep authorization checks in sync with edit-state behavior through GetAuthorizationAccess() and checkAllowedToEdit().
  • Load record, tab, and currency data before calling fillTableView() or allocation-related UI logic.
  • Preserve the reset flow in reset() so payment state and related table state are cleared together.
  • Route library-opening behavior through openLibrary() rather than adding duplicate dialog or navigation logic.

Used by

2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (2)

  • PaymentsComponentsModuleFrontend/src/app/components/payments/payments-components.module.ts:1
  • PaymentsRoutingModuleFrontend/src/app/components/payments/payments-routing.module.ts:1

Was this page helpful?

Download as PDF