Skip to content

Instantly share code, notes, and snippets.

@ederrafo
Created June 22, 2023 02:01
Show Gist options
  • Save ederrafo/a82d562837b53215b26388d96cdbe835 to your computer and use it in GitHub Desktop.
Save ederrafo/a82d562837b53215b26388d96cdbe835 to your computer and use it in GitHub Desktop.
function getInvoices(Request $request)
  {
      $customerType = $request->customerType;
      $request->merge(['invoiceDateFrom' => \App\Util\DateUtil::format($request->invoiceDateFrom, 'Y-m-d')]);
      $request->merge(['invoiceDateTo'   => \App\Util\DateUtil::format($request->invoiceDateTo, 'Y-m-d')]);
      $request->merge(['accountId'       => $request->accountId]);
      if ($customerType == CustomerTypeConstants::CORPORATE) {
          $response = $this->corporateService->getDetailInvoices($request);
      }
      return $response;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment