mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Improvements for stripe statementdescriptor
This commit is contained in:
parent
de8efd9faa
commit
a6c044bf4f
@ -743,12 +743,26 @@ class BaseDriver extends AbstractPaymentDriver
|
||||
}
|
||||
|
||||
$invoices_string = str_replace(["*","<",">","'",'"'], "-", $invoices_string);
|
||||
// $invoices_string = "I-".$invoices_string;
|
||||
// $invoices_string = substr($invoices_string, 0, 22);
|
||||
|
||||
$invoices_string = "I-".$invoices_string;
|
||||
// 2023-11-02 - improve the statement descriptor for string
|
||||
$company_name = $this->client->company->present()->name();
|
||||
|
||||
$invoices_string = substr($invoices_string, 0, 22);
|
||||
|
||||
$invoices_string = str_pad($invoices_string, 5, ctrans('texts.invoice'), STR_PAD_LEFT);
|
||||
if(ctype_digit(substr($company_name, 0, 1)))
|
||||
$company_name = "X" . $company_name;
|
||||
|
||||
$suffix = strlen($invoices_string) + 1;
|
||||
|
||||
$length = 22 - $suffix;
|
||||
|
||||
$company_name = substr($company_name, 0, $length);
|
||||
|
||||
$descriptor = "{$company_name} {$invoices_string}";
|
||||
|
||||
$invoices_string = str_pad($descriptor, 5, ctrans('texts.invoice'), STR_PAD_RIGHT);
|
||||
|
||||
// $invoices_string = str_pad($invoices_string, 5, ctrans('texts.invoice'), STR_PAD_LEFT);
|
||||
|
||||
return $invoices_string;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user