Updates for einvoicing via self host
This commit is contained in:
parent
aeaca12e65
commit
03610cfcba
|
|
@ -24,4 +24,9 @@ class EInvoicingToken extends Model
|
|||
'token',
|
||||
'account_key',
|
||||
];
|
||||
|
||||
public function license()
|
||||
{
|
||||
$this->belongsTo(License::class, 'license_key', 'license_key');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @property int|null $product_id
|
||||
* @property int|null $recurring_invoice_id
|
||||
* @property int|null $e_invoice_quota
|
||||
* @property bool $is_flagged
|
||||
* @property-read \App\Models\RecurringInvoice $recurring_invoice
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel company()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns)
|
||||
|
|
@ -73,6 +74,10 @@ class License extends StaticModel
|
|||
public function url()
|
||||
{
|
||||
$contact = $this->recurring_invoice->client->contacts()->where('email', $this->email)->first();
|
||||
}
|
||||
|
||||
public function e_invoicing_tokens()
|
||||
{
|
||||
return $this->hasMany(EInvoicingToken::class, 'license_key', 'license_key');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@ class SendEDocument implements ShouldQueue
|
|||
|
||||
$model = $this->entity::find($this->id);
|
||||
|
||||
if($model->company->account->is_flagged){
|
||||
nlog("Bad Actor");
|
||||
return; //Bad Actor present.
|
||||
}
|
||||
|
||||
/** Concrete implementation current linked to Storecove only */
|
||||
$p = new Peppol($model);
|
||||
$p->run();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('licenses', function (Blueprint $table){
|
||||
$table->boolean('is_flagged')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue