Skip to main content
Technical ManualLooking for step-by-step instructions? In the User Manual: Sales Tax Returns

Sales Tax

The Sales Tax module works out the Michigan sales, use and withholding return (Form 5080) of each filing period and the annual return (5081) from the books, keeps them as filed, amends them (5092, 5082) and posts their payment (STX-01 to STX-08, STX-11 to STX-13, STX-17).

ProjectsCrestApps.Almohaseb.SalesTax (module), CrestApps.Almohaseb.SalesTax.Core (models, calculator, service, posting)
FeatureCrestApps.Almohaseb.SalesTax (Sales tax returns); depends on Accounting, Sales & receivables and Sales categories; enabled by both business recipes
CollectionSalesTax

Periods and due dates​

FilingPeriod(Frequency, From, To) with Key (2026-10, 2026-Q3, 2026), For(frequency, date), Parse(key), Previous(), Next(). MichiganSalesTax.DueDate(period): the 20th of the month after a month or quarter, February 28 after a year (the legacy showed December 31, STX-03), moved off weekends; holidays are not yet in.

Tax content​

MichiganTaxYear per year (2024–2026): Rate 6%, DiscountShare 4/6, DiscountRate20th 0.5%, DiscountRate12th 0.75%, minimum discounts 6 / 18 / 72 by frequency. A later year uses the latest known one. The legacy hard-coded the rate across the screen (STX-04).

Calculation​

MichiganSalesTax.Compute(SalesTaxComputationInput) is pure and returns a SalesTaxWorksheet (the 5095 worksheet) and SalesTaxReturnLines (the 5080 lines, named after the 2025 XSD):

  • Gross sales: each category with IncludedOnReturn that is not the sales tax category, AlwaysMinus ones negative. A non-taxable category is a deduction on its exemption's ReturnLine (lower-cased), else 5k. The legacy's bottle deposit/refund netting is not carried: deposits and refunds are categories like any other.
  • Tax not included: 2a = (gross − deductions) × rate. Included: 5l = (gross − deductions) × rate ÷ (1 + rate) and 2a = 5l. 2a also takes ExcessCollected.
  • 1b gross use → 2b = × rate; 3a prepaid; 4a = 2a − 3a; 4b = 2b.
  • Discount (5a, 5b): eligible × 4/6 × the rate of the DiscountOption, at least the frequency minimum, at most the eligible tax; none for None or when late.
  • 6a = 4a − 5a; 6b = 4b − 5b; 7 = UseTaxPurchases × rate; 8 = Withholding; 9 = 6a + 6b + 7 + 8; 10 = PriorPayments; 11 = max(0, 9 − 10).
  • Late (filed after the due date): PenaltyPercent 5% for up to two months late, +5% per month or part after, 25% at most (the legacy added 5% a day after day 60 and nothing on day 60, STX-08); interest = 11 × InterestRate % × days late ÷ 365 (the rate is entered until a rate table is published as tax content). 14 = 11 + 12 + 13.

Annual return​

MichiganSalesTax.ComputeAnnual(input, annualFiler, periodic, paidWithEarlier) returns AnnualReturnLines (5081 lines 1A–28, named after the 2025 XSD): 4A = 1A; 4B = 1B + 2B (Rentals) + 3B (Telecom); 5a–5k A from the year's worksheet, 5lA, 5mA; 6 = 4 − 5m; 7 = 6 × rate (5lA when prices include the tax); 8A excess; 9 = 7 + 8; 10 the discount; 11 = 9 − 10; 12 paid and credited; 13 taxable purchases, 14 = 13 × rate, 15 paid; 16–18 payroll inputs, 19 paid; 20 = 11A + 11B + 14 + 18; 21 = 12A + 12B + 15 + 19 + paidWithEarlier; 22 overpayment, 23 credit forward or 24 refund (RefundOverpayment); 25 balance due; 26–27 late penalty and interest on 25; 28 = 25 + 26 + 27.

A monthly or quarterly filer's 10 and 12, 15 and 19 are PeriodicTotals.Sum of the latest filed version of each period of the year (discounts 5a/5b, paid 3a + 6a and 6b, 7, 8); the legacy summed saved drafts and discarded every 5080 when one 5092 existed (STX-12). An annual filer's discount is figured on 9 less prepaid with the annual minimum, and 12A is prepaid plus PriorPayments.

Amendments​

AmendAsync(returnKey, reason, explanation) starts version n + 1 of a period (stx-{period}-a{n}, ReturnKey 2026-09-a1) from its latest version, which must be filed or paid (NotAmendable); AmendmentReason 1–8 (Other needs the explanation, ExplanationRequired). The amendment copies the inputs, sets PaidWithEarlier (earlier PaidWithEarlier + PaidAmount; line 10 on a 5092, line 21 on a 5082) and EarlierSalesDiscount/EarlierUseDiscount, which it keeps when filed late (KeptDiscount). Forms: 5092 for a period, 5082 for the year. ReopenAsync refuses a version that has an amendment. The legacy compared the 5092 with itself and saved it as the 5080, and the 5082 overflowed the stack (STX-11, STX-13).

Service​

ISalesTaxService / SalesTaxService reads the sales through every ICategorySalesSource (the daily sales, registered by Sales; the service tickets, registered by Sales.Services), the prepaid tax through every IPrepaidSalesTaxSource (the fuel deliveries, FuelPrepaidSalesTaxSource, registered by Retail under [RequireFeatures(SalesTax)]), and the settings and categories through ISalesTaxLookup (ContentSalesTaxLookup: SalesTaxSettings of Settings > Sales tax, group almohaseb-sales-tax; the published AlmohasebSalesCategory items other than purchase categories, with their exemption's ReturnLine).

SalesTaxReturn (document stx-{period}): period, TaxYear, Form (5080, 5081 for annual filers), Amendment, DueDate, Status (Draft, Filed, Paid), Inputs, Worksheet, Lines, FiledDate, FiledBy, Confirmation, PaidDate, PaidAmount, PaymentAccountId, Revision. SalesTaxReturnIndex (PeriodKey; Status, DueDate).

  • ListAsync(year): each period of the year in the settings' frequency with its latest version, then the annual return for a periodic filer; ListVersionsAsync(period).
  • GetAsync(period): a filed or paid return as saved; a draft recomputed from the books with its inputs, as of today when past due.
  • SaveDraftAsync(period, inputs): BadAmount (negative or more than two decimals; rate outside 0–100), NotDraft.
  • FileAsync(period, date, confirmation): recomputed as of the date filed and frozen; BadDate (on or before the period end).
  • ReopenAsync, PayAsync(period, date, accountId) (NotFiled, PaymentAccountRequired (an asset), PostingFailed), UnpayAsync.

SalesTaxPaymentPostingRule (SalesTax.Payment) posts a SalesTaxPaymentBreakdown: Dr Sales Tax Payable (the balancing amount), Dr Sales Tax expense (use tax: 4b + 7, or the annual 11B − 12B + 14 − 15), Dr the penalty account (12 + 13, or 26 + 27), Dr the withholding liability (8, or 18 − 19; Payroll Liabilities, where payroll holds it, unless the settings name another), Cr the discount account (5a + 5b, or an annual filer's 10A + 10B; a periodic filer's discounts were taken with each payment; the sales tax expense without an account), Cr the payment account (14, or 28). Negative lines move to the other side. A payment without a date builds no entry, which takes the posted one out.

Admin​

Taxes menu (almohasebTaxes, icon fa-file-invoice-dollar) › Sales tax returns (Almohaseb/Taxes/SalesTax, year); a return at Almohaseb/Taxes/SalesTax/{period} (GET; POST the inputs), /File (filedDate, confirmation), /Reopen, /Pay (paidDate, accountId), /Unpay. Settings > Sales tax.

PermissionKeyImplied by
Prepare, file and pay sales tax returnsFileAlmohasebSalesTax
View sales tax returnsViewAlmohasebSalesTaxFileAlmohasebSalesTax

Still to come​

Michigan e-file (the State Gateway transport, XSD validation, acknowledgements; STX-18 to STX-22) and the ACH debit, the 5083/5085/5086 schedules, the PDF forms and the 5094 voucher (with U14), withholding from payroll (Phase 6), and holidays in the due dates.

See also​

  • Items for the sales categories and exemption reasons.
  • Retail for the prepaid tax on fuel.