Added customer_nr to database and invoice templates.

Used standard DATEV format(10000 – 69999)

Fixes #31
This commit is contained in:
2025-10-21 17:12:50 +02:00
parent 9d473ef45f
commit e6a75bf16b
7 changed files with 33 additions and 4 deletions
+17 -1
View File
@@ -20,4 +20,20 @@ public function index()
return ApiDataTransformer::snakeToCamel($customerArray);
});
}
}
/**
* Generate a random available customer number
*/
public static function generateCustomerNumber()
{
$newNumber = null;
while (!$newNumber) {
// DATEV standard
$randomNumber = rand(10000, 69999);
$customer = Customer::firstWhere('customer_nr', $randomNumber);
if ($customer) {
return $randomNumber;
}
}
}
}