Fix adding the product_id to account based charges (when services are not active)
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 38s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
2024-09-16 11:36:55 +10:00
parent 7ec28218fa
commit a65c81871b
3 changed files with 4 additions and 4 deletions

View File

@@ -70,13 +70,13 @@ class InvoiceAdd extends Command
sprintf('%s.%s.%s.%s',
$item->item_type_name,
$item->price_base,
$item->product->provider_ref($to->provider),
$item->product?->provider_ref($to->provider),
$item->taxes->pluck('description')->join('|'))) as $os)
{
$key = $os->first();
// Some validation
if (! ($ref=$key->product->provider_ref($to->provider))) {
if (! ($ref=$key->product?->provider_ref($to->provider))) {
$this->error(sprintf('Accounting not defined in product [%d]',$key->product_id));
return self::FAILURE;