Merge branch 'master' of github.com:akaunting/akaunting into 2.1-dev

This commit is contained in:
Cüneyt Şentürk 2020-09-08 11:11:36 +03:00
commit f62374b0d4
48 changed files with 1230 additions and 279 deletions

View File

@ -3,7 +3,6 @@
namespace App\Abstracts;
use App\Abstracts\Model;
use App\Events\Sale\InvoicePaidCalculated;
use App\Models\Setting\Tax;
use App\Traits\Currencies;
use App\Traits\DateTime;
@ -116,14 +115,9 @@ abstract class DocumentModel extends Model
$this->setAttribute('reconciled', $reconciled);
// TODO: find a cleaner way compatible with observer pattern
$invoice = clone $this;
$invoice->paid_amount = $paid;
event(new InvoicePaidCalculated($invoice));
return round($invoice->paid_amount, $precision);
return round($paid, $precision);
}
/**
* Get the status label.
*

View File

@ -0,0 +1,22 @@
<?php
namespace App\Events\Document;
use Illuminate\Queue\SerializesModels;
class PaidAmountCalculated
{
use SerializesModels;
public $model;
/**
* Create a new event instance.
*
* @param $model
*/
public function __construct($model)
{
$this->model = $model;
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Events\Document;
use Illuminate\Queue\SerializesModels;
class TransactionsCounted
{
use SerializesModels;
public $model;
/**
* Create a new event instance.
*
* @param $model
*/
public function __construct($model)
{
$this->model = $model;
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace App\Events\Sale;
use Illuminate\Queue\SerializesModels;
class InvoicePaidCalculated
{
use SerializesModels;
public $invoice;
/**
* Create a new event instance.
*
* @param $invoice
*/
public function __construct($invoice)
{
$this->invoice = $invoice;
}
}

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Portal;
use App\Abstracts\Http\Controller;
use App\Http\Requests\Portal\InvoiceShow as Request;
use App\Models\Sale\Invoice;
use App\Models\Setting\Category;
use App\Traits\Currencies;
@ -41,7 +42,7 @@ class Invoices extends Controller
*
* @return Response
*/
public function show(Invoice $invoice)
public function show(Invoice $invoice, Request $request)
{
$payment_methods = Modules::getPaymentMethods();
@ -57,7 +58,7 @@ class Invoices extends Controller
*
* @return Response
*/
public function printInvoice(Invoice $invoice)
public function printInvoice(Invoice $invoice, Request $request)
{
$invoice = $this->prepareInvoice($invoice);
@ -71,7 +72,7 @@ class Invoices extends Controller
*
* @return Response
*/
public function pdfInvoice(Invoice $invoice)
public function pdfInvoice(Invoice $invoice, Request $request)
{
$invoice = $this->prepareInvoice($invoice);
@ -92,22 +93,6 @@ class Invoices extends Controller
protected function prepareInvoice(Invoice $invoice)
{
$paid = 0;
foreach ($invoice->transactions as $item) {
$amount = $item->amount;
if ($invoice->currency_code != $item->currency_code) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->getAmountConvertedFromDefault();
}
$paid += $amount;
}
$invoice->paid = $paid;
$invoice->template_path = 'sales.invoices.print_' . setting('invoice.template' ,'default');
event(new \App\Events\Sale\InvoicePrinting($invoice));
@ -121,22 +106,6 @@ class Invoices extends Controller
redirect()->route('login');
}
$paid = 0;
foreach ($invoice->transactions as $item) {
$amount = $item->amount;
if ($invoice->currency_code != $item->currency_code) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->getAmountConvertedFromDefault();
}
$paid += $amount;
}
$invoice->paid = $paid;
$payment_methods = Modules::getPaymentMethods();
$payment_actions = [];

View File

@ -4,11 +4,11 @@ namespace App\Http\Controllers\Portal;
use App\Abstracts\Http\Controller;
use App\Models\Banking\Transaction;
use App\Http\Requests\Portal\PaymentShow as Request;
use App\Utilities\Modules;
class Payments extends Controller
{
/**
* Display a listing of the resource.
*
@ -30,7 +30,7 @@ class Payments extends Controller
*
* @return Response
*/
public function show(Transaction $payment)
public function show(Transaction $payment, Request $request)
{
$payment_methods = Modules::getPaymentMethods('all');

View File

@ -54,7 +54,9 @@ class Settings extends Controller
$settings = [];
foreach ($modules->settings as $alias => $setting) {
if (!user()->can('read-' . $alias . '-settings')) {
$permission = !empty($setting['permission']) ? $setting['permission'] : 'read-' . $alias . '-settings';
if (!user()->can($permission)) {
continue;
}

View File

@ -0,0 +1,34 @@
<?php
namespace App\Http\Requests\Portal;
use App\Abstracts\Http\FormRequest;
class InvoiceShow extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
if (auth()->guest()) {
return true;
}
return $this->invoice->contact_id == user()->contact->id;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests\Portal;
use App\Abstracts\Http\FormRequest;
class PaymentShow extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return $this->payment->contact_id == user()->contact->id;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View File

@ -6,6 +6,7 @@ use App\Abstracts\Job;
use App\Jobs\Banking\CreateTransaction;
use App\Jobs\Purchase\CreateBillHistory;
use App\Jobs\Sale\CreateInvoiceHistory;
use App\Events\Document\PaidAmountCalculated;
use App\Models\Banking\Transaction;
use App\Models\Sale\Invoice;
use App\Traits\Currencies;
@ -64,11 +65,17 @@ class CreateDocumentTransaction extends Job
protected function prepareRequest()
{
if (!isset($this->request['amount'])) {
$this->model->paid_amount = $this->model->paid;
event(new PaidAmountCalculated($this->model));
$this->request['amount'] = $this->model->amount - $this->model->paid_amount;
}
$this->request['company_id'] = session('company_id');
$this->request['currency_code'] = isset($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code;
$this->request['type'] = ($this->model instanceof Invoice) ? 'income' : 'expense';
$this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->format('Y-m-d');
$this->request['amount'] = isset($this->request['amount']) ? $this->request['amount'] : ($this->model->amount - $this->model->paid);
$this->request['currency_rate'] = config('money.' . $this->request['currency_code'] . '.rate');
$this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account');
$this->request['document_id'] = isset($this->request['document_id']) ? $this->request['document_id'] : $this->model->id;
@ -92,8 +99,13 @@ class CreateDocumentTransaction extends Job
$amount = round($converted_amount, $precision);
}
$total_amount = round($this->model->amount - $this->model->paid, $precision);
$this->model->paid_amount = $this->model->paid;
event(new PaidAmountCalculated($this->model));
$total_amount = round($this->model->amount - $this->model->paid_amount, $precision);
unset($this->model->reconciled);
unset($this->model->paid_amount);
$compare = bccomp($amount, $total_amount, $precision);

View File

@ -3,6 +3,7 @@
namespace App\Jobs\Purchase;
use App\Abstracts\Job;
use App\Events\Document\PaidAmountCalculated;
use App\Events\Purchase\BillUpdated;
use App\Events\Purchase\BillUpdating;
use App\Jobs\Purchase\CreateBillItemsAndTotals;
@ -53,14 +54,16 @@ class UpdateBill extends Job
$this->dispatch(new CreateBillItemsAndTotals($this->bill, $this->request));
$bill_paid = $this->bill->paid;
$this->bill->paid_amount = $this->bill->paid;
event(new PaidAmountCalculated($this->bill));
unset($this->bill->reconciled);
if (($bill_paid) && $this->request['amount'] > $bill_paid) {
if ($this->request['amount'] > $this->bill->paid_amount) {
$this->request['status'] = 'partial';
}
unset($this->bill->reconciled);
unset($this->bill->paid_amount);
$this->bill->update($this->request->input());
$this->bill->updateRecurring();

View File

@ -3,6 +3,7 @@
namespace App\Jobs\Sale;
use App\Abstracts\Job;
use App\Events\Document\PaidAmountCalculated;
use App\Events\Sale\InvoiceUpdated;
use App\Events\Sale\InvoiceUpdating;
use App\Jobs\Sale\CreateInvoiceItemsAndTotals;
@ -53,14 +54,16 @@ class UpdateInvoice extends Job
$this->dispatch(new CreateInvoiceItemsAndTotals($this->invoice, $this->request));
$invoice_paid = $this->invoice->paid;
$this->invoice->paid_amount = $this->invoice->paid;
event(new PaidAmountCalculated($this->invoice));
unset($this->invoice->reconciled);
if (($invoice_paid) && $this->request['amount'] > $invoice_paid) {
if ($this->request['amount'] > $this->invoice->paid_amount) {
$this->request['status'] = 'partial';
}
unset($this->invoice->reconciled);
unset($this->invoice->paid_amount);
$this->invoice->update($this->request->all());
$this->invoice->updateRecurring();

View File

@ -291,4 +291,36 @@ class Transaction extends Model
{
return $value ?? trans_choice('general.' . Str::plural($this->type), 1);
}
/**
* Get the route name.
*
* @return string
*/
public function getRouteNameAttribute($value)
{
if ($value) {
return $value;
}
if ($this->isIncome()) {
return !empty($this->document_id) ? 'invoices.show' : 'revenues.edit';
}
if ($this->isExpense()) {
return !empty($this->document_id) ? 'bills.show' : 'payments.edit';
}
return 'transactions.index';
}
/**
* Get the route id.
*
* @return string
*/
public function getRouteIdAttribute($value)
{
return $value ?? $this->document_id ?? $this->id;
}
}

View File

@ -45,7 +45,7 @@ class Reset extends Notification
{
return (new MailMessage)
->line(trans('auth.notification.message_1'))
->action(trans('auth.notification.button'), route('auth.reset', $this->token))
->action(trans('auth.notification.button'), route('reset', $this->token))
->line(trans('auth.notification.message_2'));
}
}

View File

@ -3,6 +3,7 @@
namespace App\Observers;
use App\Abstracts\Observer;
use App\Events\Document\TransactionsCounted;
use App\Jobs\Purchase\CreateBillHistory;
use App\Jobs\Sale\CreateInvoiceHistory;
use App\Models\Banking\Transaction as Model;
@ -33,7 +34,12 @@ class Transaction extends Observer
{
$invoice = $transaction->invoice;
$invoice->status = ($invoice->transactions->count() > 1) ? 'partial' : 'sent';
$invoice->transactions_count = $invoice->transactions->count();
event(new TransactionsCounted($invoice));
$invoice->status = ($invoice->transactions_count > 0) ? 'partial' : 'sent';
unset($invoice->transactions_count);
$invoice->save();
@ -44,7 +50,12 @@ class Transaction extends Observer
{
$bill = $transaction->bill;
$bill->status = ($bill->transactions->count() > 1) ? 'partial' : 'received';
$bill->transactions_count = $bill->transactions->count();
event(new TransactionsCounted($bill));
$bill->status = ($bill->transactions_count > 0) ? 'partial' : 'received';
unset($bill->transactions_count);
$bill->save();

View File

@ -209,7 +209,7 @@ class Installer
'DB_PORT' => $port,
'DB_DATABASE' => $database,
'DB_USERNAME' => $username,
'DB_PASSWORD' => $password,
'DB_PASSWORD' => '"' . $password . '"',
'DB_PREFIX' => $prefix,
]);

View File

@ -42,7 +42,7 @@
"laravel/ui": "^2.0",
"laravelcollective/html": "6.1.*",
"league/omnipay": "3.0.*",
"lorisleiva/laravel-search-string": "0.1.*",
"lorisleiva/laravel-search-string": "1.0.*",
"maatwebsite/excel": "3.1.*",
"misterphilip/maintenance-mode": "2.0.*",
"monooso/unobserve": "^2.0",

1015
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -10,15 +10,15 @@ return [
'minor' => '0',
'patch' => '20',
'patch' => '21',
'build' => '',
'status' => 'Stable',
'date' => '27-August-2020',
'date' => '04-September-2020',
'time' => '11:00',
'time' => '14:00',
'zone' => 'GMT +3',

12
public/css/custom.css vendored
View File

@ -255,10 +255,10 @@ tbody .row {
/*--------Table Body Row Margin Finish--------*/
/*--------Table Cell Text Wrap--------*/
.el-table td,
.el-table th,
.table td,
.table th {
#reconciliations-table .el-table td,
#reconciliations-table .el-table th,
#reconciliations-table .table td,
#reconciliations-table .table th {
white-space: normal;
}
/*--------Table Cell Text Wrap Finish--------*/
@ -825,3 +825,7 @@ table .align-items-center td span.badge {
.form-group.has-error .el-input__inner {
border-color: #ef3232 !important;
}
.form-group .custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")
}

View File

@ -65,7 +65,7 @@ export default {
},
initial_index: {
type: Number,
default: 1,
default: 0,
description: "index of the initially active slide (starting from 0)"
},
trigger: {

View File

@ -980,6 +980,10 @@ export default {
}
this.$emit('interface', this.real_model);
setTimeout(function() {
this.change();
}.bind(this), 800);
},
methods: {
@ -1218,6 +1222,8 @@ export default {
} else {
this.real_model = value.toString();
}
this.change();
},
model: function (value) {
@ -1226,6 +1232,8 @@ export default {
} else {
this.real_model = value.toString();
}
this.change();
}
},
}

View File

@ -616,6 +616,10 @@ export default {
}
this.$emit('interface', this.real_model);
setTimeout(function() {
this.change();
}.bind(this), 800);
},
methods: {

View File

@ -32,6 +32,10 @@ const app = new Vue({
methods: {
onChangeCategory(category) {
if (!category.length) {
return;
}
let path = document.getElementById('category_page').value;
if (category != '*') {

View File

@ -61,6 +61,10 @@ const app = new Vue({
methods: {
onChangeCategory(category) {
if (!category.length) {
return;
}
let path = document.getElementById('category_page').value;
if (category != '*') {

View File

@ -46,6 +46,7 @@ const app = new Vue({
edit: {
status: false,
currency: false,
items: false,
},
}
},
@ -54,6 +55,7 @@ const app = new Vue({
if ((document.getElementById('items') != null) && (document.getElementById('items').rows)) {
this.colspan = document.getElementById("items").rows[0].cells.length - 1;
}
this.form.items = [];
if (this.form.method) {
@ -92,6 +94,10 @@ const app = new Vue({
methods: {
onChangeContact(contact_id) {
if (!contact_id) {
return;
}
if (this.edit.status && !this.edit.currency) {
this.edit.currency = true;
@ -226,7 +232,7 @@ const app = new Vue({
// set global total variable.
this.totals.sub = sub_total;
this.totals.tax = tax_total;
this.totals.tax = Math.abs(tax_total);
this.totals.item_discount = line_item_discount_total;
// Apply discount to total
@ -285,6 +291,12 @@ const app = new Vue({
},
onSelectItem(item, index) {
if (this.edit.status && !this.edit.items) {
this.edit.items = true;
return;
}
let tax_id = (item.tax_id) ? [item.tax_id.toString()] : '';
this.form.items[index].item_id = item.id;

View File

@ -46,6 +46,7 @@ const app = new Vue({
edit: {
status: false,
currency: false,
items: false,
},
}
},
@ -93,6 +94,10 @@ const app = new Vue({
methods: {
onChangeContact(contact_id) {
if (!contact_id) {
return;
}
if (this.edit.status && !this.edit.currency) {
this.edit.currency = true;
@ -286,6 +291,12 @@ const app = new Vue({
},
onSelectItem(item, index) {
if (this.edit.status && !this.edit.items) {
this.edit.items = true;
return;
}
let tax_id = (item.tax_id) ? [item.tax_id.toString()] : '';
this.form.items[index].item_id = item.id;

View File

@ -52,7 +52,7 @@ return [
'marked_received' => 'Regning markeret som modtaget',
'marked_paid' => 'Regning markeret som betalt',
'marked_cancelled' => 'Regning markeret som annulleret',
'draft' => 'Dette er et <b>UDKAST</b> til faktura og vil blive afspejlet i diagrammer, når den bliver modtaget.',
'draft' => 'Dette er et <b>UDKAST</b> til faktura og vil først blive vist i oversigten, når den er afsendt.',
'status' => [
'created' => 'Oprettet den :date',

View File

@ -7,7 +7,7 @@ return [
'incomes' => 'Indkomst|Indkomster',
'invoices' => 'Faktura|Fakturaer',
'revenues' => 'Indtægt|Indtægter',
'customers' => 'Kunde|Kunder',
'customers' => 'Medlem|Medlemmer',
'expenses' => 'Udgift|Udgifter',
'bills' => 'Regning|Regninger',
'payments' => 'Betaling|Betalinger',
@ -195,7 +195,7 @@ return [
'invoices' => 'Faktura kan være engang eller gentagne. Du kan sende dem til kunder og begynde at modtage onlinebetaling.',
'revenues' => 'Omsætning er en betalt indtægts-transaktion. Det kan være en uafhængig post (ei. deponering) eller tilføjet til en faktura.',
'customers' => 'Kunder er obligatorisk hvis du vil oprette en faktura. De kan også logge ind i klientportalen og se deres balance.',
'bills' => 'Regninger kan være engang eller gentagne. De indikerer at du skylder leverandører for produkter eller services du har købt.',
'bills' => 'Regninger kan være en-gangs eller gentagne. De indikerer at du skylder leverandører for produkter eller services du har købt.',
'payments' => 'Betaling er en betalt udgiftstransaktion. Det kan være en uafhængig post (ie. kassebon) eller tilføjet til en regning.',
'vendors' => 'Leverandører er obligatorisk hvis du vil oprette en regning. Du kan se balancen og filtrere reporten efter leverandør.',
'transfers' => 'Overførsel tillader dig at flytte penge fra en konto til en anden, uanset om du bruger samme valuta eller ej.',

View File

@ -59,7 +59,7 @@ return [
'marked_viewed' => 'Faktura markeret som set!',
'marked_cancelled' => 'Faktura markeret som annulleret!',
'email_required' => 'Ingen E-mail-adresse for kunden!',
'draft' => 'Dette er et <b>UDKAST</b> til faktura og vil blive vist som diagrammer, når det bliver sendt.',
'draft' => 'Dette er et <b>UDKAST</b> til faktura og vil først blive vist i oversigten, når den er sendt.',
'status' => [
'created' => 'Oprettet den :date',

View File

@ -3,6 +3,7 @@
return [
'reconcile' => 'Afstemme',
'unreconcile' => 'Uafsem',
'reconciled' => 'Afstemt',
'opening_balance' => 'Åbningsbalance',
'closing_balance' => 'Primo saldo',

View File

@ -67,7 +67,7 @@ return [
'default' => [
'description' => 'Standard konto, valuta og sprog',
'list_limit' => 'Poster pr side',
'use_gravatar' => 'Brug Gravatar',
'use_gravatar' => 'Brug standard-ikoner (Gravatar)',
],
'email' => [

View File

@ -16,6 +16,8 @@ return [
'sent' => 'Sind Sie sicher das Sie die ausgewählte Rechnung als <b>versendet</b> markieren möchten?|Sind Sie sicher das Sie die ausgewählten Rechnungen als <b>versendet</b> markieren möchten?',
'received' => 'Sind Sie sicher das Sie die ausgewählte Rechnung als <b>empfangen</b> markieren möchten?|Sind Sie sicher das Sie die ausgewählten Rechnungen als <b>empfangen</b> markieren möchten?',
'cancelled' => 'Sind Sie sicher das Sie die ausgewählte Rechnung <b>stornieren</b> möchten?|Sind Sie sicher das Sie die ausgewählten Rechnungen <b>stornieren</b> möchten?',
'reconcile' => 'Sind Sie sicher das Sie den ausgewählten Datensatz <b>abgleichen</b> möchten?|Sind Sie sicher das Sie die ausgewählten Datensätze <b>abgleichen</b> möchten?',
'unreconcile' => 'Sind Sie sicher das Sie den ausgewählten Datensatz <b>nicht abgleichen</b> möchten?|Sind Sie sicher das Sie die ausgewählten Datensätze <b>nicht abgleichen</b> möchten?',
],
];

View File

@ -3,7 +3,9 @@
return [
'reconcile' => 'Abstimmen',
'unreconcile' => 'Nicht abgeglichen',
'reconciled' => 'Abgeglichen',
'opening_balance' => 'Eröffnungssaldo',
'closing_balance' => 'Endsaldo',
'unreconciled' => 'Nicht abgeglichen',
'transactions' => 'Transaktionen',

View File

@ -3,7 +3,7 @@
return [
'dashboards' => 'Tableau de bord|Tableaux de bord',
'items' => 'Marchandise|Marchandises',
'items' => 'Article|Articles',
'incomes' => 'Revenu|Revenus',
'invoices' => 'Facture|Factures',
'revenues' => 'Recettes|Chiffre daffaires',
@ -40,7 +40,7 @@ return [
'statuses' => 'Statut | Statuts',
'others' => 'Autre|Autres',
'contacts' => 'Contact|Contacts',
'reconciliations' => 'Conciliation|Conciliations',
'reconciliations' => 'Réconciliation|Réconciliations',
'developers' => 'Développeur|Développeurs',
'schedules' => 'Planification|Planifications',
'groups' => 'Groupe|Groupes',

View File

@ -3,7 +3,9 @@
return [
'reconcile' => 'मेल-मिलाप',
'unreconcile' => 'असंतुष्ट',
'reconciled' => 'मेल मिलाप',
'opening_balance' => 'प्रारंभिक बैलेंस',
'closing_balance' => 'समाप्ति के समय बैलेंस',
'unreconciled' => 'असंतुष्ट',
'transactions' => 'लेन-देन',

View File

@ -33,7 +33,7 @@
{!! Form::close() !!}
</div>
<div class="card">
<div id="reconciliations-table" class="card">
<div class="card-header border-0">
<h3 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h3>
</div>

View File

@ -3,7 +3,7 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.reconciliations', 1)]))
@section('content')
<div class="card">
<div id="reconciliations-table" class="card">
{!! Form::model($reconciliation, [
'id' => 'reconciliation',
'method' => 'PATCH',

View File

@ -34,31 +34,27 @@
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 d-none d-sm-block">@sortablelink('paid_at', trans('general.date'))</th>
<th class="col-xs-4 col-sm-3 col-md-2">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-xs-4 col-sm-3 col-md-2">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-sm-2 col-md-2 d-none d-sm-block">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-xs-4 col-sm-3 col-md-2">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-md-2 d-none d-md-block">@sortablelink('description', trans('general.description'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1 tr-py">
<td class="col-sm-2 col-md-2 d-none d-sm-block">@date($item->paid_at)</td>
<td class="col-xs-4 col-sm-3 col-md-2">{{ $item->account->name }}</td>
<td class="col-xs-4 col-sm-3 col-md-2">{{ $item->type_title }}</td>
<td class="col-sm-2 col-md-2 d-none d-sm-block">{{ $item->category->name }}</td>
<td class="col-md-2 d-none d-md-block long-texts">{{ $item->description }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 text-right">
@php
$id = !empty($item->document_id) ? $item->document_id : $item->id;
$route = ($item->type == 'income') ? (!empty($item->document_id) ? 'invoices.show' : 'revenues.edit') : (!empty($item->document_id) ? 'bills.show' : 'payments.edit');
@endphp
<a href="{{ route($route, $id) }}">
@money($item->amount, $item->currency_code, true)
<td class="col-sm-2 col-md-2 d-none d-sm-block">
<a href="{{ route($item->route_name, $item->route_id) }}">
@date($item->paid_at)
</a>
</td>
<td class="col-xs-4 col-sm-2 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-xs-4 col-sm-3 col-md-2">{{ $item->type_title }}</td>
<td class="col-sm-2 col-md-2 d-none d-sm-block">{{ $item->category->name }}</td>
<td class="col-xs-4 col-sm-3 col-md-2">{{ $item->account->name }}</td>
<td class="col-md-2 d-none d-md-block long-texts">{{ $item->description }}</td>
</tr>
@endforeach
</tbody>

View File

@ -1,6 +1,6 @@
@stack($name . '_input_start')
<label class="custom-toggle">
<label class="custom-toggle d-inline-block">
<input type="checkbox"
name="status[{{ $id }}]"
@input="onStatus({{ $id }}, $event)"

View File

@ -37,7 +37,7 @@
@endif
@endpermission
<a href="{{ rotue('uploads.download', $file->id) }}" type="button" class="btn btn-sm btn-info text-white header-button-top">
<a href="{{ route('uploads.download', $file->id) }}" type="button" class="btn btn-sm btn-info text-white header-button-top">
<i class="fas fa-file-download"></i>
</a>
</div>

View File

@ -36,11 +36,11 @@
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1">@sortablelink('paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1">@sortablelink('paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2 col-lg-2 col-xl-4 d-none d-md-block text-left">@sortablelink('contact.name', trans_choice('general.vendors', 1))</th>
<th class="col-md-2 col-lg-3 col-xl-3 d-none d-md-block text-left">@sortablelink('contact.name', trans_choice('general.vendors', 1))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-lg-2 col-xl-1 d-none d-lg-block text-left">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
</tr>
</thead>
@ -50,12 +50,12 @@
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->contact->name) }}</td>
@if ($item->reconciled)
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1"><a class="col-aka" href="#">@date($item->paid_at)</a></td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1"><a class="col-aka" href="#">@date($item->paid_at)</a></td>
@else
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1"><a class="col-aka" href="{{ route('payments.edit', $item->id) }}">@date($item->paid_at)</a></td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1"><a class="col-aka" href="{{ route('payments.edit', $item->id) }}">@date($item->paid_at)</a></td>
@endif
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-2 col-xl-4 d-none d-md-block text-left">
<td class="col-md-2 col-lg-3 col-xl-3 d-none d-md-block text-left">
{{ $item->contact->name }}
@if($item->bill)
@ -81,7 +81,7 @@
@endif
</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">{{ $item->category->name }}</td>
<td class="col-lg-2 col-xl-1 d-none d-lg-block text-left">{{ $item->account->name }}</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">{{ $item->account->name }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

View File

@ -36,11 +36,10 @@
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-2">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-2 col-lg-2 col-xl-3 d-none d-md-block">@sortablelink('email', trans('general.email'))</th>
<th class="col-sm-3 col-md-2 col-lg-2 col-xl-2 d-none d-sm-block">@sortablelink('phone', trans('general.phone'))</th>
<th class="col-lg-2 col-xl-2 text-right d-none d-lg-block">@sortablelink('unpaid', trans('general.unpaid'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-3 col-md-4 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-3 col-lg-3 col-xl-3 d-none d-md-block">@sortablelink('email', trans('general.email'))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-right">@sortablelink('unpaid', trans('general.unpaid'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-2 text-center">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
@ -51,26 +50,27 @@
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">
{{ Form::bulkActionGroup($item->id, $item->name) }}
</td>
<td class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-2">
<td class="col-xs-4 col-sm-3 col-md-4 col-lg-3 col-xl-3">
<a class="col-aka" href="{{ route('vendors.show', $item->id) }}">{{ $item->name }}</a>
</td>
<td class="col-md-2 col-lg-2 col-xl-3 d-none d-md-block long-texts">
{{ !empty($item->email) ? $item->email : trans('general.na') }}
<td class="col-md-3 col-lg-3 col-xl-3 d-none d-md-block long-texts">
<el-tooltip content="{{ !empty($item->phone) ? $item->phone : trans('general.na') }}"
effect="dark"
placement="top">
<span>{{ !empty($item->email) ? $item->email : trans('general.na') }}</span>
</el-tooltip>
</td>
<td class="col-sm-3 col-md-2 col-lg-2 col-xl-2 d-none d-sm-block long-texts">
{{ $item->phone }}
</td>
<td class="col-lg-2 col-xl-2 text-right d-none d-lg-block long-texts">
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-right long-texts">
@money($item->unpaid, setting('default.currency'), true)
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-2 text-center">
@if (user()->can('update-purchases-vendors'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
<badge rounded type="success" class="mw-60 d-inline-block">{{ trans('general.yes') }}</badge>
@else
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
<badge rounded type="danger" class="mw-60 d-inline-block">{{ trans('general.no') }}</badge>
@endif
@endif
</td>

View File

@ -36,11 +36,10 @@
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-2">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-2 col-lg-2 col-xl-3 d-none d-md-block text-left">@sortablelink('email', trans('general.email'))</th>
<th class="col-sm-3 col-md-2 col-lg-2 col-xl-2 d-none d-sm-block text-left">@sortablelink('phone', trans('general.phone'))</th>
<th class="col-xs-4 col-sm-3 col-md-4 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-3 col-lg-3 col-xl-3 d-none d-md-block">@sortablelink('email', trans('general.email'))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-right">@sortablelink('unpaid', trans('general.unpaid'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-2 text-center">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
@ -51,26 +50,27 @@
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">
{{ Form::bulkActionGroup($item->id, $item->name) }}
</td>
<td class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-2">
<td class="col-xs-4 col-sm-3 col-md-4 col-lg-3 col-xl-3">
<a class="col-aka" href="{{ route('customers.show', $item->id) }}">{{ $item->name }}</a>
</td>
<td class="col-md-2 col-lg-2 col-xl-3 d-none d-md-block long-texts text-left">
{{ !empty($item->email) ? $item->email : trans('general.na') }}
<td class="col-md-3 col-lg-3 col-xl-3 d-none d-md-block long-texts">
<el-tooltip content="{{ !empty($item->phone) ? $item->phone : trans('general.na') }}"
effect="dark"
placement="top">
<span>{{ !empty($item->email) ? $item->email : trans('general.na') }}</span>
</el-tooltip>
</td>
<td class="col-sm-3 col-md-2 col-lg-2 col-xl-2 d-none d-sm-block long-texts text-left">
{{ $item->phone }}
</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block long-texts text-right">
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-right long-texts">
@money($item->unpaid, setting('default.currency'), true)
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-2 text-center">
@if (user()->can('update-sales-customers'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
<badge rounded type="success" class="mw-60 d-inline-block">{{ trans('general.yes') }}</badge>
@else
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
<badge rounded type="danger" class="mw-60 d-inline-block">{{ trans('general.no') }}</badge>
@endif
@endif
</td>

View File

@ -36,9 +36,9 @@
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-md-2 col-lg-2 col-xl-1 d-none d-md-block">@sortablelink('invoice_number', trans_choice('general.numbers', 1), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-4 col-lg-2 col-xl-3 text-left">@sortablelink('contact_name', trans_choice('general.customers', 1))</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2 col-lg-1 col-xl-1 d-none d-md-block">@sortablelink('invoice_number', trans_choice('general.numbers', 1), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-4 col-lg-2 col-xl-2 text-left">@sortablelink('contact_name', trans_choice('general.customers', 1))</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('due_at', trans('invoices.due_date'))</th>
<th class="col-lg-1 col-xl-1 d-none d-lg-block text-center">@sortablelink('status', trans_choice('general.statuses', 1))</th>
@ -51,9 +51,9 @@
@php $paid = $item->paid; @endphp
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->invoice_number) }}</td>
<td class="col-md-2 col-lg-2 col-xl-1 d-none d-md-block"><a class="col-aka" href="{{ route('invoices.show' , $item->id) }}">{{ $item->invoice_number }}</a></td>
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-2 col-xl-3 text-left">{{ $item->contact_name }}</td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-1 col-xl-1 d-none d-md-block"><a class="col-aka" href="{{ route('invoices.show' , $item->id) }}">{{ $item->invoice_number }}</a></td>
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-2 col-xl-2 text-left">{{ $item->contact_name }}</td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@date($item->invoiced_at)</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@date($item->due_at)</td>
<td class="col-lg-1 col-xl-1 d-none d-lg-block text-center">

View File

@ -36,11 +36,11 @@
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1">@sortablelink('paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1">@sortablelink('paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2 col-lg-2 col-xl-4 d-none d-md-block text-left">@sortablelink('contact.name', trans_choice('general.customers', 1))</th>
<th class="col-md-2 col-lg-3 col-xl-3 d-none d-md-block text-left">@sortablelink('contact.name', trans_choice('general.customers', 1))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-lg-2 col-xl-1 d-none d-lg-block text-left">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
</tr>
</thead>
@ -55,7 +55,7 @@
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1"><a class="col-aka" href="{{ route('revenues.edit', $item->id) }}">@date($item->paid_at)</a></td>
@endif
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-2 col-xl-4 d-none d-md-block text-left">
<td class="col-md-2 col-lg-3 col-xl-3 d-none d-md-block text-left">
{{ $item->contact->name }}
@if($item->invoice)
@ -81,7 +81,7 @@
@endif
</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">{{ $item->category->name }}</td>
<td class="col-lg-2 col-xl-1 d-none d-lg-block text-left">{{ $item->account->name }}</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">{{ $item->account->name }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

View File

@ -23,7 +23,7 @@
{{ Form::textGroup('rate', trans('currencies.rate'), 'sliders-h', ['@input' => 'onChangeRate', 'required' => 'required']) }}
{{ Form::selectGroup('precision', trans('currencies.precision'), 'dot-circle', $precisions) }}
{{ Form::selectGroup('precision', trans('currencies.precision'), 'dot-circle', $precisions, null, ['model' => 'form.precision']) }}
{{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font') }}

View File

@ -24,7 +24,7 @@
{{ Form::textGroup('rate', trans('currencies.rate'), 'sliders-h', ['@input' => 'onChangeRate', 'required' => 'required']) }}
{{ Form::selectGroup('precision', trans('currencies.precision'), 'dot-circle', $precisions, $currency->precision) }}
{{ Form::selectGroup('precision', trans('currencies.precision'), 'dot-circle', $precisions, $currency->precision, ['model' => 'form.precision']) }}
{{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font') }}