Comic for May 21, 2020
https://ift.tt/2zgHVJJ
fun
via Dilbert Daily Strip http://dilbert.com
May 21, 2020 at 03:02AM
Just another WordPress site
Comic for May 21, 2020
https://ift.tt/2zgHVJJ
fun
via Dilbert Daily Strip http://dilbert.com
May 21, 2020 at 03:02AM
How Motorsport Tires Are Made
https://ift.tt/2WPSr3M
Everyday car tires are made mostly by machine, but the high-end tires used for racing are made by hand. In this clip from Street FX Motorsport TV, they take us inside Michelin Motorsport’s HQ in France for a look at the tire-making process, building up layer by layer of rubber, textiles, steel, and adhesive on spinning drums.
fun
via The Awesomer https://theawesomer.com
May 20, 2020 at 09:30AM
LA-based Brainbase raises another $8 million for IP-licensing management
https://ift.tt/2Zy5711
Brainbase, the rights management platform that’s helping Hollywood studios manage the licensing rights to their cultural icons, has picked up another $8 million in financing.
Behind every popular story is an attempt to make money off of it, and Brainbase helps Hollywood find new ways to make money off of consumer tastes.
The money came from new investors Bessemer Venture Partners and Nosara Capital, with participation from previous investors Alpha Edison, Struck Capital, Bonfire Ventures, and FJ Labs. Individual investors including Spencer Lazar, Michael Stoppelman, the former senior vice president of engineering at Yelp; Jenny Fleiss, co-founder of Rent The Runway, and David Fraga, president of InVision.
The Los Angeles-based company said the new money would be used to build a payments feature to speed up the process of wringing payments from licensees and to continue building its Marketplace product that connects celebrities, athletes and social media stars of all stripes with new and emerging brands.
“We need to stay focused on building the best platform for brands that own and license their IP,” said Brainbase co-founder and CEO Nate Cavanaugh, in a statement. “With a strong bench of investors and advisors who believe in our vision to make the intellectual property industry more open, efficient and accessible, we are prepared for our next stage of growth. In 2020, Brainbase plans to nearly double in size, making key hires across sales, product, and engineering in the U.S. and Europe.”
The new financing comes as Brainbase brings new brands and spokespeople into the fold including Buzzfeed, the model-turned-shopping network celebrity and brand ambassador extraordinaire Kathy Ireland, MDR Brand Management, and Bonnier. These new branding megaliths join a roster that includes Sanrio, the owner of the ubiquitous Hello Kitty character.
“Brainbase is bringing the archaic, paper shuffling world of IP management into the 21st century. We’re thrilled to partner with this team as they help owners of IP assets capture more value while saving a boatload of time and effort,” stated Kent Bennett, partner at Bessemer Venture Partners.
technology
via TechCrunch https://techcrunch.com
May 20, 2020 at 10:11AM
6 Enterprise Mobile Application Development Platforms in 2020
https://ift.tt/2yXNcWD
Which mobile application development platform should I opt for?
What are the prominent advantages of choosing that platform?
Will it be the best choice for my app?
I am sure that there are so many questions that arise in the mind when it comes to choosing an enterprise mobile app development platform. Given the plenty of available options, one is bound to feel baffled. But selecting the most appropriate platform holds utmost importance.
To help you out, we have whittled a list of the top six enterprise mobile application development platforms that are leading the charts in 2020. You can learn about these in detail to choose the best one for your app. Let’s begin.
Appcelerator makes use of a single JavaScript codebase to build strong native apps. It has an open and extensible environment that allows you to produce apps for Android, iOS, Blackberry, HTML5 and hybrid apps. Its open-source SDK supports over 5,000 devices.
PhoneGap is an amazing cross-platform framework, allowing app developers to build apps that operate smoothly on multiple mobile platforms. It has a powerful backend system that greatly accelerates the development process. It is best suited for developing simple mobile apps that do not extensively use the mobile’s native features.
The PhoneGap community comprises latest modules and codes that are available for free, owing to its Open Source License. It offers tremendous flexibility and app developers having a basic knowledge of JavaScript, HTML5, and CSS3 can get started with development, without the need of learning any additional languages.
Sencha is believed to be an ideal framework for developing data-rich cross-platform applications powered by hardware acceleration methods. It is a warehouse of 115+ high-performing integrated UI components, including charts, grids, calendar, etc.
HTML5 utilization can be easily unleashed on all modern browsers by this platform. Also, developers can use Sencha Ext JS for developing ground-breaking apps that leverage the potential of Business Intelligence for Analytics and data visualization.
Xamarin helps to develop native apps that work on multiple platforms by using a shared C# code base. The platform enables the developers to use the same IDE, APIs and language everywhere. Also, the Git integration can be directly launched into the Xamarin Studio. Owing to the unprecedented benefits of this platform, it has been adopted by some renowned names like Microsoft, IBM, Foursquare, etc.
Ionic is a 100% free and open-source framework that is best suited for cross-platform mobile app development. The framework helps to create native functionality in apps that can seamlessly operate on multiple devices and operating systems. With native functionalities, exhaustive gestures and highly customizable tools, Ionic apps can help to augment user experience.
This is an open-source platform that facilitates cross-platform app development with a rich, native-like user interface. With this platform, the developers can easily access native APIs through JavaScript to build highly interactive apps. Native mobile apps for iOS and Android can be created using a single codebase.
Final WordsThese are the top 6 enterprise mobile application development platforms that are ruling the charts in 2020. You can get in touch with a reliable mobile application development agency to discover the most suitable platform for your precise needs. Choosing the right platform will ensure that you get a technically-sound deliverable as well as save on the time and effort involved in the process.
via Noupe https://www.noupe.com
May 18, 2020 at 03:35AM
Multi-tenancy in Laravel
https://ift.tt/2WXbmZg
I recently started a deep dive into multi-tenancy in Laravel, specifically the database-per-tenant approach, and created a video on how to achieve multi-tenancy without any packages.
The video covers switching DB connections at runtime, writing migrations, seeding, and testing. You can watch it here:
After the video was posted, one of the concerns that people shared was related to preventing session data that belongs to one tenant from leaking to another.
Basically, a user in tenant A can modify the session cookie and log himself into a user on tenant B if that user has the same user ID. Horrifying!
I decided to address this issue by making a video that explains the problem, why it happens, and how to deal with it.
When you update your application’s configuration at runtime you need consider two things:
To explain this in detail, I made a video where I show you how to handle the cache component and make sure each tenant has its separate cache store by applying a prefix.
Using the same approach you can update the configuration of any component in your application while switching between tenants. For example; you can change the mail “from” address to match the tenant’s, you can configure a different slack channel for each tenant’s error notifications, and so on.
The good Laravel community on Twitter started a very interesting discussion on the single DB vs. per-tenant DB approaches.
The db-per-tenant approach guarantees customer isolation, it also makes it easier to move the dataset to different locations since it can be easily extracted. However, it requires more dev-ops work to configure replication, backups, etc…
The single database approach requires no extra dev-ops work. However, to achieve data isolation you need to focus while writing every single query to make sure it’s correctly scoped. In addition to this, the indices will grow large in size and a tenant with a large dataset will affect other tenants with smaller datasets.
It’s a tough call indeed. If it’s a business requirement to have separate databases then the decision is made for you already. But if you’re choosing between the two approaches, I recommend that you go for the single database approach and scope your queries.
The multi-database approach is sexy I know, it means you’ll just do Order::find() without having to use whereTenantId(). However, if you’re handling dev-ops yourself, having to deal with hundreds of databases is not sweet I promise.
Let me know what you think. Also here’s a link to part of the discussion: https://twitter.com/barryvdh/status/1257750063864045568
If you want to use a package instead of building your own way to multi-tenancy, here’s a list of some noteworthy packages:
There’s also a talk by Tom Schlick at Laracon US 2017 that I highly recommend. You can check it out here: https://multitenantlaravel.com/
No! You don’t need to change configuration files or jump between databases or use any packages if you’re building a multi-tenant application. You can build a multi-tenant application by just making sure your code is scoped for the tenant, the same way you scope your code for the logged in user.
Multi-tenancy seems confusing mainly because we want to write our code without worrying about the current tenant and have our application magically figure everything out for us. While this sounds cool, but if you want magic I highly recommend that you spend some time to understand how it works.
The downside of magic is it makes debugging hard. It also covers 99% of the use cases, once you hit an edge case that isn’t covered you’ll find that magic will fail you.
Whatever approach to multi-tenancy you choose, make sure you cover your application with enough tests so you can sleep well at night.
programming
via Laravel News Links https://ift.tt/2dvygAJ
May 14, 2020 at 09:57PM
Outdoor Photography is a Great COVID-19 Pastime
https://ift.tt/2Z71n62
If you are looking for something fun and challenging to do during the COVID-19 sheltering orders, try your hand at some outdoor photography. Every yard, neighborhood, or residential area has plenty of subjects to model for your camera. Songbirds, small animals like rabbits and squirrels, and even bigger game such as white-tailed deer can be caught on digital images throughout the country.
It doesn’t necessarily take professional camera equipment to catch images of wildlife. Close-ups can be captured around the house with a little time and patience. All you need is a decent digital 35mm camera ideally with some telephoto capabilities. This would be a great way to get started.
Scan your yard by spying out windows to see where birds and animals seem to gather. A great way to congregate birds is to set up a feeder or a couple of them in different places. Proximity to trees, shrubs, or such will give birds an extra sense of safety. It’s the same with small game if there are high grass areas, heavy shrubbery or bushes to hide in. Watch these areas for animal activity.
If you have a back porch, patio, or outdoor yard sitting area, post yourself a good seat for an observation post. Have a set of good binoculars to help you spot lofty birds or animals lurking around the yard. You have to remain quiet and develop a strong sense of patience to collect some good photo shots.
Don’t be disappointed if all of your shots do not turn out every time. Often birds move so fast or flutter around that wing motion or normal movement causes blurring. If your camera has an automatic focus setting, try that to see the quality of shots you get. Once you advance in your skills, you can try manual settings. If you are a total novice to photography get a basic book on the subject or look up related topics on the net. Soon you’ll be capturing some neat shots of all your subjects.
When reviewing your photo results, look at them with a critical eye. If you like the photo, forget the critics. This is a fun hobby for yourself or to share photos with family and friends. Look at the photo backgrounds. Did you catch a neighbor photo-bombing you or some other clutter in the background that is out of place? Next time, be aware of what’s beyond your subject.
These are the skills that you can practice over time. Remember, outdoor photography is meant to be fun during otherwise trying times.
The post Outdoor Photography is a Great COVID-19 Pastime appeared first on AllOutdoor.com.
guns
via All Outdoor https://ift.tt/2yaNKUu
May 13, 2020 at 09:23AM
Eloquent Double Entry Accounting with a focus on IFRS Compliant Reporting
https://ift.tt/2zvBLFw
Eloquent IFRS is a package by Edward Mungai that provides “double-entry accounting with a focus on International Financial Reporting Standards (IFRS) compliant reporting.”
According to the documentation’s introduction, this package can help you generate compliant reports:
The Eloquent IFRS package gives any Laravel application or Lumen API the ability to generate a comprehensive set of financial reports by providing an embedded double-entry bookkeeping system.
The Accounting objects are created with a consistent and fluent interface, allowing seamless integration with the Business objects of the parent application.
Here’s a high-level example from the readme, which demonstrates some of the models:
use IFRS\Models\Account; use IFRS\models\LineItem; $bankAccount = new Account([ 'name' => "Sales Account", 'account_type' => Account::BANK, ])->save(); // Intermediate save does not record the transaction in the Ledger $cashSale = new CashSale([ 'account_id' => $bankAccount->id, 'date' => Carbon::now(), 'narration' => "Example Cash Sale", ])->save(); // This posts the Transaction to the Ledger $cashSaleLineItem = new LineItem([ 'vat_id' => $outputVat->id, 'account_id' => $revenueAccount->id, 'vat_account_id' => $salesVatAccount->id, 'description' => "Example Cash Sale Line Item", 'quantity' => 1, 'amount' => 100, ])->save(); $cashSale->addLineItem($cashSaleLineItem); $cashSale->post();
Here’s an example of an income report (profit and loss):
use IFRS\Reports\IncomeStatement; $incomeStatement = new IncomeStatement( "2020-01-01", // Report start date "2020-12-31", // Report end date )->getSections();// Fetch balances from the ledger and store them internally /** * this function is only for demonstration and * debugging use and should never be called in production */ dd($incomeStatement->toString()); Example Company Income Statement For the Period: Jan 01 2020 to Dec 31 2020 Operating Revenues Operating Revenue 200 (100 cash sales + 100 credit sales) Operating Expenses Operating Expense 100 (cash purchase) --------------- Operations Gross Profit 100 Non Operating Revenues Non Operating Revenue 0 --------------- Total Revenue 100 Non Operating Expenses Direct Expense 0 Overhead Expense 0 Other Expense 0 --------------- Total Expenses 0 --------------- Net Profit 100 ===============
All of the above examples come from the project readme, and is only a sample of what the package provides. The details of the package (and IFRS reporting) are quite intricate, and you should consult the full documentation.
I find this package unique because it’s created by a “finance guy turned developer.” It’s fantastic to see professionals in other industries turn to Laravel to develop ideas.
You can learn more about this package, get full installation instructions, and view the source code on GitHub at ekmungai/eloquent-ifrs.
Filed in: News
programming
via Laravel News https://ift.tt/14pzU0d
May 13, 2020 at 09:31AM
Automatic Code refactor and error detection with laravel-microscope
https://ift.tt/362PkbG
early returns
automatically.You can install the package via composer:
composer require imanghafoori/laravel-microscope --dev
You can run:
Lets start with:
php artisan check:early_returns
This will scan all your Psr-4 loaded classes and flattens your functions ans loops by applting the early return rule. For example:
forearch ($products as $product) { if ($someCond) { // A lot of code 1 // A lot of code 1 // A lot of code 1 // A lot of code 1 // A lot of code 1 if ($someOtherCond) { // A lot more code 2 // A lot more code 2 // A lot more code 2 // A lot more code 2 // A lot more code 2 // } // <--- closes second if } // <--- closes first if }
Will be discovered and converted into:
forearch ($products as $product) { if (! $someCond) { continue; } // A lot of code 1 // A lot of code 1 // A lot of code 1 // A lot of code 1 // A lot of code 1 if (! $someOtherCond) { continue; } // A lot more code 2 // A lot more code 2 // A lot more code 2 // A lot more code 2 // A lot more code 2 }
The same thing will apply for functions and methods, but with return
if ($var1) { if ($var2 > 2) { echo 'Hey Man'; } } // will be converted into: if ($var1 && $var2 > 2) { echo 'Hey Man'; }
if ($var1): if ($var2 > 2): echo 'Hey Man'; endif; endif;
Although this type of refactor is totally safe and is guaranteed to do the same thing as before, but anyway be careful to commit everything before trying this feature, in case of a weird bug or something.
For example consider:
Event::listen(MyEvent::class, '\App\Listeners\MyListener@myMethod');
1 – It checks the \App\Listeners\MyListener
class path to be valid.
2 – It checks the myMethod
to exist on the MyListener
class
3 – It checks the myMethod
to have the right type-hint (if any) in its signature, for example:
public function myMethod(OtherEvent $e) // <---- notice type-hint here { // }
This is a valid but wrong type-hint, and will be reported to you. Very cool, isn’t it ??!
1- in the EventServiceProvider
,
2- By Event::listen
facade,
3- By Subscriber class… or any other way. The error would be found. 🙂
It checks the validity of all the gates you have defined, making sure that they refer to a valid class and method.
It also checks for the policy definitions to be valid.
Gate::policy(User::class, 'UserPolicy@someMethod'); Gate::define('someAbility', 'UserGate@someMethod');
1 – It checks the User
class path to be valid.
2 – It checks the UserPolicy
class path to be valid.
3 – It checks the someMethod
to exist.
php artisan check:imports
use
statements) to be valid.use Request;
would be valid.route()
, redirect()->route()
, \Redirect::route()
to refer to valid routes.dead controllers
are detected.php artisan check:compact
compact()
calls and reports to you, which parameters should be removed.view()
and View::make()
and reports if they refer to wrong files.@include()
and @extends()
and reports if they refer to wrong files.Also, it can detect unused variables
which are passed into your view from the controller line this: view('hello', [...]);
For that you must open up the page in the browser and then visit the log file to see a message like this:
local.INFO: Laravel Microscope: The view file: welcome.index-1 at App\Http\Controllers\HomeController@index has some unused variables passed to it: local.INFO: array ('$var1' , '$var2');
Remember some variables are passed into your view from a view composer
and not the controller. Those variables are also taken into consideration when detecting unused variables.
and more features will be added soon. 😉
The MIT License (MIT). Please see License File for more information.
If you find an issue, or have a better way to do something, feel free to open an issue , or a pull request. If you use laravel-microscope in your open source project, create a pull request to provide it’s url as a sample application in the README.md file.
If you discover any security related issues, please email imanghafoori1@gmail.com
instead of using the issue tracker.
As always if you found this package useful , and you want to encourage us to maintain and work on it. Just press the star button to declare your willing.
Stargazers: https://github.com/imanghafoori1/microscope/stargazers
💎 It allows us to write expressive code to authorize, validate and authenticate.
💎 A minimal yet powerful package to give you the opportunity to refactor your controllers.
💎 It allows you to login with any password in the local environment only.
💎 It allows you to decouple your eloquent models to reach a modular structure
Send me as much as a banana costs in your region:
return abort();
A man will never fail, unless he stops trying. Albert einstein
programming
via Laravel News Links https://laravel-news.com/links
May 12, 2020 at 09:45PM
Eloquent Double Entry Accounting
https://ift.tt/3dgyUPg
This Package enables any Laravel application to generate International Financial Reporting Standards compatible Financial Statements by providing a fully featured and configurable Double Entry accounting subsystem.
The package supports multiple Entities (Companies), Account Categorization, Transaction assignment, Start of Year Opening Balances and accounting for VAT Transactions. Transactions are also protected against tampering via direct database changes ensuring the integrity of the Ledger.
The motivation for this package can be found in detail on my blog post here
Use composer to Install the package into your laravel or lumen application. Laravel IFRS requires PHP version 7.2 and Laravel or Lumen version 5.0 and above.
composer require "ekmungai/eloquent-ifrs" composer install --no-dev
Then run migrations to create the database tables.
Clone this repo, and then run Composer in local repo root to pull in dependencies.
git clone git@github.com/ekmungai/eloquent-ifrs eloquent-ifrs cd eloquent-ifrs composer update
To run the tests:
cd eloquent-ifrs vendor/bin/phpunit
The package installs with the default settings as regards the names of Accounts/Transactions Types, Report Titles and Section names as well as Accounts Codes. To adjust these settings use the Laravel artisan publish command to install the ifrs configuration to your application’s config folder where you can edit it.
php artisan vendor:publish
Full documentation for this package can be found here.
This simple example covers the four scenarios to demonstrate the use of the package. First, a description of a Cash Sale to a customer, then a Credit Sale (Invoice) to a client, then a Cash Purchase for an operations expense and finally a Credit Purchase (Bill) from a Supplier for a non operations purpose (Asset Purchase).
First we’ll setup the Company (Reporting Entity) and required Accounts to record the Transactions. (Assuming that a registered User already exists):
use IFRS\Models\Entity; use IFRS\Models\Currency; //Entities require a reporting currency $currency = new Currency([ "name" => "Euro", "currency_code" => "EUR" )->save(); $entity = new Entity([ "name" => "Example Company", "currency_id" => $currency ])->save();
We also need the VAT Rates that apply to the Entity:
use IFRS\Models\Vat; $outputVat = new Vat([ 'name' => "Standard Output Vat", 'code' => "O", 'rate' => 20, ])->save(); $outputVat = new Vat([ 'name' => "Standard Input Vat", 'code' => "I", 'rate' => 10, ])->save(); $outputVat = new Vat([ 'name' => "Zero Vat", 'code' => "Z", 'rate' => 0, ])->save();
Now we’ll set up some Accounts:
use IFRS\Models\Account; $bankAccount = new Account([ 'name' => "Sales Account", 'account_type' => Account::BANK, ])->save(); $revenueAccount = new Account([ 'name' => "Bank Account", 'account_type' => Account::OPERATING_REVENUE, ])->save(); $clientAccount = new Account([ 'name' => "Example Client Account", 'account_type' => Account::RECEIVABLE, ])->save(); $supplierAccount = new Account([ 'name' => "Example Supplier Account", 'account_type' => Account::PAYABLE, ])->save(); $opexAccount = new Account([ 'name' => "Operations Expense Account", 'account_type' => Account::OPERATING_EXPENSE, ])->save(); $assetAccount = new Account([ 'name' => "Office Equipment Account", 'account_type' => Account::NON_CURRENT_ASSET, ])->save(); $salesVatAccount = new Account([ 'name' => "Sales VAT Account", 'account_type' => Account::CONTROL_ACCOUNT, ])->save(); $purchasesVatAccount = new Account([ 'name' => "Input VAT Account", 'account_type' => Account::CONTROL_ACCOUNT, ])->save();
Now that all Accounts are prepared, we can create the first Transaction, a Cash Sale:
use IFRS\Transactions\CashSale; $cashSale = new CashSale([ 'account_id' => $bankAccount->id, 'date' => Carbon::now(), 'narration' => "Example Cash Sale", ])->save(); // Intermediate save does not record the transaction in the Ledger
So far the Transaction has only one side of the double entry, so we create a Line Item for the other side:
use IFRS\models\LineItem; $cashSaleLineItem = new LineItem([ 'vat_id' => $outputVat->id, 'account_id' => $revenueAccount->id, 'vat_account_id' => $salesVatAccount->id, 'description' => "Example Cash Sale Line Item", 'quantity' => 1, 'amount' => 100, ])->save(); $cashSale->addLineItem($cashSaleLineItem); $cashSale->post(); // This posts the Transaction to the Ledger
The rest of the transactions:
use IFRS\Transactions\ClientInvoice; $clientInvoice = new ClientInvoice([ 'account_id' => $clientAccount->id, 'date' => Carbon::now(), 'narration' => "Example Credit Sale", ])->save(); $clientInvoiceLineItem = new LineItem([ 'vat_id' => $outputVat->id, 'account_id' => $revenueAccount->id, 'vat_account_id' => $salesVatAccount->id, 'description' => "Example Credit Sale Line Item", 'quantity' => 2, 'amount' => 50, ])->save(); $clientInvoice->addLineItem($clientInvoiceLineItem); //Transaction save may be skipped as post() saves the Transaction automatically $clientInvoice->post(); use IFRS\Transactions\CashPurchase; $cashPurchase = new CashPurchase([ 'account_id' => $clientAccount->id, 'date' => Carbon::now(), 'narration' => "Example Cash Purchase", ])->save(); $cashPurchaseLineItem = new LineItem([ 'vat_id' => $inputVat->id, 'account_id' => $opexAccount->id, 'vat_account_id' => $purchaseVatAccount->id, 'description' => "Example Cash Purchase Line Item", 'quantity' => 4, 'amount' => 25, ])->save(); $cashPurchase->addLineItem($cashPurchaseLineItem)->post(); use IFRS\Transactions\SupplierBill; $supplierBill = new SupplierBill([ 'account_id' => $supplierAccount->id, 'date' => Carbon::now(), 'narration' => "Example Credit Purchase", ])->save(); $supplierBillLineItem = new LineItem([ 'vat_id' => $inputVat->id, 'account_id' => $assetAccount->id, 'vat_account_id' => $purchaseVatAccount->id, 'description' => "Example Credit Purchase Line Item", 'quantity' => 4, 'amount' => 25, ])->save(); $supplierBill->addLineItem($supplierBillLineItem)->post(); use IFRS\Transactions\ClientReceipt; $clientReceipt = new ClientReceipt([ 'account_id' => $clientAccount->id, 'date' => Carbon::now(), 'narration' => "Example Client Payment", ])->save(); $clientReceiptLineItem = new LineItem([ 'vat_id' => $zeroVat->id, 'account_id' => $bankAccount->id, 'vat_account_id' => $purchaseVatAccount->id, 'description' => "Part payment for Client Invoice", 'quantity' => 1, 'amount' => 50, ])->save(); $clientReceipt->addLineItem($clientReceiptLineItem)->post();
We can assign the receipt to partially clear the Invoice above:
use IFRS\Models\Assignment; echo $clientInvoice->clearedAmount(); //0: Currently the Invoice has not been cleared at all echo $clientReceipt->balance(); //50: The Receipt has not been assigned to clear any transaction $assignment = new Assignment([ 'transaction_id' => $clientReceipt->id, 'cleared_id' => $clientInvoice->id, 'cleared_type'=> $clientInvoice->getClearedType(), 'amount' => 50, ])->save(); echo $clientInvoice->clearedAmount(); //50 echo $clientReceipt->balance(); //0: The Receipt has been assigned fully to the Invoice
We have now some Transactions in the Ledger, so lets generate some reports. First though, Reports require a reporting period:
use IFRS\Models\ReportingPeriod; $period = new ReportingPeriod([ 'period_count' => 1, 'year' => 2020, ])->save();
The Income Statement (Profit and Loss):
use IFRS\Reports\IncomeStatement; $incomeStatement = new IncomeStatement( "2020-01-01", // Report start date "2020-12-31", // Report end date )->getSections();// Fetch balances from the ledger and store them internally /** * this function is only for demonstration and * debugging use and should never be called in production */ dd($incomeStatement->toString()); Example Company Income Statement For the Period: Jan 01 2020 to Dec 31 2020 Operating Revenues Operating Revenue 200 (100 cash sales + 100 credit sales) Operating Expenses Operating Expense 100 (cash purchase) --------------- Operations Gross Profit 100 Non Operating Revenues Non Operating Revenue 0 --------------- Total Revenue 100 Non Operating Expenses Direct Expense 0 Overhead Expense 0 Other Expense 0 --------------- Total Expenses 0 --------------- Net Profit 100 ===============
The Balance Sheet:
use IFRS\Reports\BalanceSheet; $balanceSheet = new BalanceSheet( "2020-12-31" // Report end date )->getSections(); /** * again to emphasize, this function is only for demonstration and * debugging use and should never be called in production */ dd($balanceSheet->toString()); Example Company Balance Sheet As at: Dec 31 2020 Assets Non Current Asset 120 (asset purchase) Receivables 70 (100 credit sale + 20 VAT - 50 client receipt) Bank 50 (120 cash sale - 120 cash purchase + 50 client receipt) --------------- Total Assets 240 Liabilities Control Account 20 (VAT: 20 cash sale + 20 credit sale - 10 cash purchase - 10 credit purchase) Payable 120 (100 credit purchase + 20 VAT) --------------- Total Liabilities 140 --------------- Net Assets 100 =============== Equity Income Statement 100 --------------- Total Equity 100 ===============
While the Income Statement and Balance Sheet are the ultimate goal for end year (IFRS) reporting, the package also provides intermediate period reports including Account Statement, which shows a chronological listing of all Transactions posted to an account ending with the current balance for the account; and Account Schedule, which is similar to an Account Statement with the difference that rather than list all Transactions that constitute the ending balance the report only shows the outstanding (Uncleared) Transactions.
In the above example:
use IFRS\Reports\AccountStatement; use IFRS\Reports\AccountSchedule; $statement = new AccountStatement($clientAccount)->getTransactions(); dd($statement->transactions); array:2[ ["transaction" => ClientInvoice, "debit" => 120, "credit" => 0, "balance" => 120], ["transaction" => ClientReceipt, "debit" => 0, "credit" => 50, "balance" => 70] ] $schedule = new AccountSchedule($clientAccount, $currency)->getTransactions(); dd($schedule->transactions); array:1[ ["transaction" => ClientInvoice, "amount" => 120, "cleared" => 50, "balance" => 70], ]
I am acutely aware that as a professionally trained Accountant I may have used some conventions, definitions and styles that while seemingly obvious to me, might not be so clear to another developer. I would therefore welcome and greatly appreciate any feedback on the ease of use of the package so I can make it more useful to as many people as possible.
git checkout -b feature/fooBar
)git commit -am 'Add some fooBar'
)git push origin feature/fooBar
)This software is distributed for free under the MIT License
This package is heavily influenced by chippyash/simple-accounts-3 and scottlaurent/accounting.
programming
via Laravel News Links https://ift.tt/2dvygAJ
May 12, 2020 at 09:45PM
Air Force Museum Drone Tour
https://ift.tt/2Wq0tjk
If you’re going to take a tour of Ohio’s National Museum of the U.S. Air Force, it might as well be from the air, right? Well thanks to NURK FPV, we can take a first-person drone flight through the museum’s awesome collection of aviation marvels without having to leave our homes.
fun
via The Awesomer https://theawesomer.com
May 12, 2020 at 07:15PM