24 lines
1.2 KiB
JavaScript
24 lines
1.2 KiB
JavaScript
import { financialReportFixture } from './integral-financial-plan.mjs';
|
|
|
|
export function dayTermsFixture(periods = 3) {
|
|
const p = financialReportFixture(periods);
|
|
const schedule = amount => Array.from({ length: periods }, (_, i) => i === 0 ? amount : '0');
|
|
p.products = [{ label: 'Serviço sintético F20-A', monthlyUnits: '0', unitPrice: '1000', unitVariableCost: '0', monthlyUnitsByPeriod: schedule('1') }];
|
|
p.useInventoryPurchaseSchedule = true;
|
|
p.inventoryPurchaseSchedule = schedule('400').map(amount => ({ amount, leadMonths: 0 }));
|
|
p.monthlyOperatingExpensesByPeriod = schedule('100');
|
|
p.monthlyPayrollExpense = '0';
|
|
p.monthlyPayrollPayments = '0';
|
|
p.monthlyCollections = '777'; // Kept, never added to the opted-in sales agenda.
|
|
p.reportAssumptions.manualCollectionsKind = 'sales';
|
|
p.dayTerms = { sales: true, purchases: true, services: true, operations: [
|
|
operation('sales', '1000'), operation('purchases', '400'), operation('services', '100'),
|
|
] };
|
|
return p;
|
|
}
|
|
|
|
export function operation(kind, amount) {
|
|
return { kind, month: 1, originId: kind + '-1', parcelId: '1', amount, termDays: '30',
|
|
recognitionBasis: 'monthly', recognitionDate: '', originBasis: 'recognition', originDate: '' };
|
|
}
|