Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
cursbackend
/
app
/
Console
/
Commands
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
CreateInvoiceCommand.php
| Size :
1.83
KB
Copy
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use App\Models\Invoice; use App\Models\User; use App\Models\Instance; use Carbon\Carbon; use Illuminate\Support\Facades\Mail; use App\Repositories\InvoiceRepository; use Str; class CreateInvoiceCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'command:create-invoice-and-enroll-to-learn'; /** * The console command description. * * @var string */ protected $description = 'Send invoice to clients'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $proforme = [ 1613, 1609, 1588, 1570, 1561, 1543, 1521, 1489, 1458, 1446, 1443, 1400, 1384, 1376, 1372, 1354, 1349, 1330, 1321, 1319, 1315, 1307 ]; // sa ii dau id-ul proformei foreach($proforme as $proforma_id) { $proforma_db = Invoice::where('id',$proforma_id)->first(); $instance = $proforma_db->instance; if($instance){ // se genereaza factura $invoice = InvoiceRepository::generateInvoice( $instance->id, $proforma_db->amount, 'paid', 'stripe_payment_id', 'RON', $proforma_db->email ); $instance->update([ 'status' => Instance::STATUS_ACTIVE, 'first_payment' => 0, ]); }else{ var_dump("Nu am gasit instanta pentru proforma:".$proforma_id); } // add user with tag in active campaign // createCronjobActiveCampaign($user, 'tbf_curs'); } } }
Back