Skip to content

Featur/checkbox - #6

Merged
khafifithebork merged 3 commits into
dem-bijan:mainfrom
khafifithebork:featur/checkbox
Aug 7, 2026
Merged

khafifithebork merged 3 commits into
dem-bijan:mainfrom
khafifithebork:featur/checkbox

Conversation

@khafifithebork

Copy link
Copy Markdown
Collaborator

No description provided.

khafifithebork and others added 3 commits August 7, 2026 12:22
Adds the two operational billing indicators to the Achats and Trésorerie
views:

  Impact analytique chantier  L'achat a-t-il réellement servi au chantier ?
  Impact comptable / fiscal   Y a-t-il une facture officielle à déclarer ?

IndicateursOperation.tsx holds the shared checkbox, badge and tri-state
filter so both views read identically. Each list gains a badge column per
indicator, filters for them, and Achats also gains a sort selector. Badges
double as in-place toggles, optimistic with rollback if the PATCH fails,
because there is no full edit form for an operation to hang them off.

The indicator fields are optional on the shared Achat/Transaction types so
the mock fixtures in lib/data keep type-checking.

Chantier deletion also gave no feedback at all. A failed delete wrote to
`error`, which only renders when the list is empty, so the user saw
nothing happen. Delete and démarrer failures now go to a separate,
dismissible notice that renders regardless of list state, and
extractApiErrorMessage pulls the reason out of the backend's RFC 7807
ProblemDetail so the message names the records blocking the delete instead
of guessing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codes are now assigned by the server, so every create form stops asking
for one. Rather than deleting the field and disturbing each form's grid,
a shared read-only CodeField takes its place: "Attribué automatiquement"
while creating, the actual code when editing. Covers fournisseurs,
sous-traitants, chantiers, articles, catégories, employés (matricule),
fiches de paie, contrats et paiements de sous-traitance, attachements and
caisses. The corresponding fields are gone from the Create…DTOs, and the
required-field messages no longer mention a code.

The BPU line form keeps its ref input on purpose — those refs come from
the client's tender document, not from us.

Expanding a purchase order now reveals its lines, with the unit price
editable in place. Saving sends PATCH /achats/{id}/lignes/{ligneId}/prix
and swaps in the recomputed order the server returns, so the row's
HT/TVA/TTC update with it. Re-pricing is allowed at any statut; when the
order is already invoiced or paid the server's warning is shown above the
lines instead of being swallowed.

updateLignePrix reads the response envelope before the axios interceptor
unwraps it, since the warning travels in `message` and would otherwise be
discarded along with the envelope.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Achats table had no actions column, so the three §8.2 transitions were
unreachable: orders sat at En cours forever, stock was never provisioned
and supplier debt was never settled. Each row now offers exactly the one
step valid at its current statut — Valider le BL, Valider la facture,
Valider le paiement — and nothing at all once PAYE. The buttons mirror
the server's @PreAuthorize (ADMIN/ACHAT/PM for the BL, ADMIN/FINANCE for
the other two), so a role is never offered a step the server would
refuse; it is shown as plain text instead.

BL and facture prompt for their reference, and settling asks for
confirmation naming the caisse and the TTC about to be debited. Failures
are shown verbatim rather than paraphrased, so the user sees "Cannot
FACTURE an Achat that is currently 'EN_COURS'" or "Insufficient funds in
caisse '…'. Solde: X, Debit: Y" and knows what to do. The list reloads
after each transition, keeping stock and caisse figures in step.

Prices are doubles on the wire now, which needs no change here since
TypeScript numbers already are.

Also aligns the stock alert rule. functions2.tsx carried its own copy as
`quantiteDisponible <= seuilAlerte`, missing the backend's `seuilAlerte
> 0` guard, so the two disagreed for any line sitting at zero quantity.
Both now go through estSousSeuil. Note this predicate is false for every
row today: nothing ever writes seuilAlerte, so it is always 0 — see the
README for what making that feature live would take.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

@khafifithebork is attempting to deploy a commit to the Mohamed najib's projects Team on Vercel.

A member of the Team first needs to authorize it.

@khafifithebork
khafifithebork merged commit 411d684 into dem-bijan:main Aug 7, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant