added place to telecommunication, added contract documents, added invoice to other contracts
This commit is contained in:
@@ -59,6 +59,7 @@ export async function addInvoice(energyContractDetailsId: number, data: CreateIn
|
||||
return prisma.invoice.create({
|
||||
data: {
|
||||
energyContractDetailsId,
|
||||
contractId: energyDetails.contractId,
|
||||
invoiceDate: data.invoiceDate,
|
||||
invoiceType: data.invoiceType,
|
||||
documentPath: data.documentPath,
|
||||
@@ -67,6 +68,28 @@ export async function addInvoice(energyContractDetailsId: number, data: CreateIn
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Rechnung direkt über contractId hinzufügen (für alle Vertragstypen)
|
||||
*/
|
||||
export async function addInvoiceByContract(contractId: number, data: CreateInvoiceData) {
|
||||
return prisma.invoice.create({
|
||||
data: {
|
||||
contractId,
|
||||
invoiceDate: data.invoiceDate,
|
||||
invoiceType: data.invoiceType,
|
||||
documentPath: data.documentPath,
|
||||
notes: data.notes,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function getInvoicesByContract(contractId: number) {
|
||||
return prisma.invoice.findMany({
|
||||
where: { contractId },
|
||||
orderBy: { invoiceDate: 'desc' },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Rechnung aktualisieren
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user