mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
commit
3d36cb917f
4
.github/workflows/react_release.yml
vendored
4
.github/workflows/react_release.yml
vendored
@ -66,7 +66,7 @@ jobs:
|
||||
- name: Build project
|
||||
run: |
|
||||
shopt -s dotglob
|
||||
tar --exclude='public/storage' --exclude='./htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/react-invoiceninja.tar *
|
||||
tar --exclude='public/storage' --exclude='./htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/invoiceninja.tar *
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
@ -74,4 +74,4 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: |
|
||||
/home/runner/work/invoiceninja/react-invoiceninja.tar
|
||||
/home/runner/work/invoiceninja/invoiceninja.tar
|
84
.github/workflows/release.yml
vendored
84
.github/workflows/release.yml
vendored
@ -1,84 +0,0 @@
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
name: Upload Release Asset
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Upload Release Asset
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.2
|
||||
extensions: mysql, mysqlnd, sqlite3, bcmath, gd, curl, zip, openssl, mbstring, xml
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
ref: v5-develop
|
||||
|
||||
- name: Copy .env file
|
||||
run: |
|
||||
cp .env.example .env
|
||||
|
||||
- name: Install composer dependencies
|
||||
run: |
|
||||
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
|
||||
composer install --no-dev
|
||||
|
||||
- name: Prepare Laravel Application
|
||||
run: |
|
||||
cp .env.example .env
|
||||
php artisan key:generate --force
|
||||
php artisan optimize
|
||||
php artisan storage:link --force
|
||||
sudo php artisan cache:clear
|
||||
sudo find ./vendor/bin/ -type f -exec chmod +x {} \;
|
||||
sudo find ./ -type d -exec chmod 755 {} \;
|
||||
|
||||
- name: Prepare React FrontEnd
|
||||
run: |
|
||||
git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/ui.git
|
||||
cd ui
|
||||
git checkout develop
|
||||
npm i
|
||||
npm run build
|
||||
|
||||
mkdir -p ../public/react/${{ github.event.release.tag_name }}/
|
||||
cp -r dist/react/* ../public/react/${{ github.event.release.tag_name }}/
|
||||
cp -r dist/react/* ../public/react/
|
||||
cp dist/index.html ../resources/views/react/index.blade.php
|
||||
|
||||
mkdir -p ../public/tinymce_6.4.2/tinymce/js/
|
||||
cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/
|
||||
cd ..
|
||||
rm -rf ui
|
||||
php artisan ninja:react
|
||||
|
||||
- name: Prepare JS/CSS assets
|
||||
run: |
|
||||
npm i
|
||||
npm run production
|
||||
|
||||
- name: Cleanup Builds
|
||||
run: |
|
||||
sudo rm -rf bootstrap/cache/*
|
||||
sudo rm -rf node_modules
|
||||
sudo rm -rf .git
|
||||
sudo rm .env
|
||||
|
||||
- name: Build project
|
||||
run: |
|
||||
shopt -s dotglob
|
||||
tar --exclude='public/storage' --exclude='./htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/invoiceninja.tar *
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: |
|
||||
/home/runner/work/invoiceninja/invoiceninja.tar
|
@ -1 +1 @@
|
||||
5.9.9
|
||||
5.10.0
|
@ -109,7 +109,7 @@ class ActivityExport extends BaseExport
|
||||
$query = Activity::query()
|
||||
->where('company_id', $this->company->id);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'activities');
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
@ -1245,13 +1245,13 @@ class BaseExport
|
||||
* @param Builder $query
|
||||
* @return Builder
|
||||
*/
|
||||
protected function addDateRange(Builder $query): Builder
|
||||
protected function addDateRange(Builder $query, ?string $table_name = null): Builder
|
||||
{
|
||||
$query = $this->applyProductFilters($query);
|
||||
|
||||
$date_range = $this->input['date_range'];
|
||||
|
||||
if (array_key_exists('date_key', $this->input) && strlen($this->input['date_key']) > 1) {
|
||||
if (array_key_exists('date_key', $this->input) && strlen($this->input['date_key']) > 1 && ($this->table_name && $this->columnExists($table_name, $this->input['date_key']))) {
|
||||
$this->date_key = $this->input['date_key'];
|
||||
}
|
||||
|
||||
@ -1608,5 +1608,18 @@ class BaseExport
|
||||
ZipDocuments::dispatch($documents, $this->company, $user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests that the column exists
|
||||
* on the table prior to adding it to
|
||||
* the query builder
|
||||
*
|
||||
* @param string $table
|
||||
* @param string $column
|
||||
* @return bool
|
||||
*/
|
||||
public function columnExists($table, $column): bool
|
||||
{
|
||||
return \Illuminate\Support\Facades\Schema::hasColumn($table, $column);
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ class ClientExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query,' clients');
|
||||
|
||||
if($this->input['document_email_attachment'] ?? false) {
|
||||
$this->queueDocuments($query);
|
||||
|
@ -63,7 +63,7 @@ class ContactExport extends BaseExport
|
||||
$q->where('is_deleted', false);
|
||||
});
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'client_contacts');
|
||||
|
||||
return $query;
|
||||
|
||||
|
@ -108,7 +108,7 @@ class CreditExport extends BaseExport
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', $this->input['include_deleted'] ?? false);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'credits');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
|
@ -76,7 +76,7 @@ class DocumentExport extends BaseExport
|
||||
|
||||
$query = Document::query()->where('company_id', $this->company->id);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'documents');
|
||||
|
||||
if($this->input['document_email_attachment'] ?? false) {
|
||||
$this->queueDocuments($query);
|
||||
|
@ -89,7 +89,7 @@ class ExpenseExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'expenses');
|
||||
|
||||
if($this->input['status'] ?? false) {
|
||||
$query = $this->addExpenseStatusFilter($query, $this->input['status']);
|
||||
|
@ -67,7 +67,7 @@ class InvoiceExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'invoices');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
|
@ -79,7 +79,7 @@ class InvoiceItemExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'invoices');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
|
@ -62,7 +62,7 @@ class PaymentExport extends BaseExport
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', 0);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'payments');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
|
@ -75,12 +75,11 @@ class ProductExport extends BaseExport
|
||||
->withTrashed()
|
||||
->where('company_id', $this->company->id);
|
||||
|
||||
|
||||
if(!$this->input['include_deleted'] ?? false) {
|
||||
if(!$this->input['include_deleted'] ?? false) { //@phpstan-ignore-line
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'products');
|
||||
|
||||
if($this->input['document_email_attachment'] ?? false) {
|
||||
$this->queueDocuments($query);
|
||||
|
@ -129,7 +129,7 @@ class ProductSalesExport extends BaseExport
|
||||
->where('is_deleted', 0)
|
||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL, Invoice::STATUS_PAID]);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'invoices');
|
||||
|
||||
$query = $this->filterByClients($query);
|
||||
|
||||
|
@ -67,7 +67,7 @@ class PurchaseOrderExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'purchase_orders');
|
||||
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
@ -71,7 +71,7 @@ class PurchaseOrderItemExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'purchase_orders');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
|
@ -73,7 +73,7 @@ class QuoteExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'quotes');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
|
@ -74,7 +74,7 @@ class QuoteItemExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'quotes');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
|
@ -65,7 +65,7 @@ class RecurringInvoiceExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'recurring_invoices');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
|
@ -74,7 +74,7 @@ class TaskExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'tasks');
|
||||
|
||||
$clients = &$this->input['client_id'];
|
||||
|
||||
@ -184,13 +184,13 @@ class TaskExport extends BaseExport
|
||||
|
||||
foreach ($logs as $key => $item) {
|
||||
if (in_array('task.start_date', $this->input['report_keys']) || in_array('start_date', $this->input['report_keys'])) {
|
||||
$carbon_object = Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name);
|
||||
$carbon_object = Carbon::createFromTimeStamp((int)$item[0])->setTimezone($timezone_name);
|
||||
$entity['task.start_date'] = $carbon_object->format($date_format_default);
|
||||
$entity['task.start_time'] = $carbon_object->format('H:i:s');
|
||||
}
|
||||
|
||||
if ((in_array('task.end_date', $this->input['report_keys']) || in_array('end_date', $this->input['report_keys'])) && $item[1] > 0) {
|
||||
$carbon_object = Carbon::createFromTimeStamp($item[1])->setTimezone($timezone_name);
|
||||
$carbon_object = Carbon::createFromTimeStamp((int)$item[1])->setTimezone($timezone_name);
|
||||
$entity['task.end_date'] = $carbon_object->format($date_format_default);
|
||||
$entity['task.end_time'] = $carbon_object->format('H:i:s');
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class VendorExport extends BaseExport
|
||||
$query->where('is_deleted', 0);
|
||||
}
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'vendors');
|
||||
|
||||
if($this->input['document_email_attachment'] ?? false) {
|
||||
$this->queueDocuments($query);
|
||||
|
@ -60,7 +60,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface
|
||||
|
||||
if(is_array($logs)) {
|
||||
$item = $logs[0];
|
||||
return Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name)->format($date_format_default);
|
||||
return Carbon::createFromTimeStamp((int)$item[0])->setTimezone($timezone_name)->format($date_format_default);
|
||||
}
|
||||
|
||||
return '';
|
||||
@ -89,7 +89,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface
|
||||
|
||||
if(is_array($logs)) {
|
||||
$item = $logs[1];
|
||||
return Carbon::createFromTimeStamp($item[1])->setTimezone($timezone_name)->format($date_format_default);
|
||||
return Carbon::createFromTimeStamp((int)$item[1])->setTimezone($timezone_name)->format($date_format_default);
|
||||
}
|
||||
|
||||
return '';
|
||||
|
@ -121,8 +121,16 @@ class PaymentController extends Controller
|
||||
{
|
||||
/** @var \App\Models\CompanyGateway $gateway **/
|
||||
$gateway = CompanyGateway::findOrFail($request->input('company_gateway_id'));
|
||||
$payment_hash = PaymentHash::where('hash', $request->payment_hash)->firstOrFail();
|
||||
$invoice = Invoice::with('client')->find($payment_hash->fee_invoice_id);
|
||||
$payment_hash = PaymentHash::with('fee_invoice')->where('hash', $request->payment_hash)->firstOrFail();
|
||||
|
||||
// if($payment_hash)
|
||||
$invoice = $payment_hash->fee_invoice;
|
||||
// else
|
||||
// $invoice = Invoice::with('client')->where('id',$payment_hash->fee_invoice_id)->orderBy('id','desc')->first();
|
||||
|
||||
// $invoice = Invoice::with('client')->find($payment_hash->fee_invoice_id);
|
||||
|
||||
|
||||
$client = $invoice ? $invoice->client : auth()->guard('contact')->user()->client;
|
||||
|
||||
// 09-07-2022 catch duplicate responses for invoices that already paid here.
|
||||
|
@ -192,6 +192,7 @@ class ImportController extends Controller
|
||||
$contents = file_get_contents($file->getPathname());
|
||||
// Store the csv in cache with an expiry of 10 minutes
|
||||
Cache::put($hash.'-'.$entityType, base64_encode($contents), 600);
|
||||
nlog($hash.'-'.$entityType);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,8 @@ class StoreProjectRequest extends Request
|
||||
$rules['name'] = 'required';
|
||||
$rules['client_id'] = 'required|exists:clients,id,company_id,'.$user->company()->id;
|
||||
$rules['budgeted_hours'] = 'sometimes|numeric';
|
||||
|
||||
$rules['task_rate'] = 'required|bail|numeric';
|
||||
|
||||
if (isset($this->number)) {
|
||||
$rules['number'] = Rule::unique('projects')->where('company_id', $user->company()->id);
|
||||
}
|
||||
@ -79,6 +80,8 @@ class StoreProjectRequest extends Request
|
||||
$input['budgeted_hours'] = 0;
|
||||
}
|
||||
|
||||
$input['task_rate'] = isset($input['task_rate']) ? $input['task_rate'] : 0;
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
|
||||
|
@ -104,6 +104,8 @@ class BaseImport
|
||||
return null;
|
||||
}
|
||||
|
||||
nlog("found {$entity_type}");
|
||||
|
||||
$csv = base64_decode($base64_encoded_csv);
|
||||
$csv = mb_convert_encoding($csv, 'UTF-8', 'UTF-8');
|
||||
|
||||
|
@ -112,8 +112,7 @@ class CreateRawPdf
|
||||
try {
|
||||
$pdf = $ps->boot()->getPdf();
|
||||
} catch (\Exception $e) {
|
||||
echo "EXCEPTION::".PHP_EOL;
|
||||
echo $e->getMessage().PHP_EOL;
|
||||
nlog($e->getMessage());
|
||||
throw new FilePermissionsFailure('Unable to generate the raw PDF');
|
||||
}
|
||||
|
||||
|
@ -188,13 +188,13 @@ class SendReminders implements ShouldQueue
|
||||
|
||||
switch ($schedule_reminder) {
|
||||
case 'after_invoice_date':
|
||||
return Carbon::parse($invoice->date)->addDays($num_days_reminder)->startOfDay()->addSeconds($offset);
|
||||
return Carbon::parse($invoice->date)->addDays((int)$num_days_reminder)->startOfDay()->addSeconds($offset);
|
||||
break;
|
||||
case 'before_due_date':
|
||||
return Carbon::parse($invoice->due_date)->subDays($num_days_reminder)->startOfDay()->addSeconds($offset);
|
||||
return Carbon::parse($invoice->due_date)->subDays((int)$num_days_reminder)->startOfDay()->addSeconds($offset);
|
||||
break;
|
||||
case 'after_due_date':
|
||||
return Carbon::parse($invoice->due_date)->addDays($num_days_reminder)->startOfDay()->addSeconds($offset);
|
||||
return Carbon::parse($invoice->due_date)->addDays((int)$num_days_reminder)->startOfDay()->addSeconds($offset);
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
|
@ -21,6 +21,7 @@ class UpdateInvoiceActivity implements ShouldQueue
|
||||
{
|
||||
protected $activity_repo;
|
||||
|
||||
public $delay = 10;
|
||||
/**
|
||||
* Create the event listener.
|
||||
*
|
||||
@ -52,5 +53,6 @@ class UpdateInvoiceActivity implements ShouldQueue
|
||||
$fields->invoice_id = $event->invoice->id;
|
||||
|
||||
$this->activity_repo->save($fields, $event->invoice, $event->event_vars);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ class RecurringQuote extends BaseModel
|
||||
case 'terms':
|
||||
return $this->calculateDateFromTerms($date);
|
||||
default:
|
||||
return $this->setDayOfMonth($date, $this->due_date_days);
|
||||
return $this->setDayOfMonth($date, ($this->due_date_days ?? 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ class Task extends BaseModel
|
||||
$parts = json_decode($this->time_log) ?: [];
|
||||
|
||||
if (count($parts)) {
|
||||
return Carbon::createFromTimeStamp($parts[0][0])->timestamp;
|
||||
return Carbon::createFromTimeStamp((int)$parts[0][0])->timestamp;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -281,11 +281,11 @@ class Task extends BaseModel
|
||||
$parent_entity = $this->client ?? $this->company;
|
||||
|
||||
if($log[0]) {
|
||||
$log[0] = Carbon::createFromTimestamp($log[0])->format($parent_entity->date_format().' H:i:s');
|
||||
$log[0] = Carbon::createFromTimestamp((int)$log[0])->format($parent_entity->date_format().' H:i:s');
|
||||
}
|
||||
|
||||
if($log[1] && $log[1] != 0) {
|
||||
$log[1] = Carbon::createFromTimestamp($log[1])->format($parent_entity->date_format().' H:i:s');
|
||||
$log[1] = Carbon::createFromTimestamp((int)$log[1])->format($parent_entity->date_format().' H:i:s');
|
||||
} else {
|
||||
$log[1] = ctrans('texts.running');
|
||||
}
|
||||
@ -313,11 +313,11 @@ class Task extends BaseModel
|
||||
if($log[0]) {
|
||||
$logged['start_date_raw'] = $log[0];
|
||||
}
|
||||
$logged['start_date'] = Carbon::createFromTimestamp($log[0])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
||||
$logged['start_date'] = Carbon::createFromTimestamp((int)$log[0])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
||||
|
||||
if($log[1] && $log[1] != 0) {
|
||||
$logged['end_date_raw'] = $log[1];
|
||||
$logged['end_date'] = Carbon::createFromTimestamp($log[1])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
||||
$logged['end_date'] = Carbon::createFromTimestamp((int)$log[1])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
||||
} else {
|
||||
$logged['end_date_raw'] = 0;
|
||||
$logged['end_date'] = ctrans('texts.running');
|
||||
|
@ -81,6 +81,8 @@ class ActivityRepository extends BaseRepository
|
||||
return;
|
||||
}
|
||||
|
||||
$entity = $entity->fresh();
|
||||
|
||||
if (get_class($entity) == Invoice::class
|
||||
|| get_class($entity) == Quote::class
|
||||
|| get_class($entity) == Credit::class
|
||||
|
@ -157,7 +157,7 @@ class TaskRepository extends BaseRepository
|
||||
{
|
||||
|
||||
if(isset($time_log[0][0])) {
|
||||
return \Carbon\Carbon::createFromTimestamp($time_log[0][0])->addSeconds($task->company->utc_offset());
|
||||
return \Carbon\Carbon::createFromTimestamp((int)$time_log[0][0])->addSeconds($task->company->utc_offset());
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -245,7 +245,7 @@ class InstantPayment
|
||||
$hash_data['billing_context'] = Cache::get($this->request->query('hash'));
|
||||
} elseif ($this->request->hash) {
|
||||
$hash_data['billing_context'] = Cache::get($this->request->hash);
|
||||
} elseif ($old_hash = PaymentHash::query()->where('fee_invoice_id', $first_invoice->id)->whereNull('payment_id')->first()) {
|
||||
} elseif ($old_hash = PaymentHash::query()->where('fee_invoice_id', $first_invoice->id)->whereNull('payment_id')->orderBy('id','desc')->first()) {
|
||||
if (isset($old_hash->data->billing_context)) {
|
||||
$hash_data['billing_context'] = $old_hash->data->billing_context;
|
||||
}
|
||||
|
@ -292,9 +292,9 @@ class InvoiceService
|
||||
|
||||
//12-10-2022
|
||||
if ($this->invoice->partial > 0 && !$this->invoice->partial_due_date) {
|
||||
$this->invoice->partial_due_date = Carbon::parse($this->invoice->date)->addDays($this->invoice->client->getSetting('payment_terms'));
|
||||
$this->invoice->partial_due_date = Carbon::parse($this->invoice->date)->addDays((int)$this->invoice->client->getSetting('payment_terms'));
|
||||
} else {
|
||||
$this->invoice->due_date = Carbon::parse($this->invoice->date)->addDays($this->invoice->client->getSetting('payment_terms'));
|
||||
$this->invoice->due_date = Carbon::parse($this->invoice->date)->addDays((int)$this->invoice->client->getSetting('payment_terms'));
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -27,10 +27,6 @@ class RefundPayment
|
||||
|
||||
private float $credits_used = 0;
|
||||
|
||||
private $gateway_refund_status;
|
||||
|
||||
private $activity_repository;
|
||||
|
||||
private bool $refund_failed = false;
|
||||
|
||||
private string $refund_failed_message = '';
|
||||
|
@ -100,7 +100,7 @@ class ARDetailReport extends BaseExport
|
||||
->orderBy('due_date', 'ASC')
|
||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'invoices');
|
||||
|
||||
$query = $this->filterByClients($query);
|
||||
|
||||
|
@ -110,7 +110,7 @@ class ClientBalanceReport extends BaseExport
|
||||
$query = Invoice::query()->where('client_id', $client->id)
|
||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'invoices');
|
||||
|
||||
return [
|
||||
$client->present()->name(),
|
||||
|
@ -103,7 +103,7 @@ class ClientSalesReport extends BaseExport
|
||||
$query = Invoice::query()->where('client_id', $client->id)
|
||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL, Invoice::STATUS_PAID]);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'invoices');
|
||||
|
||||
$amount = $query->sum('amount');
|
||||
$balance = $query->sum('balance');
|
||||
|
@ -81,7 +81,7 @@ class TaxSummaryReport extends BaseExport
|
||||
->where('is_deleted', 0)
|
||||
->orderBy('balance', 'desc');
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'invoices');
|
||||
|
||||
$this->csv->insertOne([ctrans('texts.tax_summary')]);
|
||||
$this->csv->insertOne([ctrans('texts.created_on'),' ',$this->translateDate(now()->format('Y-m-d'), $this->company->date_format(), $this->company->locale())]);
|
||||
|
@ -69,7 +69,7 @@ class UserSalesReport extends BaseExport
|
||||
->where('is_deleted', 0)
|
||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL, Invoice::STATUS_PAID]);
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
$query = $this->addDateRange($query, 'invoices');
|
||||
|
||||
$query = $this->filterByClients($query);
|
||||
|
||||
|
@ -174,7 +174,7 @@ class SubscriptionStatus extends AbstractService
|
||||
*/
|
||||
private function checkRefundable(): self
|
||||
{
|
||||
if(!$this->recurring_invoice->subscription->refund_period || $this->recurring_invoice->subscription->refund_period === 0) {
|
||||
if(!$this->recurring_invoice->subscription->refund_period || (int)$this->recurring_invoice->subscription->refund_period == 0) {
|
||||
return $this->setRefundable(false);
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ trait MakesDates
|
||||
*/
|
||||
public function formatDatetime($date, string $format): string
|
||||
{
|
||||
return Carbon::createFromTimestamp($date)->format($format.' g:i a');
|
||||
return Carbon::createFromTimestamp((int)$date)->format($format.' g:i a');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,7 +89,7 @@ trait MakesDates
|
||||
*/
|
||||
public function formatDateTimestamp($timestamp, string $format): string
|
||||
{
|
||||
return Carbon::createFromTimestamp($timestamp)->format($format);
|
||||
return Carbon::createFromTimestamp((int)$timestamp)->format($format);
|
||||
}
|
||||
|
||||
private function convertToDateObject($date)
|
||||
|
@ -82,6 +82,9 @@ trait MakesReminders
|
||||
|
||||
private function checkEndlessReminder($last_sent_date, $endless_reminder_frequency_id): bool
|
||||
{
|
||||
if(!$last_sent_date)
|
||||
return false;
|
||||
|
||||
if (Carbon::now()->startOfDay()->eq($this->addTimeInterval($last_sent_date, $endless_reminder_frequency_id))) {
|
||||
return true;
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => env('APP_VERSION', '5.9.9'),
|
||||
'app_tag' => env('APP_TAG', '5.9.9'),
|
||||
'app_version' => env('APP_VERSION', '5.10.0'),
|
||||
'app_tag' => env('APP_TAG', '5.10.0'),
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', false),
|
||||
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
|
||||
Schema::table('payment_hashes', function (Blueprint $table) {
|
||||
$table->unsignedInteger('fee_invoice_id')->nullable()->index()->change();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
@ -1,4 +1,3 @@
|
||||
/*!999999\- enable the sandbox mode */
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
@ -2431,7 +2430,6 @@ CREATE TABLE `webhooks` (
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!999999\- enable the sandbox mode */
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1,'2014_10_12_100000_create_password_resets_table',1);
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2,'2014_10_13_000000_create_users_table',1);
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3,'2019_11_10_115926_create_failed_jobs_table',1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user