npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zenuinebit/supplier-ledger

v0.1.0

Published

Supplier payables: bills, payments, TDS withheld, ageing, due list, payment planning and early-payment discounts.

Readme

@zenuinebit/supplier-ledger

Payables for one supplier: statement, open bills with payment matching, ageing, a due list, payment planning with a limited budget, and early-payment discounts. Built on @zenuinebit/customer-ledger but speaking the language of payables. Amounts are positive integers in minor units; dates are "YYYY-MM-DD".

import { statement, openBills, balance, ageing, dueList, paymentPlan, earlyPaymentOffers, type SupplierTxn } from "@zenuinebit/supplier-ledger";

const txns: SupplierTxn[] = [
  { id: "B1", date: "2025-03-01", type: "bill", amount: 100_000, dueDate: "2025-03-31",
    terms: { percent: 2, withinDays: 10 } },                                           // "2/10 net 30"
  { id: "B2", date: "2025-03-05", type: "bill", amount: 50_000, dueDate: "2025-04-04" },
  { id: "T1", date: "2025-03-20", type: "tds", amount: 2_000, appliesTo: "B1" },      // TDS you withheld
  { id: "P1", date: "2025-03-20", type: "payment", amount: 98_000, appliesTo: "B1" },
];

balance(txns, "2025-03-25");               // what you owe: 50_000
openBills(txns, "2025-04-10");             // each bill: paid, balance, status, daysOverdue; plus owed, overdue, advance
ageing(txns, "2025-04-10");                // Current, 1-30, 31-60, 61-90, 90+
dueList(txns, "2025-03-25", 7);            // { overdue, dueSoon, totals }

// Which bills should this week's cash cover?
paymentPlan(txns, "2025-04-10", { budget: 30_000, strategy: "earliest-due" });
// { payments: [{ id, pay, partial }], total, remainingBudget, unpaid }

// Early-payment discounts still on offer
earlyPaymentOffers(txns, "2025-03-05");
// [{ billId: "B1", deadline: "2025-03-11", discount: 2000, payNow: 98000, impliedAnnualPercent: 37.2 }]

Transaction types: increase what you owe: opening, bill, extra-charge. Reduce it: payment, credit-note (issued by the supplier), purchase-return, tds (withheld, to be paid to the government), discount (early-payment discount taken). A reducing entry can name its bill with appliesTo; otherwise the oldest due bill is paid first.

Good to know

  • A positive balance means you owe the supplier; a negative one means they hold an advance from you (advance in the results).
  • To take an early-payment discount, post a discount for the offer's discount and a payment for payNow, both with appliesTo the bill.
  • impliedAnnualPercent is what paying early earns as a yearly rate (a "2/10 net 30" discount is about 37%). It is null if the bill is not due after the discount deadline.
  • paymentPlan only plans. By default it covers what is due today or overdue; pass dueWithinDays to include bills falling due soon, allowPartial: false to avoid part payments, and a strategy of earliest-due, smallest-first or largest-first.
  • Pair with @zenuinebit/tds-calc to work out the TDS to withhold, and @zenuinebit/purchase-gst for input credit.

Not included: several suppliers in one call (keep a list per supplier), storage, remittance advice, and foreign currency.