Approven von Beitragserstattungen
This commit is contained in:
@@ -46,9 +46,10 @@ class GlobalDataProvider {
|
||||
]);
|
||||
}
|
||||
|
||||
/** Die Typen für die Neuanlage durch Nutzer*innen. Reisekosten haben ein eigenes Formular. */
|
||||
public function getInvoiceTypes() : JsonResponse {
|
||||
$invoiceTypes = [];
|
||||
foreach (InvoiceType::orderBy('sort_order')->get() as $invoiceType) {
|
||||
foreach (InvoiceType::selectable() as $invoiceType) {
|
||||
if (
|
||||
$invoiceType->slug === InvoiceType::INVOICE_TYPE_TRAVELLING
|
||||
) {
|
||||
@@ -110,9 +111,15 @@ class GlobalDataProvider {
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Die Typen zum Umbuchen durch die Kassenwart*innen -- „Sonstige Kosten" ans Ende.
|
||||
*
|
||||
* Auch hier nur wählbare Typen: sonst ließe sich eine beliebige Abrechnung nachträglich zu einer
|
||||
* Beitragserstattung machen, ohne dass ein Erstattungsvorgang dahinterstünde.
|
||||
*/
|
||||
public function getAllInvoiceTypes() : JsonResponse {
|
||||
$invoiceTypes = [];
|
||||
foreach (InvoiceType::orderBy('sort_order')->get() as $invoiceType) {
|
||||
foreach (InvoiceType::selectable() as $invoiceType) {
|
||||
if (
|
||||
$invoiceType->slug === InvoiceType::INVOICE_TYPE_OTHER
|
||||
) {
|
||||
|
||||
@@ -16,13 +16,21 @@ class UploadFileProvider {
|
||||
$this->costUnit = $costUnit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Das Ablageverzeichnis der Belege einer Kostenstelle, relativ zur Disk `local`
|
||||
* (Wurzel `storage/app/private`).
|
||||
*
|
||||
* Öffentlich, weil Belege nicht nur aus einem Upload entstehen: Eine Beitragserstattung erzeugt ihren
|
||||
* Eigenbeleg im Speicher und legt ihn über den FileWriteProvider ab -- landen soll er trotzdem dort,
|
||||
* wo alle anderen Belege liegen.
|
||||
*/
|
||||
public static function directoryFor(CostUnit $costUnit) : string {
|
||||
return sprintf('%1$s/invoices/%2$s', app('tenant')->slug, $costUnit->id);
|
||||
}
|
||||
|
||||
public function saveUploadedFile() : ?InvoiceFile {
|
||||
try {
|
||||
$directory = sprintf(
|
||||
'%1$s/invoices/%2$s',
|
||||
app('tenant')->slug,
|
||||
$this->costUnit->id
|
||||
);
|
||||
$directory = self::directoryFor($this->costUnit);
|
||||
|
||||
$filename = $this->normalizeFilename($this->file->getClientOriginalName());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user