Compare commits
134 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c343b4b92 | ||
|
|
a60cac3e66 | ||
|
|
6a0d3a3bcc | ||
|
|
3e52b84fa8 | ||
|
|
d1f45a790b | ||
|
|
bec0c058a8 | ||
|
|
d862ee05e9 | ||
|
|
12d9d6c801 | ||
|
|
e9e52c60a7 | ||
|
|
34b9f52af7 | ||
|
|
fcf64c0b26 | ||
|
|
7e2d257f7d | ||
|
|
c617f7d169 | ||
|
|
1804481fc6 | ||
|
|
9bed81fe8f | ||
|
|
f52b73f517 | ||
|
|
32e03b98a3 | ||
|
|
3f560a1de2 | ||
|
|
ef9adbd6c9 | ||
|
|
969cbe9ad8 | ||
|
|
6031f0dbdd | ||
|
|
06a71fc7b3 | ||
|
|
fd1c7be1f8 | ||
|
|
c466d51fe0 | ||
|
|
e8dccb178b | ||
|
|
f5b36d7e6c | ||
|
|
a32bbb6268 | ||
|
|
9599814ae5 | ||
|
|
0d14da93d0 | ||
|
|
298c170867 | ||
|
|
b49228eabf | ||
|
|
99ada6fbcc | ||
|
|
ed4a59574c | ||
|
|
be2e1df442 | ||
|
|
ddca5a7b6d | ||
|
|
51d001aa0f | ||
|
|
5d817b5c45 | ||
|
|
ac2c73829c | ||
|
|
317f763a85 | ||
|
|
e112ed5875 | ||
|
|
84c10264ed | ||
|
|
b143642056 | ||
|
|
967c225df9 | ||
|
|
e1a0a2d8e4 | ||
|
|
748168ffa5 | ||
|
|
4db243e136 | ||
|
|
bc0c8d5348 | ||
|
|
6583569b1c | ||
|
|
134c99369e | ||
|
|
f2ae4e17c8 | ||
|
|
4ff62c0adf | ||
|
|
2604db32ce | ||
|
|
01d32d50b5 | ||
|
|
0c86563375 | ||
|
|
33c2949a7b | ||
|
|
547a2be0a3 | ||
|
|
59b43fa258 | ||
|
|
168b741936 | ||
|
|
022769ba38 | ||
|
|
068f48568e | ||
|
|
03b9defeb1 | ||
|
|
dd98df1c77 | ||
|
|
c8c75a6aa7 | ||
|
|
5ece0f43c0 | ||
|
|
91962f43b2 | ||
|
|
50613fcff0 | ||
|
|
468aec6bc1 | ||
|
|
c799149d2d | ||
|
|
c9e85f18da | ||
|
|
9a46f892ab | ||
|
|
bcb89bc9ae | ||
|
|
fbac9abbc5 | ||
|
|
f16b4df44a | ||
|
|
f82937e85e | ||
|
|
f10154539e | ||
|
|
a64701bda5 | ||
|
|
da600d0144 | ||
|
|
56a555bc4a | ||
|
|
6422da193b | ||
|
|
cc39f37b12 | ||
|
|
f95d03f281 | ||
|
|
4b9052079f | ||
|
|
bf5f95d29d | ||
|
|
53343c64eb | ||
|
|
dfc4b1982e | ||
|
|
8dd9d0c414 | ||
|
|
84a6181240 | ||
|
|
25fb260cd7 | ||
|
|
17082ea8c8 | ||
|
|
c4ade42a8f | ||
|
|
314abe4cc6 | ||
|
|
45ff9c89a8 | ||
|
|
9df5b306a2 | ||
|
|
310d05eab1 | ||
|
|
f986454084 | ||
|
|
0c0de64549 | ||
|
|
19bf467068 | ||
|
|
532a044bb9 | ||
|
|
948e9ea814 | ||
|
|
1bd33b8b1b | ||
|
|
b06cc46eaf | ||
|
|
c8439d859d | ||
|
|
a866187f71 | ||
|
|
e212714c63 | ||
|
|
429a8ae826 | ||
|
|
94cfe55555 | ||
|
|
ad9d08c43c | ||
|
|
27a511bc09 | ||
|
|
1317d57ef8 | ||
|
|
ba85f407d6 | ||
|
|
b37019f845 | ||
|
|
75b0c264dc | ||
|
|
98852686c7 | ||
|
|
a907f8c932 | ||
|
|
53866f721c | ||
|
|
9c0d79bf59 | ||
|
|
33076dc240 | ||
|
|
de126465a8 | ||
|
|
9317751de9 | ||
|
|
24ba33fd02 | ||
|
|
9fcf3792c7 | ||
|
|
2c9f81c571 | ||
|
|
0af379909d | ||
|
|
680e105f1b | ||
|
|
210f735e40 | ||
|
|
a0bf6f7f59 | ||
|
|
bb8258036a | ||
|
|
14c599ed4f | ||
|
|
592a537379 | ||
|
|
bf5a8cdb28 | ||
|
|
96e2f6cf0f | ||
|
|
3b61440e1f | ||
|
|
3259173066 | ||
|
|
72311db1bd |
175
.dev/README.md
Normal file
175
.dev/README.md
Normal file
@@ -0,0 +1,175 @@
|
||||
# InvoiceShelf Development Environment
|
||||
|
||||
This is dockerized development environment that allows developers to easily get started to develop InvoiceShelf.
|
||||
|
||||
This development environment is **NOT MEANT TO BE USED IN PRODUCTION** and is preconfigured with all the needed tools that InvoiceShelf requires for development purposes. It works on Windows, Linux and MacOS.
|
||||
|
||||
For production grade docker image, please refer to [InvoiceShelf/docker](https://github.com/InvoiceShelf/docker) and [InvoiceShelf on DockerHub](https://hub.docker.com/r/invoiceshelf/invoiceshelf).
|
||||
|
||||
## How to set up
|
||||
|
||||
### 1. Hosts configuration
|
||||
|
||||
We use `invoiceshelf.test` domain for local development within this environment and you need to adhere to it.
|
||||
|
||||
For that purpose you need to edit your OS hosts file or DNS server and add the following line to make the local domain name available on your system.
|
||||
|
||||
```
|
||||
127.0.0.1 invoiceshelf.test
|
||||
```
|
||||
|
||||
#### 1.1. Windows
|
||||
|
||||
The hosts file on Windows is located at `C:\Windows\system32\drivers\etc\hosts`.
|
||||
|
||||
You need to launch Notepad as administrator, open the file through **File > Open**, add the line from above and save the file.
|
||||
|
||||
#### 1.2. Linux/MacOS
|
||||
|
||||
The hosts file on Linux and Mac is located at `/etc/hosts`.
|
||||
|
||||
You need to open the file using your favorite editor as sudo/root, add the line from above and save the file.
|
||||
|
||||
### 2. FileSystem configuration (Linux)
|
||||
|
||||
If you are using **Linux**, you need to make sure that **USRID** and **GRPID** environment variables are set and matching your current session user ids. Those two variables are required to set up the filesystem permissions correctly on Linux.
|
||||
|
||||
You can run it one time, every time before starting as follows:
|
||||
|
||||
```
|
||||
export USRID=$(id -u) && export GRPID=$(id -g)
|
||||
```
|
||||
|
||||
or you can append this to your .zshrc/.bashrc by running this command in your terminal:
|
||||
|
||||
```
|
||||
grep -qxF 'export USRID=$(id -u) GRPID=$(id -g)' ~/.${SHELL##*/}rc || echo 'export USRID=$(id -u) GRPID=$(id -g)' >> ~/.${SHELL##*/}rc
|
||||
```
|
||||
this will append the `export` line to your rc file and run it on each terminal session.
|
||||
|
||||
### 3. Clone the project
|
||||
|
||||
Clone the InvoiceShelf project directly from InvoiceShelf git or your forked repository:
|
||||
|
||||
```bash
|
||||
git clone git@github.com:InvoiceShelf/InvoiceShelf.git
|
||||
```
|
||||
|
||||
## Development Workflow
|
||||
|
||||
We bundled separate docker-compose.yml file for each database: MySQL, PostgresSQL and SQLite, you can use any of those to spin up your development environment.
|
||||
|
||||
| Database | Compose File |
|
||||
|---------|---------------------------|
|
||||
| SQLite3 | docker-compose.sqlite.yml |
|
||||
| MariaDB | docker-compose.mysql.yml |
|
||||
| PostgresSQL | dpcler-compose.pgsql.yml |
|
||||
|
||||
### 1. Spinning Up
|
||||
|
||||
To **spin up** the environment, run docker compose as follows:
|
||||
|
||||
**Important**: If you are on **Linux** and didn't add the `export` line to your .zshrc/.bashrc file, you need to repeat `step 2` before spinning up, otherwise you will face permissions issues.
|
||||
|
||||
```
|
||||
docker compose -f .dev/docker-compose.mysql.yml up --build
|
||||
```
|
||||
|
||||
### 2. Spinning Down
|
||||
|
||||
To **spin down** the environment, run docker compose as follows:
|
||||
|
||||
```
|
||||
docker compose -f .dev/docker-compose.mysql.yml down
|
||||
```
|
||||
|
||||
### 3. Working with binaries
|
||||
|
||||
To correctly run `composer`, `npm`, `artisan`, `pint`, `pest` or other binaries within this project, you must ssh into the container as follows:
|
||||
|
||||
```
|
||||
docker exec -it --user invoiceshelf invoiceshelf-dev-php /bin/bash
|
||||
```
|
||||
|
||||
In the `/home/invoiceshelf/app` directory you can find the application root and run the commands from there.
|
||||
|
||||
## What is included
|
||||
|
||||
### 1. Web Server
|
||||
|
||||
This dockerized environment uses PHP-FPM and NGINX together to serve the website `invoiceshelf.test`
|
||||
|
||||
Both NGINX and PHP-FPM are configured with optimal settings for development. Please don't use this in production.
|
||||
|
||||
**URL**: http://invoiceshelf.test/
|
||||
|
||||
### 2. Databases
|
||||
|
||||
This dockerized environment comes with support for all three databases that InvoiceShelf suppots: MySQL, PostgreSQL and SQLite.
|
||||
|
||||
The setup parameters/credentials for each of the supported databases are as follows.
|
||||
|
||||
| | MySQL | PostgreSQL | SQLite |
|
||||
|---|---|---|---|
|
||||
| **DB_USER** | invoiceshelf | invoiceshelf | Not applicable |
|
||||
| **DB_PASS** | invoiceshelf | invoiceshelf | Not applicable |
|
||||
| **DB_NAME** | invoiceshelf | invoiceshelf | /home/invoiceshelf/database/database.sqlite |
|
||||
| **DB_HOST** | db-mysql | db-pgsql | Not applicable |
|
||||
| **DB_PORT** | 3036 | 5432 | Not applicable |
|
||||
|
||||
**Note:** The only required field for SQLite is **DB_NAME**.
|
||||
|
||||
### 3. Adminer
|
||||
|
||||
Adminer is UI tool for viewing the database contents and executing queries.
|
||||
|
||||
It supports MySQL, PostgreSQL, SQLite.
|
||||
|
||||
**URL**: http://invoiceshelf.test:8080
|
||||
|
||||
#### MySQL/PostgresSQL
|
||||
|
||||
To log into the MySQL or PostgresSQL, use the database information specified in the above section (2. Databases)
|
||||
|
||||
#### SQLite
|
||||
|
||||
To log into the SQLite, use the following credentials:
|
||||
|
||||
| KEY | VALUE |
|
||||
|--------------|---------------------------|
|
||||
| **USERNAME** | admin |
|
||||
| **PASSWORD** | admin |
|
||||
| **DATABASE** | /database/database.sqlite |
|
||||
|
||||
|
||||
### 4. Mailpit (fake mail)
|
||||
|
||||
To utilize Mailpit, use the following credentials:
|
||||
|
||||
| KEY | VALUE |
|
||||
|---------------------|-------------|
|
||||
| **MAIL DRIVER** | smtp |
|
||||
| **MAIL HOST** | mail |
|
||||
| **MAIL PORT** | 1025 |
|
||||
| **MAIL ENCRYPTION** | none |
|
||||
| **MAIL USER** | leave empty |
|
||||
| **MAIL PASS** | leave empty |
|
||||
| **FROM MAIL ADDR** | your choice |
|
||||
| **FROM MAIL NAME** | your choice |
|
||||
|
||||
|
||||
**URL**: http://invoiceshelf.test:8025
|
||||
|
||||
---
|
||||
|
||||
If you have any questions, feel free to open issue.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
14
.dev/adminer/Dockerfile
Normal file
14
.dev/adminer/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM adminer:latest
|
||||
|
||||
USER root
|
||||
|
||||
RUN set -x && \
|
||||
apt update && \
|
||||
apt install curl -y && \
|
||||
cd /var/www/html/plugins-enabled && \
|
||||
curl -O https://gist.githubusercontent.com/gdarko/00af6e9a754f09c3f81cd3c606c33311/raw/d5f6a30f00edecf30a5d380340d9dae79a3b7352/login-password-less.php
|
||||
|
||||
USER adminer
|
||||
CMD [ "php", "-S", "[::]:8080", "-t", "/var/www/html" ]
|
||||
|
||||
EXPOSE 8080
|
||||
70
.dev/docker-compose.mysql.yml
Normal file
70
.dev/docker-compose.mysql.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
services:
|
||||
php-fpm:
|
||||
container_name: invoiceshelf-dev-php
|
||||
build:
|
||||
context: ./php
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- UID=${USRID:-1000}
|
||||
- GID=${GRPID:-1000}
|
||||
ports:
|
||||
- 5173:5173
|
||||
volumes:
|
||||
- ../:/home/invoiceshelf/app
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
nginx:
|
||||
container_name: invoiceshelf-dev-nginx
|
||||
image: nginx:stable
|
||||
ports:
|
||||
- '80:80'
|
||||
volumes:
|
||||
- ./nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
|
||||
- ../:/home/invoiceshelf/app
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
db:
|
||||
image: mariadb:10.9
|
||||
container_name: invoiceshelf-dev-mysql
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: invoiceshelf
|
||||
MYSQL_DATABASE: invoiceshelf
|
||||
MYSQL_USER: invoiceshelf
|
||||
MYSQL_PASSWORD: invoiceshelf
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- invoiceshelf-dev-mysql:/var/lib/mysql
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
adminer:
|
||||
container_name: invoiceshelf-dev-adminer
|
||||
build:
|
||||
context: ./adminer
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
ADMINER_PLUGINS: tables-filter
|
||||
ADMINER_DESIGN: konya
|
||||
ports:
|
||||
- '8080:8080'
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
mail:
|
||||
container_name: invoiceshelf-dev-mailpit
|
||||
image: axllent/mailpit:latest
|
||||
restart: always
|
||||
ports:
|
||||
- 1025:1025
|
||||
- 8025:8025
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
networks:
|
||||
invoiceshelf-dev:
|
||||
|
||||
volumes:
|
||||
invoiceshelf-dev-mysql:
|
||||
69
.dev/docker-compose.pgsql.yml
Normal file
69
.dev/docker-compose.pgsql.yml
Normal file
@@ -0,0 +1,69 @@
|
||||
services:
|
||||
php-fpm:
|
||||
container_name: invoiceshelf-dev-php
|
||||
build:
|
||||
context: ./php
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- UID=${USRID:-1000}
|
||||
- GID=${GRPID:-1000}
|
||||
ports:
|
||||
- 5173:5173
|
||||
volumes:
|
||||
- ../:/home/invoiceshelf/app
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
nginx:
|
||||
container_name: invoiceshelf-dev-nginx
|
||||
image: nginx:stable
|
||||
ports:
|
||||
- '80:80'
|
||||
volumes:
|
||||
- ./nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
|
||||
- ../:/home/invoiceshelf/app
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
db:
|
||||
image: postgres:15
|
||||
container_name: invoiceshelf-dev-pgsql
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=invoiceshelf
|
||||
- POSTGRES_USER=invoiceshelf
|
||||
- POSTGRES_DB=invoiceshelf
|
||||
ports:
|
||||
- 5432:5432
|
||||
volumes:
|
||||
- invoiceshelf-dev-pgsql:/var/lib/postgresql/data
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
adminer:
|
||||
container_name: invoiceshelf-dev-adminer
|
||||
build:
|
||||
context: ./adminer
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
ADMINER_PLUGINS: tables-filter
|
||||
ADMINER_DESIGN: konya
|
||||
ports:
|
||||
- '8080:8080'
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
mail:
|
||||
container_name: invoiceshelf-dev-mailpit
|
||||
image: axllent/mailpit:latest
|
||||
restart: always
|
||||
ports:
|
||||
- 1025:1025
|
||||
- 8025:8025
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
networks:
|
||||
invoiceshelf-dev:
|
||||
|
||||
volumes:
|
||||
invoiceshelf-dev-pgsql:
|
||||
54
.dev/docker-compose.sqlite.yml
Normal file
54
.dev/docker-compose.sqlite.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
services:
|
||||
php-fpm:
|
||||
container_name: invoiceshelf-dev-php
|
||||
build:
|
||||
context: ./php
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- UID=${USRID:-1000}
|
||||
- GID=${GRPID:-1000}
|
||||
volumes:
|
||||
- ../:/home/invoiceshelf/app
|
||||
ports:
|
||||
- 5173:5173
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
nginx:
|
||||
container_name: invoiceshelf-dev-nginx
|
||||
image: nginx:stable
|
||||
ports:
|
||||
- '80:80'
|
||||
volumes:
|
||||
- ./nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
|
||||
- ../:/home/invoiceshelf/app
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
adminer:
|
||||
container_name: invoiceshelf-dev-adminer
|
||||
build:
|
||||
context: ./adminer
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
ADMINER_PLUGINS: tables-filter
|
||||
ADMINER_DESIGN: konya
|
||||
volumes:
|
||||
- ../database:/database
|
||||
ports:
|
||||
- '8080:8080'
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
mail:
|
||||
container_name: invoiceshelf-dev-mailpit
|
||||
image: axllent/mailpit:latest
|
||||
restart: always
|
||||
ports:
|
||||
- 1025:1025
|
||||
- 8025:8025
|
||||
networks:
|
||||
- invoiceshelf-dev
|
||||
|
||||
networks:
|
||||
invoiceshelf-dev:
|
||||
22
.dev/nginx/conf.d/dev.conf
Normal file
22
.dev/nginx/conf.d/dev.conf
Normal file
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
root /home/invoiceshelf/app/public;
|
||||
index index.php;
|
||||
|
||||
error_log /var/log/nginx/dev-error.log;
|
||||
access_log /var/log/nginx/dev-access.log;
|
||||
|
||||
server_name invoiceshelf.test;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php-fpm:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
64
.dev/php/Dockerfile
Normal file
64
.dev/php/Dockerfile
Normal file
@@ -0,0 +1,64 @@
|
||||
FROM php:8.3-fpm-bookworm
|
||||
|
||||
ARG UID
|
||||
ARG GID
|
||||
|
||||
ENV UID=${UID}
|
||||
ENV GID=${GID}
|
||||
|
||||
USER root
|
||||
|
||||
# Create user/group
|
||||
RUN addgroup --gid ${GID} --system invoiceshelf && \
|
||||
adduser --gid ${GID} --system --disabled-password --shell /bin/sh -u ${UID} --home /home/invoiceshelf invoiceshelf && \
|
||||
sed -i "s/user = www-data/user = invoiceshelf/g" /usr/local/etc/php-fpm.d/www.conf && \
|
||||
sed -i "s/group = www-data/group = invoiceshelf/g" /usr/local/etc/php-fpm.d/www.conf
|
||||
|
||||
# Install composer & npm
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
|
||||
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||
apt install -y nodejs
|
||||
|
||||
# install dependencies
|
||||
RUN apt update && apt install -y \
|
||||
libpng-dev \
|
||||
zlib1g-dev \
|
||||
libxml2-dev \
|
||||
libzip-dev \
|
||||
libonig-dev \
|
||||
libpq-dev \
|
||||
sqlite3 \
|
||||
postgresql-client \
|
||||
mariadb-client \
|
||||
zip \
|
||||
curl \
|
||||
unzip \
|
||||
webp \
|
||||
&& docker-php-ext-configure gd \
|
||||
&& docker-php-ext-install -j$(nproc) gd \
|
||||
&& docker-php-ext-install bcmath \
|
||||
&& docker-php-ext-install mbstring \
|
||||
&& docker-php-ext-install mysqli \
|
||||
&& docker-php-ext-install pdo_mysql \
|
||||
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
|
||||
&& docker-php-ext-install pgsql \
|
||||
&& docker-php-ext-install pdo_pgsql \
|
||||
&& docker-php-ext-install zip \
|
||||
&& docker-php-ext-install xml \
|
||||
&& docker-php-ext-install exif \
|
||||
&& docker-php-source delete
|
||||
|
||||
# Clear cache
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set workdir
|
||||
WORKDIR /home/invoiceshelf/app
|
||||
|
||||
# Copy Files
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
# Entrypoint
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
# Launch php-fpm
|
||||
CMD ["php-fpm"]
|
||||
44
.dev/php/entrypoint.sh
Executable file
44
.dev/php/entrypoint.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "############################################"
|
||||
echo "### InvoiceShelf Development Environment ###"
|
||||
echo "############################################"
|
||||
|
||||
cd /home/invoiceshelf/app
|
||||
|
||||
|
||||
# Composer build
|
||||
if [ ! -d vendor ]; then
|
||||
composer install
|
||||
fi
|
||||
|
||||
# Empty sqlite database
|
||||
if [ ! -f database/database.sqlite ]; then
|
||||
cp database/stubs/sqlite.empty.db database/database.sqlite
|
||||
fi
|
||||
|
||||
# .env file set up
|
||||
if [ ! -f .env ]; then
|
||||
cp .env.example .env
|
||||
php artisan key:generate --force
|
||||
fi
|
||||
|
||||
# NPM build
|
||||
if [ ! -d node_modules ]; then
|
||||
npm install
|
||||
npm run build
|
||||
fi
|
||||
|
||||
# Storage symlink
|
||||
php artisan storage:link
|
||||
|
||||
# Permissions
|
||||
chmod 775 storage/framework
|
||||
chmod 775 storage/logs
|
||||
chmod 775 bootstrap/cache
|
||||
chown -R ${UID}:${GID} /home/invoiceshelf/app
|
||||
chmod +x artisan
|
||||
|
||||
echo "Entrypoint complete."
|
||||
|
||||
exec $@
|
||||
1974
.dev/php/php.ini
Normal file
1974
.dev/php/php.ini
Normal file
File diff suppressed because it is too large
Load Diff
37
.env.example
37
.env.example
@@ -1,21 +1,35 @@
|
||||
APP_ENV=production
|
||||
APP_KEY=base64:kgk/4DW1vEVy7aEvet5FPp5un6PIGe/so8H0mvoUtW0=
|
||||
APP_DEBUG=true
|
||||
APP_NAME="InvoiceShelf"
|
||||
APP_LOG_LEVEL=debug
|
||||
APP_TIMEZONE=UTC
|
||||
APP_URL=http://invoiceshelf.test
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=db
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=invoiceshelf
|
||||
DB_USERNAME=invoiceshelf
|
||||
DB_PASSWORD="invoiceshelf"
|
||||
APP_LOCALE=en
|
||||
APP_FALLBACK_LOCALE=en
|
||||
APP_FAKER_LOCALE=en_US
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
QUEUE_DRIVER=sync
|
||||
SESSION_DRIVER=cookie
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
APP_MAINTENANCE_STORE=database
|
||||
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
DB_CONNECTION=sqlite
|
||||
DB_HOST=
|
||||
DB_PORT=
|
||||
DB_DATABASE=
|
||||
DB_USERNAME=
|
||||
DB_PASSWORD=
|
||||
|
||||
BROADCAST_CONNECTION=log
|
||||
CACHE_STORE=file
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=1440
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
@@ -36,8 +50,7 @@ PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
|
||||
SANCTUM_STATEFUL_DOMAINS=invoiceshelf.test
|
||||
SESSION_DOMAIN=invoiceshelf.test
|
||||
|
||||
TRUSTED_PROXIES="*"
|
||||
|
||||
CRON_JOB_AUTH_TOKEN=""
|
||||
LOG_STACK=single
|
||||
|
||||
24
.gitattributes
vendored
24
.gitattributes
vendored
@@ -1,3 +1,25 @@
|
||||
* text=auto
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text eol=lf
|
||||
|
||||
# Explicitly declare text files you want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.c text
|
||||
*.h text
|
||||
|
||||
# Declare files that will always have CRLF line endings on checkout.
|
||||
*.sln text eol=crlf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.gif binary
|
||||
*.otf binary
|
||||
*.eot binary
|
||||
*.svg binary
|
||||
*.ttf binary
|
||||
*.woff binary
|
||||
*.woff2 binary
|
||||
|
||||
*.css linguist-vendored
|
||||
*.scss linguist-vendored
|
||||
*.js linguist-vendored
|
||||
65
.github/CONTRIBUTING.md
vendored
Normal file
65
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
# Welcome to InvoiceShelf contributing guide <!-- omit in toc -->
|
||||
|
||||
Thank you for investing your time in contributing to our project! :sparkles:.
|
||||
|
||||
Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable.
|
||||
|
||||
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
|
||||
|
||||
## New contributor guide
|
||||
|
||||
To get an overview of the project, read the [README](../README.md) file. Here are some resources to help you get started with open source contributions:
|
||||
|
||||
- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
|
||||
- [Set up Git](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git)
|
||||
- [GitHub flow](https://docs.github.com/en/get-started/using-github/github-flow)
|
||||
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
|
||||
|
||||
## Getting started
|
||||
|
||||
### Issues
|
||||
|
||||
#### Create a new issue
|
||||
|
||||
If you spot a problem, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/InvoiceShelf/InvoiceShelf/issues/new/choose).
|
||||
|
||||
#### Solve an issue
|
||||
|
||||
Scan through our [existing issues](https://github.com/InvoiceShelf/InvoiceShelf/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See "[Label reference](https://docs.github.com/en/contributing/collaborating-on-github-docs/label-reference)" for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix.
|
||||
|
||||
### Make Changes
|
||||
|
||||
#### Make changes locally
|
||||
|
||||
1. Fork the repository.
|
||||
- Using GitHub Desktop:
|
||||
- [Getting started with GitHub Desktop](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop) will guide you through setting up Desktop.
|
||||
- Once Desktop is set up, you can use it to [fork the repo](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)!
|
||||
|
||||
- Using the command line:
|
||||
- [Fork the repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo) so that you can make your changes without affecting the original project until you're ready to merge them.
|
||||
|
||||
2. Install or update to **Node.js**, at the version specified in `.node-version`. For more information, see [the development guide](../contributing/development.md).
|
||||
|
||||
3. Create a working branch and start with your changes!
|
||||
|
||||
### Commit your update
|
||||
|
||||
Commit the changes once you are happy with them. Don't forget to use the "[Self review checklist](https://docs.github.com/en/contributing/collaborating-on-github-docs/self-review-checklist)" to speed up the review process :zap:.
|
||||
|
||||
### Pull Request
|
||||
|
||||
When you're finished with the changes, create a pull request, also known as a PR.
|
||||
- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request.
|
||||
- Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
|
||||
- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge.
|
||||
Once you submit your PR, a project maintainer will review your proposal. We may ask questions or request additional information.
|
||||
- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
|
||||
- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations).
|
||||
- If you run into any merge issues, check out this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.
|
||||
|
||||
### Your PR is merged!
|
||||
|
||||
Congratulations :tada::tada: The InvoiceShelf team thanks you :sparkles:.
|
||||
|
||||
Once your PR is merged, your contributions will be publicly visible on the [InvoiceShelf repository](https://github.com/InvoiceShelf/InvoiceShelf).
|
||||
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,26 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Please complete the following information:**
|
||||
- InvoiceShelf version:
|
||||
- PHP version:
|
||||
- Database type and version:
|
||||
|
||||
**Optional info**
|
||||
- OS: [e.g. Ubuntu]
|
||||
- Browser: [e.g. chrome, safari]
|
||||
202
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
202
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
name: Bug report
|
||||
description: Template for bug reports
|
||||
labels:
|
||||
- bug
|
||||
- triage
|
||||
projects: ["InvoiceShelf/2"]
|
||||
assignees:
|
||||
- rihards-simanovics
|
||||
|
||||
body:
|
||||
# Ask user to confirm they've tried to fix or research the issue before
|
||||
# posting a bug report.
|
||||
- type: checkboxes
|
||||
id: confirm-read-documentation
|
||||
attributes:
|
||||
label: Issue filing pre-requisites
|
||||
description: "Prior to filing an issue please confirm that:"
|
||||
options:
|
||||
- label: I've checked the documentation.
|
||||
required: true
|
||||
- label: I've looked for similar issues both Open and Closed.
|
||||
required: true
|
||||
- label: >-
|
||||
Ive tried clearing both cache and cookies in my browser or tried
|
||||
opening the app in the Incognito/InPrivate window.
|
||||
required: true
|
||||
|
||||
# Thank users for taking time to submit a bug report
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >-
|
||||
If you did all of the above, we first would like to thank you for taking
|
||||
the time to fill out this bug report, it will help us tremendously to
|
||||
find and fix the issue sooner!
|
||||
|
||||
# Description fo the bug
|
||||
- type: textarea
|
||||
id: bug-description
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of what the bug is.
|
||||
placeholder: >-
|
||||
When doing `x`, `y`, and `z` in that order, an error occurs, but when x,
|
||||
z and then y is done, the error does not occur.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Reproduction steps
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Steps to Reproduce the issue
|
||||
description: A clear step-by-step explanation of how to reproduce your issue
|
||||
placeholder: >-
|
||||
## Produces an error:
|
||||
1. Do X;
|
||||
2. Do Y;
|
||||
3. Do Z;
|
||||
|
||||
## Works fine:
|
||||
4. Do X;
|
||||
5. Do Z;
|
||||
6. Do Y.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Expected Behaviour
|
||||
- type: textarea
|
||||
id: expected-behavior
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
placeholder: doing `x`, `y`, and `z` in that order should not generate an error.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Actual Behaviour
|
||||
- type: textarea
|
||||
id: actual-behavior
|
||||
attributes:
|
||||
label: Actual behavior
|
||||
description: A clear and concise description of what actually happen.
|
||||
placeholder: doing `x`, `y`, and `z` in that order generate an error.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Section break
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |-
|
||||
## Envirment
|
||||
|
||||
Now lets collect some information about your environment.
|
||||
|
||||
# App Version
|
||||
- type: input
|
||||
id: invoiceshelf-version
|
||||
attributes:
|
||||
label: InvoiceShelf version
|
||||
placeholder: v0.0.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# PHP Version
|
||||
- type: input
|
||||
id: php-version
|
||||
attributes:
|
||||
label: PHP version
|
||||
placeholder: v0.0.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# DB Type
|
||||
- type: input
|
||||
id: database-type
|
||||
attributes:
|
||||
label: Database type
|
||||
placeholder: MariaDB / MySQL / PostreSQL / SQLite
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# DB Version
|
||||
- type: input
|
||||
id: db-version
|
||||
attributes:
|
||||
label: Database version
|
||||
placeholder: v0.0.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Web Browser
|
||||
- type: input
|
||||
id: web-browser
|
||||
attributes:
|
||||
label: Web Browser
|
||||
placeholder: "Firefox / Safari / or any other (chromium based browser)"
|
||||
|
||||
# OS Version
|
||||
- type: input
|
||||
id: server-os
|
||||
attributes:
|
||||
label: Server OS
|
||||
description: If Linux please make sure to provide both distro name and it's version
|
||||
placeholder: Windows / Linux (e.g. Ubuntu 24.04)
|
||||
|
||||
# Associated Logs
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >-
|
||||
## Logs
|
||||
|
||||
|
||||
last but not least, could you please take some time to get us the logs
|
||||
for:
|
||||
|
||||
# Log Reverse proxy
|
||||
- type: textarea
|
||||
id: log-rev-proxy
|
||||
attributes:
|
||||
label: Reverse-proxy logs
|
||||
description: >-
|
||||
Please provide logs from your Apache, Nginx, Traefik, or any other
|
||||
reverse proxy application.
|
||||
placeholder: >-
|
||||
[2015-02-04 10:00:00] production.INFO: Laravel 5.0 released. The world rejoices.
|
||||
[2015-12-03 12:00:00] production.INFO: PHP 7.0 introduced scalar type declarations. Minds blown.
|
||||
[2016-05-15 14:00:00] production.INFO: Composer installed new dependencies. Dependency hell avoided.
|
||||
[2017-08-20 16:00:00] production.INFO: Artisan command executed: migrate. Smooth sailing.
|
||||
[2018-01-10 09:00:00] production.INFO: User login successful.
|
||||
[2018-01-10 09:05:00] production.ERROR: Database connection failed. Did you try turning it off and on again?
|
||||
[2018-01-10 09:10:00] production.WARNING: Deprecated function used in UserController.php. Time to refactor, again.
|
||||
[2018-01-10 09:15:00] production.ERROR: Uncaught Exception: Division by zero. Oops, math is hard.
|
||||
[2018-01-10 09:20:00] production.INFO: User logout successful. See you later, alligator.
|
||||
[2019-03-25 11:00:00] production.INFO: Cache cleared. Fresh start!
|
||||
[2019-06-30 13:00:00] production.ERROR: Syntax error. Missing semicolon strikes again.
|
||||
[2020-09-10 15:00:00] production.INFO: User registered. Welcome aboard!
|
||||
[2021-11-05 17:00:00] production.WARNING: Low disk space. Time to clean up.
|
||||
[2022-12-20 19:00:00] production.INFO: Server rebooted. All systems go.
|
||||
[2024-11-14 18:56:20] production.INFO: Unexpected item in the bagging area. Please wait for assistance.
|
||||
render: irc logs
|
||||
|
||||
# PHP/Laravel Logs
|
||||
- type: textarea
|
||||
id: log-laravel
|
||||
attributes:
|
||||
label: Laravel/PHP logs
|
||||
description: Please provide logs from either PHP or Laravel or both.
|
||||
placeholder: >-
|
||||
2023-04-12 10:15:32 [NGINX] 172.16.0.5 - - [12/Apr/2023:10:15:32 +0000] "GET /index.html HTTP/1.1" 200 1024 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
|
||||
2023-04-12 10:15:33 [NGINX] 172.16.0.7 - - [12/Apr/2023:10:15:33 +0000] "POST /login HTTP/1.1" 302 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8"
|
||||
2023-04-12 10:15:34 [NGINX] 172.16.0.9 - - [12/Apr/2023:10:15:34 +0000] "GET /about HTTP/1.1" 200 2048 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
|
||||
2023-04-12 10:15:35 [NGINX] 172.16.0.11 - - [12/Apr/2023:10:15:35 +0000] "PUT /api/v1/users/123 HTTP/1.1" 200 - "https://example.com/profile" "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"
|
||||
2023-04-12 10:15:36 [NGINX] 172.16.0.13 - - [12/Apr/2023:10:15:36 +0000] "DELETE /api/v1/products/456 HTTP/1.1" 204 - "-" "Dalvik/2.1.0 (Linux; U; Android 10; Pixel 4 Build/QD1A.190821.014.C2)"
|
||||
2023-04-12 10:15:37 [NGINX] 172.16.0.15 - - [12/Apr/2023:10:15:37 +0000] "GET /easter-egg HTTP/1.1" 200 42 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.3"
|
||||
render: irc logs
|
||||
|
||||
# Special thanks
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >-
|
||||
This template was generated with [Issue Forms
|
||||
Creator](https://issue-forms-creator.netlify.app)
|
||||
73
.github/ISSUE_TEMPLATE/code_quality_issue.yml
vendored
Normal file
73
.github/ISSUE_TEMPLATE/code_quality_issue.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# Big thanks to https://github.com/files-community/Files/ for a template of the code_quality_issue
|
||||
|
||||
name: Code Quality Issue
|
||||
description: Create a code quality issue to help InvoiceShelf keep a clean codebase
|
||||
labels:
|
||||
- code quality
|
||||
- triage
|
||||
projects: ["InvoiceShelf/2"]
|
||||
assignees:
|
||||
- rihards-simanovics
|
||||
|
||||
body:
|
||||
# Tip to warn of checking for existing issues
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
> [!TIP]
|
||||
|
||||
> Have you checked for similar code quality issues? There's a
|
||||
possibility your suggestion is already being tracked. Please do a
|
||||
thorough search before creating a new issue.
|
||||
|
||||
# Issue body
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: A clear and concise description of what the code quality issue is.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Related code
|
||||
- type: textarea
|
||||
id: code-in-question
|
||||
attributes:
|
||||
label: The code in question
|
||||
description: >-
|
||||
A list of the different InvoiceShelf and/or areas of the code concerned by the issue.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Gains
|
||||
- type: textarea
|
||||
id: gains
|
||||
attributes:
|
||||
label: Gains
|
||||
description: What would fixing this code quality issue bring to the source code?
|
||||
value: |
|
||||
- eg. A better readability.
|
||||
- eg. Uncoupling concepts X and Y.
|
||||
- eg. Clarifying the responsibility of class C.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Requirements
|
||||
- type: textarea
|
||||
id: requirements
|
||||
attributes:
|
||||
label: Requirements
|
||||
description: Describe all the requirements to solve the code quality issue.
|
||||
value: |
|
||||
- eg. Using a specific design pattern.
|
||||
- eg. Separating Interface I into three new interfaces I1, I2 and I3.
|
||||
- eg. Regrouping the duplicated process into a new helper.
|
||||
|
||||
# Remarks
|
||||
- type: textarea
|
||||
id: comments
|
||||
attributes:
|
||||
label: Comments
|
||||
description: >-
|
||||
Additional information, comments or screenshots about the code quality
|
||||
issue.
|
||||
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Documentation
|
||||
url: https://docs.invoiceshelf.com/
|
||||
about: App documentation.
|
||||
- name: Translation issue
|
||||
url: https://crowdin.com/project/invoiceshelf
|
||||
about: Help improve translations on Crowdin.
|
||||
- name: Question & Discussion
|
||||
url: https://discord.gg/hwg2FtwWHW
|
||||
about: Post your questions and join the discussion. You can participate in chats on every channel.
|
||||
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,17 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
74
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
74
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
# Big thanks to https://github.com/files-community/Files/ for a template of the feature_request
|
||||
|
||||
name: Feature Request
|
||||
labels:
|
||||
- feature request
|
||||
- triage
|
||||
projects: ["InvoiceShelf/2"]
|
||||
assignees:
|
||||
- rihards-simanovics
|
||||
description: >-
|
||||
This project thrives from differentiation from competing apps. Suggest an idea
|
||||
for InvoiceShelf.
|
||||
body:
|
||||
# Tip to warn of checking for existing issues
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
> [!TIP]
|
||||
|
||||
>Have you checked for similar feature requests? There's a possibility
|
||||
your suggestion is already being tracked. Please do a thorough search
|
||||
before creating a new issue.
|
||||
|
||||
# Description
|
||||
- type: textarea
|
||||
id: what-feature
|
||||
attributes:
|
||||
label: What feature or improvement do you think would benefit InvoiceShelf?
|
||||
description: Please include your use case
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Tooltip about Requirements
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
---
|
||||
|
||||
|
||||
Please include a list changes required to make this improvement. A good
|
||||
rule of thumb is to start your proposal with no more than 7 high-level
|
||||
requirements.
|
||||
|
||||
# Requirements
|
||||
- type: textarea
|
||||
id: requirements
|
||||
attributes:
|
||||
label: Requirements
|
||||
description: Describe all the requirements to make your idea happen.
|
||||
value: |
|
||||
- This proposal will accomplish X
|
||||
- This proposal will accomplish Y
|
||||
- This proposal will accomplish Z
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# InvoiceShelf Version
|
||||
- type: input
|
||||
id: invoiceshelf_version
|
||||
attributes:
|
||||
label: App Version
|
||||
description: Which version of InvoiceShelf are you using?
|
||||
placeholder: v0.0.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
# Additional Comments
|
||||
- type: textarea
|
||||
id: comments
|
||||
attributes:
|
||||
label: Comments
|
||||
description: >-
|
||||
Additional information, comments or screenshots about the feature
|
||||
request.
|
||||
4
.github/workflows/check.yaml
vendored
4
.github/workflows/check.yaml
vendored
@@ -7,11 +7,15 @@ on:
|
||||
- '**/*.md'
|
||||
- 'public/build/*.js'
|
||||
- 'public/build/**/*.js'
|
||||
branches-ignore:
|
||||
- 'translations'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**/*.md'
|
||||
- 'public/build/*.js'
|
||||
- 'public/build/**/*.js'
|
||||
branches-ignore:
|
||||
- 'translations'
|
||||
# Allow manually triggering the workflow.
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -22,3 +22,5 @@ Homestead.yaml
|
||||
.php-cs-fixer.cache
|
||||
/storage/fonts*
|
||||
package-lock.json
|
||||
/.dev/docker-compose.yml
|
||||
/.dev/docker-compose.yaml
|
||||
|
||||
3
Makefile
3
Makefile
@@ -29,14 +29,15 @@ dist-gen: clean composer npm-build
|
||||
@cp -r routes InvoiceShelf
|
||||
@cp -r storage InvoiceShelf
|
||||
@cp -r vendor InvoiceShelf 2> /dev/null || true
|
||||
@cp -r version.md InvoiceShelf
|
||||
@cp -r .env.example InvoiceShelf
|
||||
@cp -r artisan InvoiceShelf
|
||||
@cp -r composer.json InvoiceShelf
|
||||
@cp -r composer.lock InvoiceShelf
|
||||
@cp -r server.php InvoiceShelf
|
||||
@cp -r LICENSE InvoiceShelf
|
||||
@cp -r readme.md InvoiceShelf
|
||||
@cp -r SECURITY.md InvoiceShelf
|
||||
@cp -r server.php InvoiceShelf
|
||||
@touch InvoiceShelf/storage/logs/laravel.log
|
||||
|
||||
dist-clean: dist-gen
|
||||
|
||||
27208
_ide_helper.php
27208
_ide_helper.php
File diff suppressed because it is too large
Load Diff
1629
_ide_helper_models.php
Normal file
1629
_ide_helper_models.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Bouncer\Scopes;
|
||||
namespace App\Bouncer\Scopes;
|
||||
|
||||
use Silber\Bouncer\Database\Scope\Scope;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Console\Commands;
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Estimate;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
|
||||
class CheckEstimateStatus extends Command
|
||||
{
|
||||
@@ -37,7 +37,7 @@ class CheckEstimateStatus extends Command
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$date = Carbon::now();
|
||||
$status = [Estimate::STATUS_ACCEPTED, Estimate::STATUS_REJECTED, Estimate::STATUS_EXPIRED];
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Console\Commands;
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Invoice;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
|
||||
class CheckInvoiceStatus extends Command
|
||||
{
|
||||
@@ -37,7 +37,7 @@ class CheckInvoiceStatus extends Command
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$date = Carbon::now();
|
||||
$invoices = Invoice::whereNotIn('status', [Invoice::STATUS_COMPLETED, Invoice::STATUS_DRAFT])
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Console\Commands;
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Space\PdfTemplateUtils;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CreateTemplateCommand extends Command
|
||||
{
|
||||
@@ -33,32 +36,57 @@ class CreateTemplateCommand extends Command
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): int
|
||||
{
|
||||
$templateName = $this->argument('name');
|
||||
$type = $this->option('type');
|
||||
$templateType = $this->option('type');
|
||||
|
||||
if (! $type) {
|
||||
$type = $this->choice('Create a template for?', ['invoice', 'estimate']);
|
||||
if (! $templateType) {
|
||||
$templateType = $this->choice('Create a template for?', ['invoice', 'estimate']);
|
||||
}
|
||||
|
||||
if (Storage::disk('views')->exists("/app/pdf/{$type}/{$templateName}.blade.php")) {
|
||||
if (PdfTemplateUtils::customTemplateFileExists($templateType, sprintf('%s.blade.php', $templateName))) {
|
||||
$this->info('Template with given name already exists.');
|
||||
|
||||
return 0;
|
||||
return self::INVALID;
|
||||
}
|
||||
|
||||
Storage::disk('views')->copy("/app/pdf/{$type}/{$type}1.blade.php", "/app/pdf/{$type}/{$templateName}.blade.php");
|
||||
copy(public_path("/build/img/PDF/{$type}1.png"), public_path("/build/img/PDF/{$templateName}.png"));
|
||||
copy(resource_path("/static/img/PDF/{$type}1.png"), resource_path("/static/img/PDF/{$templateName}.png"));
|
||||
if (! PdfTemplateUtils::toCustomTemplateMarkupFile(
|
||||
Str::replace(
|
||||
sprintf('app.pdf.%s', $templateType),
|
||||
sprintf('pdf_templates::%s', $templateType),
|
||||
Storage::disk('views')->get("/app/pdf/{$templateType}/{$templateType}1.blade.php"),
|
||||
),
|
||||
$templateType,
|
||||
$templateName
|
||||
)) {
|
||||
$this->error(sprintf('Unable to create %s template.', ucfirst($templateType)));
|
||||
|
||||
$path = resource_path("views/app/pdf/{$type}/{$templateName}.blade.php");
|
||||
$type = ucfirst($type);
|
||||
$this->info("{$type} Template created successfully at ".$path);
|
||||
return self::FAILURE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
PdfTemplateUtils::toCustomTemplateImageFile(
|
||||
File::get(resource_path("static/img/PDF/{$templateType}1.png")),
|
||||
$templateType,
|
||||
$templateName,
|
||||
);
|
||||
|
||||
if (! PdfTemplateUtils::customTemplateFileExists($templateType, 'partials/table.blade.php')) {
|
||||
PdfTemplateUtils::toCustomTemplateFile(
|
||||
Storage::disk('views')->get("/app/pdf/{$templateType}/partials/table.blade.php"),
|
||||
$templateType,
|
||||
'partials/table.blade.php'
|
||||
);
|
||||
}
|
||||
|
||||
$this->info(
|
||||
sprintf('%s Template created successfully at %s',
|
||||
ucfirst($templateType),
|
||||
PdfTemplateUtils::getCustomTemplateFilePath($templateType, sprintf('%s.blade.php', $templateName))
|
||||
)
|
||||
);
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Console\Commands;
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Space\ModuleInstaller;
|
||||
use Illuminate\Console\Command;
|
||||
use InvoiceShelf\Space\ModuleInstaller;
|
||||
|
||||
class InstallModuleCommand extends Command
|
||||
{
|
||||
@@ -33,10 +33,8 @@ class InstallModuleCommand extends Command
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): int
|
||||
{
|
||||
ModuleInstaller::complete($this->argument('module'), $this->argument('version'));
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Console\Commands;
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Console\ConfirmableTrait;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
use function Laravel\Prompts\confirm;
|
||||
|
||||
class ResetApp extends Command
|
||||
{
|
||||
use ConfirmableTrait;
|
||||
@@ -39,30 +41,49 @@ class ResetApp extends Command
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
/**
|
||||
* Execute the console command to reset the application.
|
||||
*
|
||||
* This will:
|
||||
* 1. Enable maintenance mode to prevent access during reset
|
||||
* 2. Fresh migrate the database with initial seeds
|
||||
* 3. Seed demo data using DemoSeeder
|
||||
* 4. Clear all application caches
|
||||
* 5. Disable maintenance mode
|
||||
*
|
||||
* The --force flag can be used to skip confirmation prompt.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
if (! $this->confirmToProceed()) {
|
||||
return;
|
||||
|
||||
if (! $this->option('force')) {
|
||||
if (! confirm('Are you sure you want to reset the application?')) {
|
||||
$this->components->error('Reset cancelled');
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Running migrate:fresh');
|
||||
// Enable maintenance mode to prevent access during reset
|
||||
$this->info('Activating maintenance mode...');
|
||||
Artisan::call('down');
|
||||
|
||||
// Fresh migrate database and run initial seeds
|
||||
$this->info('Running migrate:fresh');
|
||||
Artisan::call('migrate:fresh --seed --force');
|
||||
|
||||
// Seed demo data
|
||||
$this->info('Seeding database');
|
||||
|
||||
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
|
||||
|
||||
$path = base_path('.env');
|
||||
// Clear all application caches
|
||||
$this->info('Clearing cache...');
|
||||
Artisan::call('optimize:clear');
|
||||
|
||||
if (file_exists($path)) {
|
||||
file_put_contents($path, str_replace(
|
||||
'APP_DEBUG=true',
|
||||
'APP_DEBUG=false',
|
||||
file_get_contents($path)
|
||||
));
|
||||
}
|
||||
// Disable maintenance mode
|
||||
$this->info('Deactivating maintenance mode...');
|
||||
Artisan::call('up');
|
||||
|
||||
$this->info('App has been reset successfully');
|
||||
$this->info('App reset completed successfully!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Console\Commands;
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Setting;
|
||||
use App\Space\Updater;
|
||||
use Illuminate\Console\Command;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use InvoiceShelf\Space\Updater;
|
||||
|
||||
// Implementation taken from Akaunting - https://github.com/akaunting/akaunting
|
||||
class UpdateCommand extends Command
|
||||
@@ -42,7 +42,7 @@ class UpdateCommand extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
set_time_limit(3600); // 1 hour
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\RecurringInvoice;
|
||||
use InvoiceShelf\Space\InstallUtils;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
Commands\ResetApp::class,
|
||||
Commands\UpdateCommand::class,
|
||||
Commands\CreateTemplateCommand::class,
|
||||
Commands\InstallModuleCommand::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
if (InstallUtils::isDbCreated()) {
|
||||
$schedule->command('check:invoices:status')
|
||||
->daily();
|
||||
|
||||
$schedule->command('check:estimates:status')
|
||||
->daily();
|
||||
|
||||
$recurringInvoices = RecurringInvoice::where('status', 'ACTIVE')->get();
|
||||
foreach ($recurringInvoices as $recurringInvoice) {
|
||||
$timeZone = CompanySetting::getSetting('time_zone', $recurringInvoice->company_id);
|
||||
|
||||
$schedule->call(function () use ($recurringInvoice) {
|
||||
$recurringInvoice->generateInvoice();
|
||||
})->cron($recurringInvoice->frequency)->timezone($timeZone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Closure based commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Events;
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Events;
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Events;
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Events;
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of the exception types that are not reported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* A list of the inputs that are never flashed for validation exceptions.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontFlash = [
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
* Report or log an exception.
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function report(Throwable $exception)
|
||||
{
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Throwable $exception)
|
||||
{
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Generators;
|
||||
namespace App\Generators;
|
||||
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use App\Models\Estimate;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
||||
use Spatie\MediaLibrary\Support\PathGenerator\PathGenerator;
|
||||
|
||||
|
||||
@@ -1,23 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class AppVersionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
$version = Setting::getSetting('version');
|
||||
|
||||
$channel = Setting::getSetting('updater_channel');
|
||||
if (is_null($channel)) {
|
||||
$channel = 'stable';
|
||||
Setting::setSetting('updater_channel', 'stable'); // default.
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'version' => $version,
|
||||
'channel' => $channel,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests;
|
||||
use DispatchesJobs;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
|
||||
namespace App\Http\Controllers\V1\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\AppServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Providers\RouteServiceProvider;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
@@ -26,7 +26,7 @@ class ConfirmPasswordController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = AppServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
|
||||
namespace App\Http\Controllers\V1\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
|
||||
namespace App\Http\Controllers\V1\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\AppServiceProvider;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Providers\RouteServiceProvider;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
@@ -26,7 +26,7 @@ class LoginController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = AppServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
|
||||
namespace App\Http\Controllers\V1\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use App\Providers\AppServiceProvider;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\User;
|
||||
use InvoiceShelf\Providers\RouteServiceProvider;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
@@ -28,7 +28,7 @@ class RegisterController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = AppServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
|
||||
namespace App\Http\Controllers\V1\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\AppServiceProvider;
|
||||
use Illuminate\Auth\Events\PasswordReset;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Providers\RouteServiceProvider;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
@@ -29,7 +29,7 @@ class ResetPasswordController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = AppServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Get the response for a successful password reset.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
|
||||
namespace App\Http\Controllers\V1\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\AppServiceProvider;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Providers\RouteServiceProvider;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
@@ -26,7 +26,7 @@ class VerificationController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = AppServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
// Implementation taken from nova-backup-tool - https://github.com/spatie/nova-backup-tool/
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Backup;
|
||||
namespace App\Http\Controllers\V1\Admin\Backup;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
|
||||
class ApiController extends Controller
|
||||
{
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
// Implementation taken from nova-backup-tool - https://github.com/spatie/nova-backup-tool/
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Backup;
|
||||
namespace App\Http\Controllers\V1\Admin\Backup;
|
||||
|
||||
use App\Jobs\CreateBackupJob;
|
||||
use App\Rules\Backup\PathToZip;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use InvoiceShelf\Jobs\CreateBackupJob;
|
||||
use InvoiceShelf\Rules\Backup\PathToZip;
|
||||
use Spatie\Backup\BackupDestination\Backup;
|
||||
use Spatie\Backup\BackupDestination\BackupDestination;
|
||||
use Spatie\Backup\Helpers\Format;
|
||||
@@ -80,7 +80,7 @@ class BackupsController extends ApiController
|
||||
$this->authorize('manage backups');
|
||||
|
||||
$validated = $request->validate([
|
||||
'path' => ['required', new PathToZip()],
|
||||
'path' => ['required', new PathToZip],
|
||||
]);
|
||||
|
||||
$backupDestination = BackupDestination::create(config('filesystems.default'), config('backup.backup.name'));
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
// Implementation taken from nova-backup-tool - https://github.com/spatie/nova-backup-tool/
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Backup;
|
||||
namespace App\Http\Controllers\V1\Admin\Backup;
|
||||
|
||||
use App\Rules\Backup\PathToZip;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Rules\Backup\PathToZip;
|
||||
use Spatie\Backup\BackupDestination\Backup;
|
||||
use Spatie\Backup\BackupDestination\BackupDestination;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -18,7 +18,7 @@ class DownloadBackupController extends ApiController
|
||||
$this->authorize('manage backups');
|
||||
|
||||
$validated = $request->validate([
|
||||
'path' => ['required', new PathToZip()],
|
||||
'path' => ['required', new PathToZip],
|
||||
]);
|
||||
|
||||
$backupDestination = BackupDestination::create(config('filesystems.default'), config('backup.backup.name'));
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Company;
|
||||
namespace App\Http\Controllers\V1\Admin\Company;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\CompaniesRequest;
|
||||
use App\Http\Resources\CompanyResource;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\CompaniesRequest;
|
||||
use InvoiceShelf\Http\Resources\CompanyResource;
|
||||
use InvoiceShelf\Models\Company;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Silber\Bouncer\BouncerFacade;
|
||||
use Vinkla\Hashids\Facades\Hashids;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Company;
|
||||
namespace App\Http\Controllers\V1\Admin\Company;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\CompanyResource;
|
||||
use App\Models\Company;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Resources\CompanyResource;
|
||||
use InvoiceShelf\Models\Company;
|
||||
|
||||
class CompanyController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Config;
|
||||
namespace App\Http\Controllers\V1\Admin\Config;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
|
||||
class FiscalYearsController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Config;
|
||||
namespace App\Http\Controllers\V1\Admin\Config;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
|
||||
class LanguagesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Config;
|
||||
namespace App\Http\Controllers\V1\Admin\Config;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
|
||||
class RetrospectiveEditsController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\CustomField;
|
||||
namespace App\Http\Controllers\V1\Admin\CustomField;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\CustomFieldRequest;
|
||||
use App\Http\Resources\CustomFieldResource;
|
||||
use App\Models\CustomField;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\CustomFieldRequest;
|
||||
use InvoiceShelf\Http\Resources\CustomFieldResource;
|
||||
use InvoiceShelf\Models\CustomField;
|
||||
|
||||
class CustomFieldsController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Customer;
|
||||
namespace App\Http\Controllers\V1\Admin\Customer;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\CustomerResource;
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\Customer;
|
||||
use App\Models\Expense;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Resources\CustomerResource;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Expense;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
|
||||
class CustomerStatsController extends Controller
|
||||
{
|
||||
@@ -35,15 +35,16 @@ class CustomerStatsController extends Controller
|
||||
$start = Carbon::now();
|
||||
$end = Carbon::now();
|
||||
$terms = explode('-', $fiscalYear);
|
||||
$companyStartMonth = intval($terms[0]);
|
||||
|
||||
if ($terms[0] <= $start->month) {
|
||||
$startDate->month($terms[0])->startOfMonth();
|
||||
$start->month($terms[0])->startOfMonth();
|
||||
$end->month($terms[0])->endOfMonth();
|
||||
if ($companyStartMonth <= $start->month) {
|
||||
$startDate->month($companyStartMonth)->startOfMonth();
|
||||
$start->month($companyStartMonth)->startOfMonth();
|
||||
$end->month($companyStartMonth)->endOfMonth();
|
||||
} else {
|
||||
$startDate->subYear()->month($terms[0])->startOfMonth();
|
||||
$start->subYear()->month($terms[0])->startOfMonth();
|
||||
$end->subYear()->month($terms[0])->endOfMonth();
|
||||
$startDate->subYear()->month($companyStartMonth)->startOfMonth();
|
||||
$start->subYear()->month($companyStartMonth)->startOfMonth();
|
||||
$end->subYear()->month($companyStartMonth)->endOfMonth();
|
||||
}
|
||||
|
||||
if ($request->has('previous_year')) {
|
||||
@@ -87,7 +88,7 @@ class CustomerStatsController extends Controller
|
||||
($receiptTotals[$i] - $expenseTotals[$i])
|
||||
);
|
||||
$i++;
|
||||
array_push($months, $start->format('M'));
|
||||
array_push($months, $start->translatedFormat('M'));
|
||||
$monthCounter++;
|
||||
$end->startOfMonth();
|
||||
$start->addMonth()->startOfMonth();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Customer;
|
||||
namespace App\Http\Controllers\V1\Admin\Customer;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests;
|
||||
use App\Http\Requests\DeleteCustomersRequest;
|
||||
use App\Http\Resources\CustomerResource;
|
||||
use App\Models\Customer;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests;
|
||||
use InvoiceShelf\Http\Requests\DeleteCustomersRequest;
|
||||
use InvoiceShelf\Http\Resources\CustomerResource;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
|
||||
class CustomersController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Dashboard;
|
||||
namespace App\Http\Controllers\V1\Admin\Dashboard;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Company;
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\Customer;
|
||||
use App\Models\Estimate;
|
||||
use App\Models\Expense;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Company;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use InvoiceShelf\Models\Expense;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use Silber\Bouncer\BouncerFacade;
|
||||
|
||||
class DashboardController extends Controller
|
||||
@@ -40,15 +40,16 @@ class DashboardController extends Controller
|
||||
$start = Carbon::now();
|
||||
$end = Carbon::now();
|
||||
$terms = explode('-', $fiscalYear);
|
||||
$companyStartMonth = intval($terms[0]);
|
||||
|
||||
if ($terms[0] <= $start->month) {
|
||||
$startDate->month($terms[0])->startOfMonth();
|
||||
$start->month($terms[0])->startOfMonth();
|
||||
$end->month($terms[0])->endOfMonth();
|
||||
if ($companyStartMonth <= $start->month) {
|
||||
$startDate->month($companyStartMonth)->startOfMonth();
|
||||
$start->month($companyStartMonth)->startOfMonth();
|
||||
$end->month($companyStartMonth)->endOfMonth();
|
||||
} else {
|
||||
$startDate->subYear()->month($terms[0])->startOfMonth();
|
||||
$start->subYear()->month($terms[0])->startOfMonth();
|
||||
$end->subYear()->month($terms[0])->endOfMonth();
|
||||
$startDate->subYear()->month($companyStartMonth)->startOfMonth();
|
||||
$start->subYear()->month($companyStartMonth)->startOfMonth();
|
||||
$end->subYear()->month($companyStartMonth)->endOfMonth();
|
||||
}
|
||||
|
||||
if ($request->has('previous_year')) {
|
||||
@@ -90,7 +91,7 @@ class DashboardController extends Controller
|
||||
($receipt_totals[$i] - $expense_totals[$i])
|
||||
);
|
||||
$i++;
|
||||
array_push($months, $start->format('M'));
|
||||
array_push($months, $start->translatedFormat('M'));
|
||||
$monthCounter++;
|
||||
$end->startOfMonth();
|
||||
$start->addMonth()->startOfMonth();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
|
||||
namespace App\Http\Controllers\V1\Admin\Estimate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Estimate;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
|
||||
class ChangeEstimateStatusController extends Controller
|
||||
{
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V1\Admin\Estimate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\EstimateResource;
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\Estimate;
|
||||
use App\Services\SerialNumberFormatter;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Vinkla\Hashids\Facades\Hashids;
|
||||
|
||||
class CloneEstimateController extends Controller
|
||||
{
|
||||
/**
|
||||
* Mail a specific invoice to the corresponding customer's email address.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function __invoke(Request $request, Estimate $estimate)
|
||||
{
|
||||
$this->authorize('create', Estimate::class);
|
||||
|
||||
$date = Carbon::now();
|
||||
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($estimate)
|
||||
->setCompany($estimate->company_id)
|
||||
->setCustomer($estimate->customer_id)
|
||||
->setNextNumbers();
|
||||
|
||||
$due_date = null;
|
||||
$dueDateEnabled = CompanySetting::getSetting(
|
||||
'estimate_set_expiry_date_automatically',
|
||||
$request->header('company')
|
||||
);
|
||||
|
||||
if ($dueDateEnabled === 'YES') {
|
||||
$dueDateDays = intval(CompanySetting::getSetting(
|
||||
'estimate_expiry_date_days',
|
||||
$request->header('company')
|
||||
));
|
||||
$due_date = Carbon::now()->addDays($dueDateDays)->format('Y-m-d');
|
||||
}
|
||||
|
||||
$exchange_rate = $estimate->exchange_rate;
|
||||
|
||||
$newEstimate = Estimate::create([
|
||||
'estimate_date' => $date->format('Y-m-d'),
|
||||
'expiry_date' => $due_date,
|
||||
'estimate_number' => $serial->getNextNumber(),
|
||||
'sequence_number' => $serial->nextSequenceNumber,
|
||||
'customer_sequence_number' => $serial->nextCustomerSequenceNumber,
|
||||
'reference_number' => $estimate->reference_number,
|
||||
'customer_id' => $estimate->customer_id,
|
||||
'company_id' => $request->header('company'),
|
||||
'template_name' => $estimate->template_name,
|
||||
'status' => Estimate::STATUS_DRAFT,
|
||||
'sub_total' => $estimate->sub_total,
|
||||
'discount' => $estimate->discount,
|
||||
'discount_type' => $estimate->discount_type,
|
||||
'discount_val' => $estimate->discount_val,
|
||||
'total' => $estimate->total,
|
||||
'due_amount' => $estimate->total,
|
||||
'tax_per_item' => $estimate->tax_per_item,
|
||||
'discount_per_item' => $estimate->discount_per_item,
|
||||
'tax' => $estimate->tax,
|
||||
'notes' => $estimate->notes,
|
||||
'exchange_rate' => $exchange_rate,
|
||||
'base_total' => $estimate->total * $exchange_rate,
|
||||
'base_discount_val' => $estimate->discount_val * $exchange_rate,
|
||||
'base_sub_total' => $estimate->sub_total * $exchange_rate,
|
||||
'base_tax' => $estimate->tax * $exchange_rate,
|
||||
'base_due_amount' => $estimate->total * $exchange_rate,
|
||||
'currency_id' => $estimate->currency_id,
|
||||
'sales_tax_type' => $estimate->sales_tax_type,
|
||||
'sales_tax_address_type' => $estimate->sales_tax_address_type,
|
||||
]);
|
||||
|
||||
$newEstimate->unique_hash = Hashids::connection(Estimate::class)->encode($newEstimate->id);
|
||||
$newEstimate->save();
|
||||
$estimate->load('items.taxes');
|
||||
|
||||
$estimateItems = $estimate->items->toArray();
|
||||
|
||||
foreach ($estimateItems as $estimateItem) {
|
||||
$estimateItem['company_id'] = $request->header('company');
|
||||
$estimateItem['name'] = $estimateItem['name'];
|
||||
$estimateItem['exchange_rate'] = $exchange_rate;
|
||||
$estimateItem['base_price'] = $estimateItem['price'] * $exchange_rate;
|
||||
$estimateItem['base_discount_val'] = $estimateItem['discount_val'] * $exchange_rate;
|
||||
$estimateItem['base_tax'] = $estimateItem['tax'] * $exchange_rate;
|
||||
$estimateItem['base_total'] = $estimateItem['total'] * $exchange_rate;
|
||||
|
||||
$item = $newEstimate->items()->create($estimateItem);
|
||||
|
||||
if (array_key_exists('taxes', $estimateItem) && $estimateItem['taxes']) {
|
||||
foreach ($estimateItem['taxes'] as $tax) {
|
||||
$tax['company_id'] = $request->header('company');
|
||||
|
||||
if ($tax['amount']) {
|
||||
$item->taxes()->create($tax);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($estimate->taxes) {
|
||||
foreach ($estimate->taxes->toArray() as $tax) {
|
||||
$tax['company_id'] = $request->header('company');
|
||||
$newEstimate->taxes()->create($tax);
|
||||
}
|
||||
}
|
||||
|
||||
if ($estimate->fields()->exists()) {
|
||||
$customFields = [];
|
||||
|
||||
foreach ($estimate->fields as $data) {
|
||||
$customFields[] = [
|
||||
'id' => $data->custom_field_id,
|
||||
'value' => $data->defaultAnswer,
|
||||
];
|
||||
}
|
||||
|
||||
$newEstimate->addCustomFields($customFields);
|
||||
}
|
||||
|
||||
return new EstimateResource($newEstimate);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
|
||||
namespace App\Http\Controllers\V1\Admin\Estimate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\InvoiceResource;
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\Estimate;
|
||||
use App\Models\Invoice;
|
||||
use App\Services\SerialNumberFormatter;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Resources\InvoiceResource;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Services\SerialNumberFormatter;
|
||||
use Vinkla\Hashids\Facades\Hashids;
|
||||
|
||||
class ConvertEstimateController extends Controller
|
||||
@@ -35,14 +35,14 @@ class ConvertEstimateController extends Controller
|
||||
);
|
||||
|
||||
if ($dueDateEnabled === 'YES') {
|
||||
$dueDateDays = CompanySetting::getSetting(
|
||||
$dueDateDays = intval(CompanySetting::getSetting(
|
||||
'invoice_due_date_days',
|
||||
$request->header('company')
|
||||
);
|
||||
));
|
||||
$due_date = Carbon::now()->addDays($dueDateDays)->format('Y-m-d');
|
||||
}
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($invoice)
|
||||
->setCompany($estimate->company_id)
|
||||
->setCustomer($estimate->customer_id)
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
|
||||
namespace App\Http\Controllers\V1\Admin\Estimate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Estimate;
|
||||
use App\Space\PdfTemplateUtils;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
|
||||
class EstimateTemplatesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
$this->authorize('viewAny', Estimate::class);
|
||||
|
||||
$estimateTemplates = Estimate::estimateTemplates();
|
||||
$estimateTemplates = PdfTemplateUtils::getFormattedTemplates('estimate');
|
||||
|
||||
return response()->json([
|
||||
'estimateTemplates' => $estimateTemplates,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
|
||||
namespace App\Http\Controllers\V1\Admin\Estimate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\DeleteEstimatesRequest;
|
||||
use App\Http\Requests\EstimatesRequest;
|
||||
use App\Http\Resources\EstimateResource;
|
||||
use App\Jobs\GenerateEstimatePdfJob;
|
||||
use App\Models\Estimate;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\DeleteEstimatesRequest;
|
||||
use InvoiceShelf\Http\Requests\EstimatesRequest;
|
||||
use InvoiceShelf\Http\Resources\EstimateResource;
|
||||
use InvoiceShelf\Jobs\GenerateEstimatePdfJob;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
|
||||
class EstimatesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
|
||||
namespace App\Http\Controllers\V1\Admin\Estimate;
|
||||
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\SendEstimatesRequest;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\SendEstimatesRequest;
|
||||
use App\Models\Estimate;
|
||||
|
||||
class SendEstimateController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
|
||||
namespace App\Http\Controllers\V1\Admin\Estimate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\SendEstimatesRequest;
|
||||
use App\Models\Estimate;
|
||||
use Illuminate\Mail\Markdown;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\SendEstimatesRequest;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
|
||||
class SendEstimatePreviewController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\ExchangeRateProviderRequest;
|
||||
use App\Http\Resources\ExchangeRateProviderResource;
|
||||
use App\Models\ExchangeRateProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\ExchangeRateProviderRequest;
|
||||
use InvoiceShelf\Http\Resources\ExchangeRateProviderResource;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
|
||||
class ExchangeRateProviderController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Currency;
|
||||
use App\Models\ExchangeRateProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Currency;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
|
||||
class GetActiveProviderController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\Currency;
|
||||
use App\Models\ExchangeRateLog;
|
||||
use App\Models\ExchangeRateProvider;
|
||||
use App\Traits\ExchangeRateProvidersTrait;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Currency;
|
||||
use InvoiceShelf\Models\ExchangeRateLog;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
use InvoiceShelf\Traits\ExchangeRateProvidersTrait;
|
||||
|
||||
class GetExchangeRateController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\ExchangeRateProvider;
|
||||
use App\Traits\ExchangeRateProvidersTrait;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
use InvoiceShelf\Traits\ExchangeRateProvidersTrait;
|
||||
|
||||
class GetSupportedCurrenciesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\ExchangeRateProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
|
||||
class GetUsedCurrenciesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Expense;
|
||||
namespace App\Http\Controllers\V1\Admin\Expense;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\ExpenseCategoryRequest;
|
||||
use App\Http\Resources\ExpenseCategoryResource;
|
||||
use App\Models\ExpenseCategory;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\ExpenseCategoryRequest;
|
||||
use InvoiceShelf\Http\Resources\ExpenseCategoryResource;
|
||||
use InvoiceShelf\Models\ExpenseCategory;
|
||||
|
||||
class ExpenseCategoriesController extends Controller
|
||||
{
|
||||
@@ -60,7 +60,7 @@ class ExpenseCategoriesController extends Controller
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \InvoiceShelf\Models\ExpenseCategory $ExpenseCategory
|
||||
* @param \App\Models\ExpenseCategory $ExpenseCategory
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(ExpenseCategoryRequest $request, ExpenseCategory $category)
|
||||
@@ -75,7 +75,7 @@ class ExpenseCategoriesController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \InvoiceShelf\ExpensesCategory $category
|
||||
* @param \App\ExpensesCategory $category
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(ExpenseCategory $category)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Expense;
|
||||
namespace App\Http\Controllers\V1\Admin\Expense;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\DeleteExpensesRequest;
|
||||
use App\Http\Requests\ExpenseRequest;
|
||||
use App\Http\Resources\ExpenseResource;
|
||||
use App\Models\Expense;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\DeleteExpensesRequest;
|
||||
use InvoiceShelf\Http\Requests\ExpenseRequest;
|
||||
use InvoiceShelf\Http\Resources\ExpenseResource;
|
||||
use InvoiceShelf\Models\Expense;
|
||||
|
||||
class ExpensesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Expense;
|
||||
namespace App\Http\Controllers\V1\Admin\Expense;
|
||||
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Expense;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Expense;
|
||||
|
||||
class ShowReceiptController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Expense;
|
||||
namespace App\Http\Controllers\V1\Admin\Expense;
|
||||
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\UploadExpenseReceiptRequest;
|
||||
use InvoiceShelf\Models\Expense;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\UploadExpenseReceiptRequest;
|
||||
use App\Models\Expense;
|
||||
|
||||
class UploadReceiptController extends Controller
|
||||
{
|
||||
/**
|
||||
* Upload the expense receipts to storage.
|
||||
*
|
||||
* @param \InvoiceShelf\Http\Requests\ExpenseRequest $request
|
||||
* @param \App\Http\Requests\ExpenseRequest $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function __invoke(UploadExpenseReceiptRequest $request, Expense $expense)
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\CompanyResource;
|
||||
use App\Http\Resources\UserResource;
|
||||
use App\Models\Company;
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\Currency;
|
||||
use App\Models\Module;
|
||||
use App\Models\Setting;
|
||||
use App\Traits\GeneratesMenuTrait;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Resources\CompanyResource;
|
||||
use InvoiceShelf\Http\Resources\UserResource;
|
||||
use InvoiceShelf\Models\Company;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Currency;
|
||||
use InvoiceShelf\Models\Module;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use InvoiceShelf\Traits\GeneratesMenuTrait;
|
||||
use Silber\Bouncer\BouncerFacade;
|
||||
|
||||
class BootstrapController extends Controller
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\BulkExchangeRateRequest;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use InvoiceShelf\Models\Tax;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\BulkExchangeRateRequest;
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\Estimate;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Tax;
|
||||
|
||||
class BulkExchangeRateController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
|
||||
class ConfigController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\CountryResource;
|
||||
use App\Models\Country;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Resources\CountryResource;
|
||||
use InvoiceShelf\Models\Country;
|
||||
|
||||
class CountriesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\CurrencyResource;
|
||||
use App\Models\Currency;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Resources\CurrencyResource;
|
||||
use InvoiceShelf\Models\Currency;
|
||||
|
||||
class CurrenciesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Space\DateFormatter;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Space\DateFormatter;
|
||||
|
||||
class DateFormatsController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Currency;
|
||||
use App\Models\Estimate;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Tax;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Currency;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use InvoiceShelf\Models\Tax;
|
||||
|
||||
class GetAllUsedCurrenciesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Estimate;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Services\SerialNumberFormatter;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use InvoiceShelf\Services\SerialNumberFormatter;
|
||||
|
||||
class NextNumberController extends Controller
|
||||
{
|
||||
@@ -20,7 +20,7 @@ class NextNumberController extends Controller
|
||||
{
|
||||
$key = $request->key;
|
||||
$nextNumber = null;
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setCompany($request->header('company'))
|
||||
->setCustomer($request->userId);
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\NotesRequest;
|
||||
use App\Http\Resources\NoteResource;
|
||||
use App\Models\Note;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\NotesRequest;
|
||||
use InvoiceShelf\Http\Resources\NoteResource;
|
||||
use InvoiceShelf\Models\Note;
|
||||
|
||||
class NotesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\SerialNumberFormatter;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Services\SerialNumberFormatter;
|
||||
|
||||
class NumberPlaceholdersController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Customer;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\User;
|
||||
|
||||
class SearchController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\User;
|
||||
|
||||
class SearchUsersController extends Controller
|
||||
{
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Space\TimeFormatter;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TimeFormatsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
return response()->json([
|
||||
'time_formats' => TimeFormatter::get_list(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
|
||||
namespace App\Http\Controllers\V1\Admin\General;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Space\TimeZones;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Space\TimeZones;
|
||||
|
||||
class TimezonesController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
|
||||
namespace App\Http\Controllers\V1\Admin\Invoice;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Invoice;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
|
||||
class ChangeInvoiceStatusController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
|
||||
namespace App\Http\Controllers\V1\Admin\Invoice;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\InvoiceResource;
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\Invoice;
|
||||
use App\Services\SerialNumberFormatter;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Resources\InvoiceResource;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Services\SerialNumberFormatter;
|
||||
use Vinkla\Hashids\Facades\Hashids;
|
||||
|
||||
class CloneInvoiceController extends Controller
|
||||
@@ -24,7 +24,7 @@ class CloneInvoiceController extends Controller
|
||||
|
||||
$date = Carbon::now();
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($invoice)
|
||||
->setCompany($invoice->company_id)
|
||||
->setCustomer($invoice->customer_id)
|
||||
@@ -37,15 +37,25 @@ class CloneInvoiceController extends Controller
|
||||
);
|
||||
|
||||
if ($dueDateEnabled === 'YES') {
|
||||
$dueDateDays = CompanySetting::getSetting(
|
||||
$dueDateDays = intval(CompanySetting::getSetting(
|
||||
'invoice_due_date_days',
|
||||
$request->header('company')
|
||||
);
|
||||
));
|
||||
$due_date = Carbon::now()->addDays($dueDateDays)->format('Y-m-d');
|
||||
}
|
||||
|
||||
$exchange_rate = $invoice->exchange_rate;
|
||||
|
||||
$dateFormat = 'Y-m-d';
|
||||
$invoiceTimeEnabled = CompanySetting::getSetting(
|
||||
'invoice_use_time',
|
||||
$request->header('company')
|
||||
);
|
||||
|
||||
if ($invoiceTimeEnabled === 'YES') {
|
||||
$dateFormat .= ' H:i';
|
||||
}
|
||||
|
||||
$newInvoice = Invoice::create([
|
||||
'invoice_date' => $date->format('Y-m-d'),
|
||||
'due_date' => $due_date,
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
|
||||
namespace App\Http\Controllers\V1\Admin\Invoice;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Invoice;
|
||||
use App\Space\PdfTemplateUtils;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
|
||||
class InvoiceTemplatesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*
|
||||
* @return JsonResponse
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
$this->authorize('viewAny', Invoice::class);
|
||||
|
||||
$invoiceTemplates = Invoice::invoiceTemplates();
|
||||
$invoiceTemplates = PdfTemplateUtils::getFormattedTemplates('invoice');
|
||||
|
||||
return response()->json([
|
||||
'invoiceTemplates' => $invoiceTemplates,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
|
||||
namespace App\Http\Controllers\V1\Admin\Invoice;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests;
|
||||
use App\Http\Requests\DeleteInvoiceRequest;
|
||||
use App\Http\Resources\InvoiceResource;
|
||||
use App\Jobs\GenerateInvoicePdfJob;
|
||||
use App\Models\Invoice;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests;
|
||||
use InvoiceShelf\Http\Requests\DeleteInvoiceRequest;
|
||||
use InvoiceShelf\Http\Resources\InvoiceResource;
|
||||
use InvoiceShelf\Jobs\GenerateInvoicePdfJob;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
|
||||
class InvoicesController extends Controller
|
||||
{
|
||||
@@ -21,12 +21,11 @@ class InvoicesController extends Controller
|
||||
{
|
||||
$this->authorize('viewAny', Invoice::class);
|
||||
|
||||
$limit = $request->has('limit') ? $request->limit : 10;
|
||||
$limit = $request->input('limit', 10);
|
||||
|
||||
$invoices = Invoice::whereCompany()
|
||||
->join('customers', 'customers.id', '=', 'invoices.customer_id')
|
||||
->applyFilters($request->all())
|
||||
->select('invoices.*', 'customers.name')
|
||||
->with('customer')
|
||||
->latest()
|
||||
->paginateData($limit);
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
|
||||
namespace App\Http\Controllers\V1\Admin\Invoice;
|
||||
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\SendInvoiceRequest;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\SendInvoiceRequest;
|
||||
use App\Models\Invoice;
|
||||
|
||||
class SendInvoiceController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
|
||||
namespace App\Http\Controllers\V1\Admin\Invoice;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\SendInvoiceRequest;
|
||||
use App\Models\Invoice;
|
||||
use Illuminate\Mail\Markdown;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\SendInvoiceRequest;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
|
||||
class SendInvoicePreviewController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Item;
|
||||
namespace App\Http\Controllers\V1\Admin\Item;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests;
|
||||
use App\Http\Requests\DeleteItemsRequest;
|
||||
use App\Http\Resources\ItemResource;
|
||||
use App\Models\Item;
|
||||
use App\Models\TaxType;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests;
|
||||
use InvoiceShelf\Http\Requests\DeleteItemsRequest;
|
||||
use InvoiceShelf\Http\Resources\ItemResource;
|
||||
use InvoiceShelf\Models\Item;
|
||||
use InvoiceShelf\Models\TaxType;
|
||||
|
||||
class ItemsController extends Controller
|
||||
{
|
||||
@@ -40,7 +40,7 @@ class ItemsController extends Controller
|
||||
/**
|
||||
* Create Item.
|
||||
*
|
||||
* @param InvoiceShelf\Http\Requests\ItemsRequest $request
|
||||
* @param App\Http\Requests\ItemsRequest $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function store(Requests\ItemsRequest $request)
|
||||
@@ -67,7 +67,7 @@ class ItemsController extends Controller
|
||||
/**
|
||||
* Update an existing Item.
|
||||
*
|
||||
* @param InvoiceShelf\Http\Requests\ItemsRequest $request
|
||||
* @param App\Http\Requests\ItemsRequest $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function update(Requests\ItemsRequest $request, Item $item)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Item;
|
||||
namespace App\Http\Controllers\V1\Admin\Item;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\UnitRequest;
|
||||
use App\Http\Resources\UnitResource;
|
||||
use App\Models\Unit;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\UnitRequest;
|
||||
use InvoiceShelf\Http\Resources\UnitResource;
|
||||
use InvoiceShelf\Models\Unit;
|
||||
|
||||
class UnitsController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Mobile;
|
||||
namespace App\Http\Controllers\V1\Admin\Mobile;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\LoginRequest;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\LoginRequest;
|
||||
use InvoiceShelf\Models\User;
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Modules;
|
||||
namespace App\Http\Controllers\V1\Admin\Modules;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Space\ModuleInstaller;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Space\ModuleInstaller;
|
||||
|
||||
class ApiTokenController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Modules;
|
||||
namespace App\Http\Controllers\V1\Admin\Modules;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Space\ModuleInstaller;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Space\ModuleInstaller;
|
||||
|
||||
class CompleteModuleInstallationController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Modules;
|
||||
namespace App\Http\Controllers\V1\Admin\Modules;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Space\ModuleInstaller;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Space\ModuleInstaller;
|
||||
|
||||
class CopyModuleController extends Controller
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\Modules;
|
||||
namespace App\Http\Controllers\V1\Admin\Modules;
|
||||
|
||||
use App\Events\ModuleDisabledEvent;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Module as ModelsModule;
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Events\ModuleDisabledEvent;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Module as ModelsModule;
|
||||
use Nwidart\Modules\Facades\Module;
|
||||
|
||||
class DisableModuleController extends Controller
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user