@@ -43,12 +43,12 @@ |
||
| 43 | 43 | public function registerMediaConversions() |
| 44 | 44 | { |
| 45 | 45 | $this->addMediaConversion('thumb') |
| 46 | - ->setManipulations(['w' => 50, 'h' => 50, 'q' => 100, 'fit' => 'crop']) |
|
| 47 | - ->performOnCollections('staff'); |
|
| 46 | + ->setManipulations(['w' => 50, 'h' => 50, 'q' => 100, 'fit' => 'crop']) |
|
| 47 | + ->performOnCollections('staff'); |
|
| 48 | 48 | |
| 49 | 49 | $this->addMediaConversion('form') |
| 50 | - ->setManipulations(['w' => 70, 'h' => 70, 'q' => 100, 'fit' => 'crop']) |
|
| 51 | - ->performOnCollections('staff'); |
|
| 50 | + ->setManipulations(['w' => 70, 'h' => 70, 'q' => 100, 'fit' => 'crop']) |
|
| 51 | + ->performOnCollections('staff'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | public function scopeExcludeArchive($query) |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | 'discount_note', |
| 24 | 24 | 'created_by', |
| 25 | 25 | 'updated_by', |
| 26 | - ]; |
|
| 26 | + ]; |
|
| 27 | 27 | |
| 28 | 28 | protected $dates = ['created_at', 'updated_at']; |
| 29 | 29 | |
@@ -47,12 +47,12 @@ |
||
| 47 | 47 | public function registerMediaConversions() |
| 48 | 48 | { |
| 49 | 49 | $this->addMediaConversion('thumb') |
| 50 | - ->setManipulations(['w' => 50, 'h' => 50, 'q' => 100, 'fit' => 'crop']) |
|
| 51 | - ->performOnCollections('profile'); |
|
| 50 | + ->setManipulations(['w' => 50, 'h' => 50, 'q' => 100, 'fit' => 'crop']) |
|
| 51 | + ->performOnCollections('profile'); |
|
| 52 | 52 | |
| 53 | 53 | $this->addMediaConversion('form') |
| 54 | - ->setManipulations(['w' => 70, 'h' => 70, 'q' => 100, 'fit' => 'crop']) |
|
| 55 | - ->performOnCollections('profile', 'proof'); |
|
| 54 | + ->setManipulations(['w' => 70, 'h' => 70, 'q' => 100, 'fit' => 'crop']) |
|
| 55 | + ->performOnCollections('profile', 'proof'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | //Relationships |
@@ -36,39 +36,39 @@ |
||
| 36 | 36 | protected function schedule(Schedule $schedule) |
| 37 | 37 | { |
| 38 | 38 | $schedule->command('reshoot:offlineSms') |
| 39 | - ->hourly(); |
|
| 39 | + ->hourly(); |
|
| 40 | 40 | |
| 41 | 41 | $schedule->command('birthday:sms') |
| 42 | - ->dailyAt('00:01'); |
|
| 42 | + ->dailyAt('00:01'); |
|
| 43 | 43 | |
| 44 | 44 | $schedule->command('set:expired') |
| 45 | - ->dailyAt('00:05'); |
|
| 45 | + ->dailyAt('00:05'); |
|
| 46 | 46 | |
| 47 | 47 | $schedule->command('sms:event') |
| 48 | - ->dailyAt('09:00'); |
|
| 48 | + ->dailyAt('09:00'); |
|
| 49 | 49 | |
| 50 | 50 | $schedule->command('sms:expiring') |
| 51 | - ->dailyAt('10:00'); |
|
| 51 | + ->dailyAt('10:00'); |
|
| 52 | 52 | |
| 53 | 53 | $schedule->command('expense:alert') |
| 54 | - ->dailyAt('10:30') |
|
| 55 | - ->when(function () { |
|
| 56 | - return \Utilities::getSetting('primary_contact') != null; |
|
| 57 | - }); |
|
| 54 | + ->dailyAt('10:30') |
|
| 55 | + ->when(function () { |
|
| 56 | + return \Utilities::getSetting('primary_contact') != null; |
|
| 57 | + }); |
|
| 58 | 58 | |
| 59 | 59 | $schedule->command('pending:invoice') |
| 60 | - ->dailyAt('11:00'); |
|
| 60 | + ->dailyAt('11:00'); |
|
| 61 | 61 | |
| 62 | 62 | $schedule->command('followup:sms') |
| 63 | - ->dailyAt('11:30'); |
|
| 63 | + ->dailyAt('11:30'); |
|
| 64 | 64 | |
| 65 | 65 | $schedule->command('sms:expired') |
| 66 | - ->dailyAt('11:45'); |
|
| 66 | + ->dailyAt('11:45'); |
|
| 67 | 67 | |
| 68 | 68 | $schedule->command('repeat:expense') |
| 69 | - ->dailyAt('23:00'); |
|
| 69 | + ->dailyAt('23:00'); |
|
| 70 | 70 | |
| 71 | 71 | $schedule->command('sms:status') |
| 72 | - ->dailyAt('23:45'); |
|
| 72 | + ->dailyAt('23:45'); |
|
| 73 | 73 | } |
| 74 | 74 | } |
@@ -44,53 +44,53 @@ |
||
| 44 | 44 | foreach ($expenses as $expense) { |
| 45 | 45 | if ($expense->repeat == 1) { |
| 46 | 46 | $expenseData = ['name' => $expense->name, |
| 47 | - 'category_id' => $expense->category_id, |
|
| 48 | - 'due_date' => $expense->due_date->addDays(1), |
|
| 49 | - 'repeat' => $expense->repeat, |
|
| 50 | - 'note' => $expense->note, |
|
| 51 | - 'amount' => $expense->amount, |
|
| 52 | - 'paid' => 0, |
|
| 53 | - 'created_by' => 1, |
|
| 54 | - 'updated_by' => 1, ]; |
|
| 47 | + 'category_id' => $expense->category_id, |
|
| 48 | + 'due_date' => $expense->due_date->addDays(1), |
|
| 49 | + 'repeat' => $expense->repeat, |
|
| 50 | + 'note' => $expense->note, |
|
| 51 | + 'amount' => $expense->amount, |
|
| 52 | + 'paid' => 0, |
|
| 53 | + 'created_by' => 1, |
|
| 54 | + 'updated_by' => 1, ]; |
|
| 55 | 55 | |
| 56 | 56 | $newExpense = new Expense($expenseData); |
| 57 | 57 | $newExpense->save(); |
| 58 | 58 | } elseif ($expense->repeat == 2) { |
| 59 | 59 | $expenseData = ['name' => $expense->name, |
| 60 | - 'category_id' => $expense->category_id, |
|
| 61 | - 'due_date' => $expense->due_date->addWeek(), |
|
| 62 | - 'repeat' => $expense->repeat, |
|
| 63 | - 'note' => $expense->note, |
|
| 64 | - 'amount' => $expense->amount, |
|
| 65 | - 'paid' => 0, |
|
| 66 | - 'created_by' => 1, |
|
| 67 | - 'updated_by' => 1, ]; |
|
| 60 | + 'category_id' => $expense->category_id, |
|
| 61 | + 'due_date' => $expense->due_date->addWeek(), |
|
| 62 | + 'repeat' => $expense->repeat, |
|
| 63 | + 'note' => $expense->note, |
|
| 64 | + 'amount' => $expense->amount, |
|
| 65 | + 'paid' => 0, |
|
| 66 | + 'created_by' => 1, |
|
| 67 | + 'updated_by' => 1, ]; |
|
| 68 | 68 | |
| 69 | 69 | $newExpense = new Expense($expenseData); |
| 70 | 70 | $newExpense->save(); |
| 71 | 71 | } elseif ($expense->repeat == 3) { |
| 72 | 72 | $expenseData = ['name' => $expense->name, |
| 73 | - 'category_id' => $expense->category_id, |
|
| 74 | - 'due_date' => $expense->due_date->addMonth(), |
|
| 75 | - 'repeat' => $expense->repeat, |
|
| 76 | - 'note' => $expense->note, |
|
| 77 | - 'amount' => $expense->amount, |
|
| 78 | - 'paid' => 0, |
|
| 79 | - 'created_by' => 1, |
|
| 80 | - 'updated_by' => 1, ]; |
|
| 73 | + 'category_id' => $expense->category_id, |
|
| 74 | + 'due_date' => $expense->due_date->addMonth(), |
|
| 75 | + 'repeat' => $expense->repeat, |
|
| 76 | + 'note' => $expense->note, |
|
| 77 | + 'amount' => $expense->amount, |
|
| 78 | + 'paid' => 0, |
|
| 79 | + 'created_by' => 1, |
|
| 80 | + 'updated_by' => 1, ]; |
|
| 81 | 81 | |
| 82 | 82 | $newExpense = new Expense($expenseData); |
| 83 | 83 | $newExpense->save(); |
| 84 | 84 | } elseif ($expense->repeat == 4) { |
| 85 | 85 | $expenseData = ['name' => $expense->name, |
| 86 | - 'category_id' => $expense->category_id, |
|
| 87 | - 'due_date' => $expense->due_date->addYear(), |
|
| 88 | - 'repeat' => $expense->repeat, |
|
| 89 | - 'note' => $expense->note, |
|
| 90 | - 'amount' => $expense->amount, |
|
| 91 | - 'paid' => 0, |
|
| 92 | - 'created_by' => 1, |
|
| 93 | - 'updated_by' => 1, ]; |
|
| 86 | + 'category_id' => $expense->category_id, |
|
| 87 | + 'due_date' => $expense->due_date->addYear(), |
|
| 88 | + 'repeat' => $expense->repeat, |
|
| 89 | + 'note' => $expense->note, |
|
| 90 | + 'amount' => $expense->amount, |
|
| 91 | + 'paid' => 0, |
|
| 92 | + 'created_by' => 1, |
|
| 93 | + 'updated_by' => 1, ]; |
|
| 94 | 94 | |
| 95 | 95 | $newExpense = new Expense($expenseData); |
| 96 | 96 | $newExpense->save(); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | 'invoice_id', |
| 17 | 17 | 'created_by', |
| 18 | 18 | 'updated_by', |
| 19 | - ]; |
|
| 19 | + ]; |
|
| 20 | 20 | |
| 21 | 21 | //Eloquence Search mapping |
| 22 | 22 | use Eloquence; |
@@ -34,16 +34,16 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | if ($drp_start == null or $drp_end == null) { |
| 36 | 36 | return $query->leftJoin('trn_invoice', 'trn_payment_details.invoice_id', '=', 'trn_invoice.id') |
| 37 | - ->leftJoin('mst_members', 'trn_invoice.member_id', '=', 'mst_members.id') |
|
| 38 | - ->select('trn_payment_details.id', 'trn_payment_details.created_at', 'trn_payment_details.payment_amount', 'trn_payment_details.mode', 'trn_payment_details.invoice_id', 'trn_invoice.invoice_number', 'mst_members.id as member_id', 'mst_members.name as member_name', 'mst_members.member_code') |
|
| 39 | - ->orderBy($sorting_field, $sorting_direction); |
|
| 37 | + ->leftJoin('mst_members', 'trn_invoice.member_id', '=', 'mst_members.id') |
|
| 38 | + ->select('trn_payment_details.id', 'trn_payment_details.created_at', 'trn_payment_details.payment_amount', 'trn_payment_details.mode', 'trn_payment_details.invoice_id', 'trn_invoice.invoice_number', 'mst_members.id as member_id', 'mst_members.name as member_name', 'mst_members.member_code') |
|
| 39 | + ->orderBy($sorting_field, $sorting_direction); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return $query->leftJoin('trn_invoice', 'trn_payment_details.invoice_id', '=', 'trn_invoice.id') |
| 43 | - ->leftJoin('mst_members', 'trn_invoice.member_id', '=', 'mst_members.id') |
|
| 44 | - ->select('trn_payment_details.id', 'trn_payment_details.created_at', 'trn_payment_details.payment_amount', 'trn_payment_details.mode', 'trn_invoice.invoice_number', 'mst_members.name as member_name', 'mst_members.member_code') |
|
| 45 | - ->whereBetween('trn_payment_details.created_at', [$drp_start, $drp_end]) |
|
| 46 | - ->orderBy($sorting_field, $sorting_direction); |
|
| 43 | + ->leftJoin('mst_members', 'trn_invoice.member_id', '=', 'mst_members.id') |
|
| 44 | + ->select('trn_payment_details.id', 'trn_payment_details.created_at', 'trn_payment_details.payment_amount', 'trn_payment_details.mode', 'trn_invoice.invoice_number', 'mst_members.name as member_name', 'mst_members.member_code') |
|
| 45 | + ->whereBetween('trn_payment_details.created_at', [$drp_start, $drp_end]) |
|
| 46 | + ->orderBy($sorting_field, $sorting_direction); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function createdBy() |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | if ($request->mode == \constPaymentMode::Cheque) { |
| 53 | 53 | // Store Cheque Details |
| 54 | 54 | $chequeData = ['payment_id'=> $payment_detail->id, |
| 55 | - 'number'=> $request->number, |
|
| 56 | - 'date'=> $request->date, |
|
| 57 | - 'status'=> \constChequeStatus::Recieved, ]; |
|
| 55 | + 'number'=> $request->number, |
|
| 56 | + 'date'=> $request->date, |
|
| 57 | + 'status'=> \constChequeStatus::Recieved, ]; |
|
| 58 | 58 | |
| 59 | 59 | $cheque_details = new Cheque_detail($chequeData); |
| 60 | 60 | $cheque_details->createdBy()->associate(Auth::user()); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | // Store Cheque Details |
| 135 | 135 | $cheque_detail = Cheque_detail::where('payment_id', $id)->first(); |
| 136 | 136 | $cheque_detail->update(['number' => $request->number, |
| 137 | - 'date' => $request->date, |
|
| 137 | + 'date' => $request->date, |
|
| 138 | 138 | ]); |
| 139 | 139 | $cheque_detail->updatedBy()->associate(Auth::user()); |
| 140 | 140 | $cheque_detail->save(); |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | $invoice_total = $invoice->total; |
| 181 | 181 | $payment_total = Payment_detail::leftJoin('trn_cheque_details', 'trn_payment_details.id', '=', 'trn_cheque_details.payment_id') |
| 182 | - ->whereRaw("trn_payment_details.invoice_id = $invoice->id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)") |
|
| 183 | - ->sum('trn_payment_details.payment_amount'); |
|
| 182 | + ->whereRaw("trn_payment_details.invoice_id = $invoice->id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)") |
|
| 183 | + ->sum('trn_payment_details.payment_amount'); |
|
| 184 | 184 | |
| 185 | 185 | $amount_due = $invoice_total - $payment_total; |
| 186 | 186 | |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | $invoice_total = $payment_detail->invoice->total; |
| 225 | 225 | |
| 226 | 226 | $payment_total = Payment_detail::leftJoin('trn_cheque_details', 'trn_payment_details.id', '=', 'trn_cheque_details.payment_id') |
| 227 | - ->whereRaw("trn_payment_details.invoice_id = $payment_detail->invoice_id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)") |
|
| 228 | - ->sum('trn_payment_details.payment_amount'); |
|
| 227 | + ->whereRaw("trn_payment_details.invoice_id = $payment_detail->invoice_id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)") |
|
| 228 | + ->sum('trn_payment_details.payment_amount'); |
|
| 229 | 229 | |
| 230 | 230 | $amount_due = $invoice_total - $payment_total; |
| 231 | 231 | |
@@ -167,23 +167,23 @@ |
||
| 167 | 167 | try { |
| 168 | 168 | $invoice_total = $request->admission_amount + $request->subscription_amount + $request->taxes_amount - $request->discount_amount; |
| 169 | 169 | $already_paid = Payment_detail::leftJoin('trn_cheque_details', 'trn_payment_details.id', '=', 'trn_cheque_details.payment_id') |
| 170 | - ->whereRaw("trn_payment_details.invoice_id = $id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)") |
|
| 171 | - ->sum('trn_payment_details.payment_amount'); |
|
| 170 | + ->whereRaw("trn_payment_details.invoice_id = $id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)") |
|
| 171 | + ->sum('trn_payment_details.payment_amount'); |
|
| 172 | 172 | |
| 173 | 173 | $pending = $invoice_total - $already_paid; |
| 174 | 174 | |
| 175 | 175 | $status = \Utilities::setInvoiceStatus($pending, $invoice_total); |
| 176 | 176 | |
| 177 | 177 | Invoice::where('id', $id)->update(['invoice_number'=> $request->invoice_number, |
| 178 | - 'total'=> $invoice_total, |
|
| 179 | - 'status'=> $status, |
|
| 180 | - 'pending_amount'=> $pending, |
|
| 181 | - 'discount_amount'=> $request->discount_amount, |
|
| 182 | - 'discount_percent'=> $request->discount_percent, |
|
| 183 | - 'discount_note'=> $request->discount_note, |
|
| 184 | - 'tax'=> $request->taxes_amount, |
|
| 185 | - 'additional_fees'=> $request->additional_fees, |
|
| 186 | - 'note'=>' ', ]); |
|
| 178 | + 'total'=> $invoice_total, |
|
| 179 | + 'status'=> $status, |
|
| 180 | + 'pending_amount'=> $pending, |
|
| 181 | + 'discount_amount'=> $request->discount_amount, |
|
| 182 | + 'discount_percent'=> $request->discount_percent, |
|
| 183 | + 'discount_note'=> $request->discount_note, |
|
| 184 | + 'tax'=> $request->taxes_amount, |
|
| 185 | + 'additional_fees'=> $request->additional_fees, |
|
| 186 | + 'note'=>' ', ]); |
|
| 187 | 187 | |
| 188 | 188 | DB::commit(); |
| 189 | 189 | flash()->success('Discount was successfully updated'); |
@@ -153,18 +153,18 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | $invoice = Invoice::create(['invoice_number'=> $invoice_number, |
| 156 | - 'member_id'=> $member->id, |
|
| 157 | - 'total'=> $invoice_total, |
|
| 158 | - 'status'=> $paymentStatus, |
|
| 159 | - 'pending_amount'=> $pending, |
|
| 160 | - 'discount_amount'=> $discount, |
|
| 161 | - 'discount_percent'=> $discountPercent, |
|
| 162 | - 'discount_note'=> null, |
|
| 163 | - 'tax'=> ($tax_percent / 100) * $invoice_total, |
|
| 164 | - 'additional_fees'=> '0', |
|
| 165 | - 'note'=> null, |
|
| 166 | - 'created_by'=> Auth::user()->id, |
|
| 167 | - 'updated_by'=> Auth::user()->id, |
|
| 156 | + 'member_id'=> $member->id, |
|
| 157 | + 'total'=> $invoice_total, |
|
| 158 | + 'status'=> $paymentStatus, |
|
| 159 | + 'pending_amount'=> $pending, |
|
| 160 | + 'discount_amount'=> $discount, |
|
| 161 | + 'discount_percent'=> $discountPercent, |
|
| 162 | + 'discount_note'=> null, |
|
| 163 | + 'tax'=> ($tax_percent / 100) * $invoice_total, |
|
| 164 | + 'additional_fees'=> '0', |
|
| 165 | + 'note'=> null, |
|
| 166 | + 'created_by'=> Auth::user()->id, |
|
| 167 | + 'updated_by'=> Auth::user()->id, |
|
| 168 | 168 | ]); |
| 169 | 169 | |
| 170 | 170 | $start_date = Carbon::createFromFormat('d/m/Y', $line->get('start_date')); |
@@ -198,19 +198,19 @@ discard block |
||
| 198 | 198 | ]); |
| 199 | 199 | |
| 200 | 200 | $invoiceDetail = Invoice_detail::create(['invoice_id'=> $invoice->id, |
| 201 | - 'plan_id'=> (int) $planId, |
|
| 202 | - 'item_amount'=> $line->get('total_amount'), |
|
| 203 | - 'item_amount'=> $line->get('total_amount'), |
|
| 204 | - 'created_by'=> Auth::user()->id, |
|
| 205 | - 'updated_by'=> Auth::user()->id, |
|
| 201 | + 'plan_id'=> (int) $planId, |
|
| 202 | + 'item_amount'=> $line->get('total_amount'), |
|
| 203 | + 'item_amount'=> $line->get('total_amount'), |
|
| 204 | + 'created_by'=> Auth::user()->id, |
|
| 205 | + 'updated_by'=> Auth::user()->id, |
|
| 206 | 206 | ]); |
| 207 | 207 | |
| 208 | 208 | $paymentDetail = Payment_detail::create(['invoice_id'=> $invoice->id, |
| 209 | - 'payment_amount'=> $payment_amount, |
|
| 210 | - 'mode'=> '1', |
|
| 211 | - 'note'=> ' ', |
|
| 212 | - 'created_by'=> Auth::user()->id, |
|
| 213 | - 'updated_by'=> Auth::user()->id, |
|
| 209 | + 'payment_amount'=> $payment_amount, |
|
| 210 | + 'mode'=> '1', |
|
| 211 | + 'note'=> ' ', |
|
| 212 | + 'created_by'=> Auth::user()->id, |
|
| 213 | + 'updated_by'=> Auth::user()->id, |
|
| 214 | 214 | ]); |
| 215 | 215 | |
| 216 | 216 | Setting::where('key', '=', 'invoice_last_number')->update(['value' => $invoiceCounter]); |