mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Enforce character lengths for authorize fields
This commit is contained in:
parent
e452c04214
commit
87f5c73787
@ -140,7 +140,7 @@ class CompanyImport implements ShouldQueue
|
||||
'expenses',
|
||||
'tasks',
|
||||
'payments',
|
||||
'activities',
|
||||
// 'activities',
|
||||
// 'backups',
|
||||
'company_ledger',
|
||||
'designs',
|
||||
|
@ -190,7 +190,7 @@ class BaseModel extends Model
|
||||
|
||||
public function numberFormatter()
|
||||
{
|
||||
$number = strlen($this->number) >= 1 ? $this->number : class_basename($this) . "_" . Str::random(5); ;
|
||||
$number = strlen($this->number) >= 1 ? $this->number : class_basename($this) . "_" . Str::random(5);
|
||||
|
||||
$formatted_number = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $number);
|
||||
// Remove any runs of periods (thanks falstro!)
|
||||
|
@ -164,13 +164,13 @@ class AuthorizePaymentMethod
|
||||
if ($contact) {
|
||||
// Create the Bill To info for new payment type
|
||||
$billto = new CustomerAddressType();
|
||||
$billto->setFirstName($contact->present()->first_name());
|
||||
$billto->setLastName($contact->present()->last_name());
|
||||
$billto->setCompany($this->authorize->client->present()->name());
|
||||
$billto->setAddress($this->authorize->client->address1);
|
||||
$billto->setCity($this->authorize->client->city);
|
||||
$billto->setState($this->authorize->client->state);
|
||||
$billto->setZip($this->authorize->client->postal_code);
|
||||
$billto->setFirstName(substr(0,50,$contact->present()->first_name()));
|
||||
$billto->setLastName(substr(0,50,$contact->present()->last_name()));
|
||||
$billto->setCompany(substr(0,50,$this->authorize->client->present()->name()));
|
||||
$billto->setAddress(substr(0,60,$this->authorize->client->address1));
|
||||
$billto->setCity(substr(0,40,$this->authorize->client->city));
|
||||
$billto->setState(substr(0,40,$this->authorize->client->state));
|
||||
$billto->setZip(substr(0,20,$this->authorize->client->postal_code));
|
||||
|
||||
if ($this->authorize->client->country_id) {
|
||||
$billto->setCountry($this->authorize->client->country->name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user