feat(finance): project PGC-PE supplier advances by operation in QA
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import {financialReportFixture} from './integral-financial-plan.mjs';
|
||||
export function advanceFixture({kind='purchases',amount='100000',recognition='2027-02-15',invoice='2027-03-01',periods=4}={}) {
|
||||
const p=financialReportFixture(periods);
|
||||
p.products=[{label:'Sintético F20-B',monthlyUnits:'0',unitPrice:'0',unitVariableCost:'0'}];
|
||||
p.monthlyOperatingExpenses='0';p.monthlyOperatingExpensesByPeriod=Array(periods).fill('0');
|
||||
p.monthlyPayrollExpense=p.monthlyPayrollPayments=p.monthlyInterestExpense=p.monthlyInterestPayment=p.monthlyPrincipalRepayment='0';
|
||||
p.monthlyVariableCostPayments='999';p.monthlyOperatingPayments='888';
|
||||
p.useInventoryPurchaseSchedule=true;
|
||||
p.inventoryPurchaseSchedule=Array.from({length:periods},()=>({amount:'0',leadMonths:0}));
|
||||
if(recognition) {
|
||||
const m=(Number(recognition.slice(0,4))-2027)*12+Number(recognition.slice(5,7))-1;
|
||||
if(m<periods) {
|
||||
if(kind==='purchases')p.inventoryPurchaseSchedule[m].amount=amount;
|
||||
else p.monthlyOperatingExpensesByPeriod[m]=amount;
|
||||
}
|
||||
}
|
||||
// Both agendas explicitly selected; zero-recognition category has no operations.
|
||||
p.supplierAdvances={regime:'PGC-PE',purchases:true,services:true,operations:[{
|
||||
kind,originId:'OP-1',parcelId:'P-1',supplier:'Fornecedor sintético',amount,
|
||||
recognitionDate:recognition,invoiceDate:invoice,ordinaryContract:true,events:[],
|
||||
}]};
|
||||
return p;
|
||||
}
|
||||
export const event=(id,kind,date,amount)=>({id,kind,date,amount});
|
||||
Reference in New Issue
Block a user