Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.common.document;

import com.itextpdf.text.Document;

/**
 * Per-document mutable state threaded through the sections during a single render. Holds the open
 * iText {@link Document}, the normalized {@link DocumentData}, and the running totals that the item
 * table accumulates and the summary section reads back.
 */
public class PdfContext {

    private final Document document;
    private final DocumentData data;

    // Running totals accumulated by ItemsTableSection, consumed by SummarySection.
    public float totalTaxable;
    public float totalTaxAmount;
    public float totalNetAmount;
    public float totalGrossSale;
    public float totalCgst;
    public float totalSgst;
    public float totalIgst;
    public float totalInvoiceValue;

    public PdfContext(Document document, DocumentData data) {
        this.document = document;
        this.data = data;
    }

    public Document document() { return document; }
    public DocumentData data() { return data; }
}