8000 2.0 dev by denisdulici · Pull Request #897 · akaunting/akaunting · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

2.0 dev #897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ APP_LOCALE=en-GB
APP_INSTALLED=false
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_SCHEDULE_TIME="09:00"

DB_CONNECTION=mysql
Expand All @@ -18,7 +17,8 @@ DB_PREFIX=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database
QUEUE_CONNECTION=sync
LOG_CHANNEL=stack

MAIL_DRIVER=mail
MAIL_HOST=localhost
Expand All @@ -28,3 +28,5 @@ MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_NAME=null
MAIL_FROM_ADDRESS=null

FIREWALL_ENABLED=false
8 changes: 5 additions & 3 deletions .env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ APP_LOCALE=en-GB
APP_INSTALLED=false
APP_KEY=base64:xBC+BxlC7sXhYAtpTZv8TYAHqoPgsJaXL0S5Id6BbBc=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_SCHEDULE_TIME="09:00"

DB_CONNECTION=sqlite
Expand All @@ -14,11 +13,14 @@ DB_PREFIX=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database
QUEUE_CONNECTION=sync
LOG_CHANNEL=stack

MAIL_DRIVER=mail
MAIL_DRIVER=log
MAIL_HOST=localhost
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

FIREWALL_ENABLED=false
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patreon: akaunting
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
/storage/*.key
/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
.env
.env.example
robots.txt
_ide_helper.php
.phpstorm.meta.php
/storage/debugbar/*
/storage/debugbar/*
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: php

php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'

Expand Down
23 changes: 0 additions & 23 deletions Dockerfile

This file was deleted.

74 changes: 16 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Akaunting™

![Latest Stable Version](https://img.shields.io/github/release/akaunting/akaunting.svg) ![Total Downloads](https://img.shields.io/github/downloads/akaunting/akaunting/total.svg) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/akaunting/localized.svg)](https://crowdin.com/project/akaunting) ![Build Status](https://travis-ci.com/akaunting/akaunting.svg) [![Backers on Open Collective](https://opencollective.com/akaunting/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/akaunting/sponsors/badge.svg)](#sponsors)
![Latest Stable Version](https://img.shields.io/github/release/akaunting/akaunting.svg) ![Total Downloads](https://img.shields.io/github/downloads/akaunting/akaunting/total.svg) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/akaunting/localized.svg)](https://crowdin.com/project/akaunting) ![Build Status](https://travis-ci.com/akaunting/akaunting.svg)

Akaunting is a free, open source and online accounting software designed for small businesses and freelancers. It is built with modern technologies such as Laravel, Bootstrap, jQuery, RESTful API etc. Thanks to its modular structure, Akaunting provides an awesome App Store for users and developers.
Akaunting is a free, open source and online accounting software designed for small businesses and freelancers. It is built with modern technologies such as Laravel, VueJS, Bootstrap 4, RESTful API etc. Thanks to its modular structure, Akaunting provides an awesome App Store for users and developers.

* [Home](https://akaunting.com) - The house of Akaunting
* [Blog](https://akaunting.com/blog) - Get the latest news
Expand All @@ -12,51 +12,25 @@ Akaunting is a free, open source and online accounting software designed for sma

## Requirements

* PHP 5.6.4 or higher
* PHP 7.2 or higher
* Database (eg: MySQL, PostgreSQL, SQLite)
* Web Server (eg: Apache, Nginx, IIS)
* [Other libraries](https://akaunting.com/docs/requirements)

## Framework

Akaunting uses [Laravel](http://laravel.com), the best existing PHP framework, as the foundation framework and [Modules](https://nwidart.com/laravel-modules) package for Apps.
Akaunting uses [Laravel](http://laravel.com), the best existing PHP framework, as the foundation framework and [Module](https://github.com/akaunting/module) package for Apps.

## Installation

* Install [Composer](https://getcomposer.org/download)
* Download the [repository](https://github.com/akaunting/akaunting/archive/master.zip) and unzip into your server
* Open and point your command line to the directory you unzipped Akaunting
* Run the following command: `composer install`
* Finally, launch the [installer](https://akaunting.com/docs/installation)

## Docker

It is possible to containerise Akaunting using the [`docker-compose`](docker-compose.yml) file. Here are a few commands:

```
# Build the app
docker build -t akaunting .

# Run the app
docker-compose up -d

# Make sure you the dependencies are installed
docker-compose exec web composer install

# Stream logs
docker-compose logs -f web

# Access the container
docker-compose exec web /bin/sh

# Stop & Delete everything
docker-compose down -v
```
* Install [Composer](https://getcomposer.org/download)
* Download the [repository](https://github.com/akaunting/akaunting/archive/master.zip) and unzip into your server
* Open and point your command line to the directory you unzipped Akaunting
* Run the following command: `composer install`
* Finally, launch the [installer](https://akaunting.com/docs/installation)

## Contributing

Fork the repository, make the code changes then submit a pull request.

Please, be very clear on your commit messages and pull requests, empty pull request messages may be rejected without reason.

When contributing code to Akaunting, you must follow the PSR coding standards. The golden rule is: Imitate the existing Akaunting code.
Expand All @@ -77,35 +51,19 @@ If you discover any security related issues, please email security@akaunting.com

## Credits

- [Denis Duliçi](https://github.com/denisdulici)
- [Cüneyt Şentürk](https://github.com/cuneytsenturk)
- [All Contributors](../../contributors)

## Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
[![Contributors](https://opencollective.com/akaunting/contributors.svg?width=890&button=false)](../../contributors)
* [Denis Duliçi](https://github.com/denisdulici)
* [Cüneyt Şentürk](https://github.com/cuneytsenturk)
* [All Contributors](../../contributors)

## Backers
## Partners

Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/akaunting#backer)]
Each of our partners can help you craft a beautiful, well-architected project. Feel free to get in [contact](https://akaunting.com/contact) with us to become a partner.

[![Backers](https://opencollective.com/akaunting/backers.svg?width=890)](https://opencollective.com/akaunting#backers)
* [Creative Tim](https://www.creative-tim.com) is our design partner since Akaunting 2.0 version. They create beautiful UI Kits, Templates, and Dashboards built on top of Bootstrap, Vue.js, React, Angular, Node.js, and Laravel.

## Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/akaunting#sponsor)]

[![Sponsor 0](https://opencollective.com/akaunting/sponsor/0/avatar.svg)](https://opencollective.com/akaunting/sponsor/0/website)
[![Sponsor 1](https://opencollective.com/akaunting/sponsor/1/avatar.svg)](https://opencollective.com/akaunting/sponsor/1/website)
[![Sponsor 2](https://opencollective.com/akaunting/sponsor/2/avatar.svg)](https://opencollective.com/akaunting/sponsor/2/website)
[![Sponsor 3](https://opencollective.com/akaunting/sponsor/3/avatar.svg)](https://opencollective.com/akaunting/sponsor/3/website)
[![Sponsor 4](https://opencollective.com/akaunting/sponsor/4/avatar.svg)](https://opencollective.com/akaunting/sponsor/4/website)
[![Sponsor 5](https://opencollective.com/akaunting/sponsor/5/avatar.svg)](https://opencollective.com/akaunting/sponsor/5/website)
[![Sponsor 6](https://opencollective.com/akaunting/sponsor/6/avatar.svg)](https://opencollective.com/akaunting/sponsor/6/website)
[![Sponsor 7](https://opencollective.com/akaunting/sponsor/7/avatar.svg)](https://opencollective.com/akaunting/sponsor/7/website)
[![Sponsor 8](https://opencollective.com/akaunting/sponsor/8/avatar.svg)](https://opencollective.com/akaunting/sponsor/8/website)
[![Sponsor 9](https://opencollective.com/akaunting/sponsor/9/avatar.svg)](https://opencollective.com/akaunting/sponsor/9/website)
Support Akaunting by becoming a sponsor on [Patreon](https://www.patreon.com/akaunting). Your logo will show up here with a link to your website.

## License

Expand Down
162 changes: 162 additions & 0 deletions app/Abstracts/BulkAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<?php

namespace App\Abstracts;

use Artisan;
use Illuminate\Database\Eloquent\Collection;

class BulkAction
{

public $model = false;

public $actions = [
'enable' => [
'name' => 'general.enable',
'message' => 'bulk_actions.message.enable',
'permission' => 'update-common-items'
],
'disable' => [
'name' => 'general.disable',
'message' => 'bulk_actions.message.disable',
'permission' => 'update-common-items'
],
'export' => [
'name' => 'general.export',
'message' => 'bulk_actions.message.exports',
],
'delete' => [
'name' => 'general.delete',
'message' => 'bulk_actions.message.deletes',
'permission' => 'delete-common-items'
]
];

/**
* Duplicate the specified resource.
*
* @param $request
*
* @return Response
*/
public function duplicate($request)
{
$selected = $request->get('selected', []);

$items = $this->model::find($selected);

foreach ($items as $item) {
$item->duplicate();
}
}

/**
* Enable the specified resource.
*
* @param $request
*
* @return Response
*/
public function enable($request)
{
$selected = $request->get('selected', []);

$items = $this->model::find($selected);

foreach ($items as $item) {
$item->enabled = 1;
$item->save();
}
}

/**
* Disable the specified resource.
*
* @param $request
*
* @return Response
*/
public function disable($request)
{
$selected = $request->get('selected', []);

$items = $this->model::find($selected);

foreach ($items as $item) {
$item->enabled = 0;
$item->save();
}
}

/**
* Remove the specified resource from storage.
*
* @param $request
*
* @return Response
*/
public function delete($request)
{
$this->destroy($request);
}

/**
C001 * Remove the specified resource from storage.
*
* @param $request
*
* @return Response
*/
public function destroy($request)
{
$selected = $request->get('selected', []);

$items = $this->model::find($selected);

foreach ($items as $item) {
$item->delete();
}

Artisan::call('cache:clear');
}

public function countRelationships($model, $relationships)
{
$counter = [];

foreach ($relationships as $relationship => $text) {
if ($c = $model->$relationship()->count()) {
$counter[] = $c . ' ' . strtolower(trans_choice('general.' . $text, ($c > 1) ? 2 : 1));
}
}

return $counter;
}

/**
* Mass delete relationships with events being fired.
*
* @param $model
* @param $relationships
*
* @return void
*/
public function deleteRelationships($model, $relationships)
{
foreach ((array) $relationships as $relationship) {
if (empty($model->$relationship)) {
continue;
}

$items = $model->$relationship->all();

if ($items instanceof Collection) {
$items = $items->all();
}

foreach ((array) $items as $item) {
$item->delete();
}
}
}
}
Loading
0