diff --git a/app/Http/Controllers/Reports/ProfitAndLossController.php b/app/Http/Controllers/Reports/ProfitAndLossController.php index 3d1f0751066d..26e860f16bd5 100644 --- a/app/Http/Controllers/Reports/ProfitAndLossController.php +++ b/app/Http/Controllers/Reports/ProfitAndLossController.php @@ -63,14 +63,17 @@ class ProfitAndLossController extends BaseController */ public function __invoke(ProfitLossRequest $request) { + /** @var \App\Models\User $user */ + $user = auth()->user(); + if ($request->has('send_email') && $request->get('send_email')) { - SendToAdmin::dispatch(auth()->user()->company(), $request->all(), ProfitLoss::class, $this->filename); + SendToAdmin::dispatch($user->company(), $request->all(), ProfitLoss::class, $this->filename); return response()->json(['message' => 'working...'], 200); } // expect a list of visible fields, or use the default - $pnl = new ProfitLoss(auth()->user()->company(), $request->all()); + $pnl = new ProfitLoss($user->company(), $request->all()); $csv = $pnl->run(); $headers = [ diff --git a/app/Import/Definitions/VendorMap.php b/app/Import/Definitions/VendorMap.php index 4e5cbd37524d..1c23f5e34049 100644 --- a/app/Import/Definitions/VendorMap.php +++ b/app/Import/Definitions/VendorMap.php @@ -33,14 +33,18 @@ class VendorMap 14 => 'vendor.state', 15 => 'vendor.postal_code', 16 => 'vendor.country_id', - 17 => 'contact.first_name', - 18 => 'contact.last_name', - 19 => 'contact.email', - 20 => 'contact.phone', - 21 => 'contact.custom_value1', - 22 => 'contact.custom_value2', - 23 => 'contact.custom_value3', - 24 => 'contact.custom_value4', + 17 => 'vendor.custom_value1', + 18 => 'vendor.custom_value2', + 19 => 'vendor.custom_value3', + 20 => 'vendor.custom_value4', + 21 => 'contact.first_name', + 22 => 'contact.last_name', + 23 => 'contact.email', + 24 => 'contact.phone', + 25 => 'contact.custom_value1', + 26 => 'contact.custom_value2', + 27 => 'contact.custom_value3', + 28 => 'contact.custom_value4', ]; } @@ -65,14 +69,18 @@ class VendorMap 14 => 'texts.state', 15 => 'texts.postal_code', 16 => 'texts.country', - 17 => 'texts.first_name', - 18 => 'texts.last_name', - 19 => 'texts.email', - 20 => 'texts.phone', - 21 => 'texts.custom_value', - 22 => 'texts.custom_value', - 23 => 'texts.custom_value', - 24 => 'texts.custom_value', + 17 => 'texts.custom_value', + 18 => 'texts.custom_value', + 19 => 'texts.custom_value', + 20 => 'texts.custom_value', + 21 => 'texts.first_name', + 22 => 'texts.last_name', + 23 => 'texts.email', + 24 => 'texts.phone', + 25 => 'texts.custom_value', + 26 => 'texts.custom_value', + 27 => 'texts.custom_value', + 28 => 'texts.custom_value', ]; } } diff --git a/app/Services/Report/ProfitLoss.php b/app/Services/Report/ProfitLoss.php index cbdba56c51df..0f7e2ca97bf2 100644 --- a/app/Services/Report/ProfitLoss.php +++ b/app/Services/Report/ProfitLoss.php @@ -107,7 +107,7 @@ class ProfitLoss if ($this->is_income_billed) { //get invoiced amounts $this->filterIncome(); } else { - //$this->filterPaymentIncome(); + $this->filterInvoicePaymentIncome(); }