pub struct TaxPostingGenerator;Expand description
Generates GL journal entries for tax postings derived from TaxLine records.
Implementations§
Source§impl TaxPostingGenerator
impl TaxPostingGenerator
Sourcepub fn generate_tax_posting_jes(
tax_lines: &[TaxLine],
company_code: &str,
doc_dates: &HashMap<String, NaiveDate>,
fallback_date: NaiveDate,
) -> Vec<JournalEntry>
pub fn generate_tax_posting_jes( tax_lines: &[TaxLine], company_code: &str, doc_dates: &HashMap<String, NaiveDate>, fallback_date: NaiveDate, ) -> Vec<JournalEntry>
Generate GL journal entries for each eligible TaxLine.
§Rules
| Document type | Deductible | Action |
|---|---|---|
| CustomerInvoice | any | DR AR Control / CR VAT Payable |
| VendorInvoice | true | DR Input VAT / CR AP Control |
| VendorInvoice | false | Skipped – tax absorbed into expense |
| JournalEntry | any | Skipped |
| Payment | any | Skipped |
| PayrollRun | any | Skipped |
| Generate GL journal entries for each eligible TaxLine. |
Each JE is dated using the source document’s date from doc_dates
(keyed by TaxLine::document_id), falling back to fallback_date
when no mapping is found. This prevents all tax JEs from clustering
at period-end when a single blanket posting date was previously used.
Auto Trait Implementations§
impl Freeze for TaxPostingGenerator
impl RefUnwindSafe for TaxPostingGenerator
impl Send for TaxPostingGenerator
impl Sync for TaxPostingGenerator
impl Unpin for TaxPostingGenerator
impl UnsafeUnpin for TaxPostingGenerator
impl UnwindSafe for TaxPostingGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more