mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for custom values
This commit is contained in:
parent
25459797db
commit
a2d954b706
@ -56,7 +56,7 @@ class CompanySizeCheck implements ShouldQueue
|
||||
{
|
||||
Company::cursor()->each(function ($company) {
|
||||
|
||||
if ($company->invoices()->count() > 1000 || $company->products()->count() > 1000 || $company->clients()->count() > 1000) {
|
||||
if ($company->invoices()->count() > 500 || $company->products()->count() > 500 || $company->clients()->count() > 500) {
|
||||
|
||||
nlog("Marking company {$company->id} as large");
|
||||
|
||||
|
@ -393,6 +393,10 @@ class Import implements ShouldQueue
|
||||
foreach ($data['settings'] as $key => $value) {
|
||||
if ($key == 'invoice_design_id' || $key == 'quote_design_id' || $key == 'credit_design_id') {
|
||||
$value = $this->encodePrimaryKey($value);
|
||||
|
||||
if(!$value)
|
||||
$value = $this->encodePrimaryKey(1);
|
||||
|
||||
}
|
||||
|
||||
if ($key == 'payment_terms' && $key = '') {
|
||||
|
@ -48,6 +48,25 @@ class CompanyRepository extends BaseRepository
|
||||
|
||||
private function parseCustomFields($fields) :array
|
||||
{
|
||||
|
||||
if(array_key_exists('account1', $fields))
|
||||
$fields['company1'] = $fields['account1'];
|
||||
|
||||
if(array_key_exists('company2', $fields))
|
||||
$fields['company2'] = $fields['account2'];
|
||||
|
||||
if(array_key_exists('invoice1', $fields))
|
||||
$fields['surcharge1'] = $fields['invoice1'];
|
||||
|
||||
if(array_key_exists('invoice2', $fields))
|
||||
$fields['surcharge2'] = $fields['invoice2'];
|
||||
|
||||
if(array_key_exists('invoice_text1', $fields))
|
||||
$fields['invoice1'] = $fields['invoice_text1'];
|
||||
|
||||
if(array_key_exists('invoice_text2', $fields))
|
||||
$fields['invoice2'] = $fields['invoice_text2'];
|
||||
|
||||
foreach ($fields as &$value) {
|
||||
$value = (string) $value;
|
||||
}
|
||||
|
@ -29,9 +29,7 @@ class GroupSettingRepository extends BaseRepository
|
||||
$group_setting->save();
|
||||
}
|
||||
|
||||
nlog($data['settings']);
|
||||
|
||||
if(count((array)$data['settings']) == 0){
|
||||
if(!array_key_exists('settings', $data) || count((array)$data['settings']) == 0){
|
||||
$settings = new \stdClass;
|
||||
$settings->entity = Client::class;
|
||||
$group_setting->settings = $settings;
|
||||
|
Loading…
x
Reference in New Issue
Block a user