mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 00:54:33 -04:00
Allow custom client numbering for projects
This commit is contained in:
parent
4091538161
commit
f3d91c4414
@ -1105,7 +1105,7 @@ class Import implements ShouldQueue
|
|||||||
throw new MigrationValidatorFailed(json_encode($validator->errors()));
|
throw new MigrationValidatorFailed(json_encode($validator->errors()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$quote_repository = new QuoteRepository();
|
$quote_repository = new InvoiceMigrationRepository();
|
||||||
|
|
||||||
foreach ($data as $resource) {
|
foreach ($data as $resource) {
|
||||||
$modified = $resource;
|
$modified = $resource;
|
||||||
@ -1144,7 +1144,7 @@ class Import implements ShouldQueue
|
|||||||
$resource['invitations'][$key]['user_id'] = $modified['user_id'];
|
$resource['invitations'][$key]['user_id'] = $modified['user_id'];
|
||||||
$resource['invitations'][$key]['company_id'] = $this->company->id;
|
$resource['invitations'][$key]['company_id'] = $this->company->id;
|
||||||
$resource['invitations'][$key]['email_status'] = '';
|
$resource['invitations'][$key]['email_status'] = '';
|
||||||
unset($resource['invitations'][$key]['invoice_id']);
|
unset($resource['invitations'][$key]['quote_id']);
|
||||||
unset($resource['invitations'][$key]['id']);
|
unset($resource['invitations'][$key]['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@ class ACH implements MethodInterface
|
|||||||
$data['gateway'] = $this->go_cardless;
|
$data['gateway'] = $this->go_cardless;
|
||||||
$data['amount'] = $this->go_cardless->convertToGoCardlessAmount($data['total']['amount_with_fee'], $this->go_cardless->client->currency()->precision);
|
$data['amount'] = $this->go_cardless->convertToGoCardlessAmount($data['total']['amount_with_fee'], $this->go_cardless->client->currency()->precision);
|
||||||
$data['currency'] = $this->go_cardless->client->getCurrencyCode();
|
$data['currency'] = $this->go_cardless->client->getCurrencyCode();
|
||||||
|
$data['description'] = ctrans('texts.invoices') . ': ' . collect($data['invoices'])->pluck('invoice_number');
|
||||||
|
|
||||||
return render('gateways.gocardless.ach.pay', $data);
|
return render('gateways.gocardless.ach.pay', $data);
|
||||||
}
|
}
|
||||||
|
@ -295,19 +295,26 @@ trait GeneratesCounter
|
|||||||
*/
|
*/
|
||||||
public function getNextProjectNumber(Project $project) :string
|
public function getNextProjectNumber(Project $project) :string
|
||||||
{
|
{
|
||||||
$this->resetCompanyCounters($project->company);
|
// 08/12/2021 - allows projects to have client counters.
|
||||||
|
|
||||||
|
// $this->resetCompanyCounters($project->company);
|
||||||
|
|
||||||
$counter = $project->company->settings->project_number_counter;
|
// $counter = $project->company->settings->project_number_counter;
|
||||||
$setting_entity = $project->company->settings->project_number_counter;
|
// $setting_entity = $project->company->settings->project_number_counter;
|
||||||
|
|
||||||
$project_number = $this->checkEntityNumber(Project::class, $project, $counter, $project->company->settings->counter_padding, $project->company->settings->project_number_pattern);
|
// $project_number = $this->checkEntityNumber(Project::class, $project, $counter, $project->company->settings->counter_padding, $project->company->settings->project_number_pattern);
|
||||||
|
|
||||||
$this->incrementCounter($project->company, 'project_number_counter');
|
// $this->incrementCounter($project->company, 'project_number_counter');
|
||||||
|
|
||||||
$entity_number = $project_number;
|
// $entity_number = $project_number;
|
||||||
|
|
||||||
|
// return $this->replaceUserVars($project, $entity_number);
|
||||||
|
|
||||||
|
$entity_number = $this->getNextEntityNumber(Project::class, $project->client, false);
|
||||||
|
|
||||||
return $this->replaceUserVars($project, $entity_number);
|
return $this->replaceUserVars($project, $entity_number);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user