Creates a new Posting instance.
Object containing posting properties
The account name for this posting
OptionalamountThe amount as a string (may be omitted for auto-calculated postings)
OptionalcommentOptional comment for this posting
OptionalcostOptional cost specification (e.g., for currency conversions)
OptionalcurrencyThe currency code for the amount
OptionalflagOptional posting flag (e.g., '*' for cleared)
OptionalpriceAmount for the price annotation
OptionalpriceCurrency for the price annotation
Gets the formatted price string combining amount, currency, cost, and price annotation.
The formatted price string, or undefined if no price components exist
Converts this posting to a formatted string with aligned currency column. Adds padding before the price to align at the specified column.
Formatting options including currency column position
The formatted string representation of this posting
Converts this posting to a string representation. Delegates to toFormattedString with zero currency column alignment.
The string representation of this posting
StaticfromParses a posting line string into a Posting instance. Expected format: [Flag] Account [Amount Currency] [{Cost}] [@ PriceAmount PriceCurrency] [; Comment]
The posting line string to parse
A new Posting instance
Represents a single posting (account movement) within a transaction. Each posting records an amount moving to/from an account.