This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Modules\Commission\Services; | |
| use Carbon\Carbon; | |
| use Illuminate\Support\Facades\File; | |
| use Modules\Commission\Repositories\Concerns\CanPayoutCommission; | |
| use Modules\Credit\Models\BankAccount; | |
| use Modules\User\Models\User; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Modules\Commission\Services; | |
| use Carbon\Carbon; | |
| use Illuminate\Support\Facades\DB; | |
| use Illuminate\Support\Facades\File; | |
| use Modules\Commission\Models\Goldmine2CommissionBypass; | |
| use Modules\Commission\Models\Goldmine2CommissionBypassLevels; | |
| use Modules\Credit\Models\BankAccount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Modules\Commission\Services; | |
| use Carbon\Carbon; | |
| use Illuminate\Support\Facades\DB; | |
| use Illuminate\Support\Facades\File; | |
| use Modules\Commission\Models\Goldmine2CommissionBypass; | |
| use Modules\Commission\Models\Goldmine2CommissionBypassLevels; | |
| use Modules\Credit\Models\BankAccount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $product_tracking_query = (new ProductTracking)->newQuery(); | |
| $product_tracking_query->select('product_id', 'subscriber_id', DB::raw('count(*) as total')); | |
| $product_tracking_query->with('product'); | |
| $product_tracking_query->whereBetween('product_tracking.created_at', $daterange); | |
| $product_tracking_query->orderBy('total', 'DESC'); | |
| $product_tracking_query->groupBy('product_id'); | |
| $product_tracking_collection = $product_tracking_query->paginate(($request->input('per_page') !== null) ? $request->input('per_page') : 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO edisonlamps.bulk_units (item_id, name, qty,uom_id, active, type, created_by, unit_code) | |
| SELECT id, "roll", 5, 2, "Active", "base", 1, "roll" | |
| FROM edisonlamps.items | |
| WHERE inventory_types_id = 2 and uom_id = 4 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| '' as code, | |
| '' as sku, | |
| a.status, a.generic, a.brand, a.make, a.model, a.color, a.size_dim, a.gauge_thick, a.description, | |
| CASE | |
| WHEN a.type = "Serialized" then 3 | |
| WHEN a.type = "Inventoriable" then 2 | |
| END as inventory_types_id, | |
| CASE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| contract_id, | |
| date, | |
| due_date, | |
| SUM(rental) as rental, | |
| SUM(advance_rental) as advance_rental, | |
| SUM(security_deposit) as security_deposit, | |
| SUM(surcharge) as surcharge, | |
| SUM(others) as others, | |
| unit_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| t1b.id as contract_id, | |
| t1a.unit_id, | |
| t1a.asset_id, | |
| t1b.date, | |
| t1b.due_date, | |
| (t1a.total + + t1b.rental_open) as rental, | |
| SUM(t1b.advance_rental) as advance_rental, | |
| SUM(t1b.security_deposit) as security_deposit, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| t1b.id as contract_id, | |
| t1a.unit_id, | |
| t1a.asset_id, | |
| t1b.date, | |
| t1b.due_date, | |
| SUM(t1b.rental) as rental, | |
| SUM(t1b.advance_rental) as advance_rental, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set @sql = null; | |
| SELECT | |
| GROUP_CONCAT(DISTINCT | |
| CONCAT( | |
| 'SUM(IF(name = ''',name,''',cb.amount,0)) AS ', replace(name, ' ', '_') | |
| ) | |
| ) INTO @sql | |
| from property_headancillaries; |
NewerOlder