Archived
Added customer_nr to database and invoice templates.
Used standard DATEV format(10000 – 69999) Fixes #31
This commit is contained in:
1 parent
9e877ac722
commit
6fa3459eeb
8 files changed
+35
-4
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user