Skip to content

BE-DP-27 · The payments no instalment records: their drivers, bills and verif_status

ID BE-DP-27 · Level L0 · Pack Pack R2 · The money study · Run order row 2, after BE-DP-18; any time before the money step · Issue #294

zuki said on #294 that v1's payments table is a real record, and that Pending means finance hasn't confirmed a payment yet. D74 loads each confirmed payment that BE-DP-18 found no instalment for onto its driver. Its bill takes as much as the bill still owes (R-MON-15), and the rest is the driver's credit. A Pending row doesn't load: the reconcile lists it until finance confirms it in v1. This step's counts are on #294 before the money step is written.

tools/migration/v1-copy/payments-unmatched.sql prints:

  • 1 · Their lead, bill, proof and accounts: in all, then by verif_status. It shows whether lead_id finds a lead and bill_id finds a bill, whether that bill is on the same lead, and how many have a proof, a receiving account and a sending account.
  • 2 · What their bills' open balance takes, by verif_status: how many fit what their bill still owes after its instalments, how many fit only in part, and how much becomes credit.
  • 3 · Possibly the same money twice, by verif_status: how many match one of the instalments that have no payments row, on the same bill and amount but another day, and how many days apart they are. Such pairs are reviewed on the money step's pull request, not loaded twice.
  • 4 · Every payments row by verif_status: with and without an instalment, how many were verified, by whom, and when they were made.

It prints counts, and sums over five payments or more, never a name, an account or one driver's amount (D15). It reads the copy and changes nothing in it.

  • BE-DP-18 is logged on #185.
  • docker ps --filter name=v1copy lists the copy as Up.
  • You are at the root of your clone, on main once this step's pull request is merged.
Terminal window
docker exec -i v1copy psql -qX -U postgres -d postgres < tools/migration/v1-copy/payments-unmatched.sql

Six tables, in a minute or so, headed 1 (two tables), 2, 3 (two tables) and 4.

  • 1: payments 586 and its sum near Rp 125.8M, as BE-DP-18 found.
  • 2: its payments add up to table 1's bill found.
  • 3: a few pairs at most. BE-DP-18 found 263 instalments with no payments row.
  • 1's second table and 4: no instalment adds up to 586. BE-DP-18 found them all Pending, so expect few or no Confirm rows.

Nothing in it names a person, an account or a file, so post the tables on #294 as printed.

  • ERROR: column … does not exist: the payments table isn't the one BE-DP-18 read. Post the line on #294.
  • ERROR: invalid input syntax for type boolean: a voided key holds something other than true or false. Post the line. It names the type, not the value.
  • Anything else: post the ERROR line on #294.

Nothing to undo: it reads only, and its tables and functions are temporary.

Log each run as a comment on #294: date · who · result, with the tables.