fix: fourge_error revisions always bill $0 to client
Fourge's own error revisions should never be charged to the client. getRevisionChargeQuantity now returns 0 for revision_type=fourge_error regardless of version number. Applied at all 4 invoice picker call sites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -376,7 +376,7 @@ export default function Invoices() {
|
||||
const invAddRevision = (rev) => {
|
||||
const svcType = pickInitialServiceType(rev.task?.submissions, rev.service_type || rev.task?.title || 'Revision');
|
||||
const price = invPriceList.find(p => p.service_type === svcType && p.price_type === 'revision');
|
||||
const revisionChargeQty = getRevisionChargeQuantity(rev?.version_number);
|
||||
const revisionChargeQty = getRevisionChargeQuantity(rev?.version_number, rev?.revision_type);
|
||||
const qty = revisionChargeQty > 0 ? revisionChargeQty : 1;
|
||||
const unitPrice = revisionChargeQty > 0 ? (price?.price || '') : 0;
|
||||
const desc = invBuildRevisionItemDescription(rev);
|
||||
@@ -2017,7 +2017,7 @@ export default function Invoices() {
|
||||
</div>
|
||||
{invUnbilledRevisions.map(r => {
|
||||
const added = invItems.some(i => i.submission_id === r.id);
|
||||
const revisionQty = getRevisionChargeQuantity(r?.version_number);
|
||||
const revisionQty = getRevisionChargeQuantity(r?.version_number, r?.revision_type);
|
||||
const revisionServiceType = pickInitialServiceType(r.task?.submissions, r.service_type || r.task?.title || 'Revision');
|
||||
const revisionPrice = invPriceList.find(p => p.service_type === revisionServiceType && p.price_type === 'revision');
|
||||
const revisionLabel = revisionQty > 0 ? (revisionPrice ? `$${Number(revisionPrice.price).toFixed(2)}` : 'No price') : 'Free';
|
||||
|
||||
Reference in New Issue
Block a user