Featur/checkbox - #6
Merged
Merged
Conversation
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>
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.