mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
Compare commits
2 Commits
increase-s
...
NickCrater
| Author | SHA1 | Date | |
|---|---|---|---|
| b414764552 | |||
| d69b7fd491 |
@ -183,7 +183,7 @@ class Payment extends Model implements HasMedia
|
|||||||
|
|
||||||
public function updatePayment($request)
|
public function updatePayment($request)
|
||||||
{
|
{
|
||||||
$data = $request->getPaymentPayload();
|
$data = $request->all();
|
||||||
|
|
||||||
if ($request->invoice_id && (! $this->invoice_id || $this->invoice_id !== $request->invoice_id)) {
|
if ($request->invoice_id && (! $this->invoice_id || $this->invoice_id !== $request->invoice_id)) {
|
||||||
$invoice = Invoice::find($request->invoice_id);
|
$invoice = Invoice::find($request->invoice_id);
|
||||||
|
|||||||
@ -156,7 +156,7 @@ class SerialNumberFormatter
|
|||||||
|
|
||||||
public static function getPlaceholders(string $format)
|
public static function getPlaceholders(string $format)
|
||||||
{
|
{
|
||||||
$regex = "/{{([A-Z_]{1,})(?::)?([a-zA-Z0-9_]{1,6}|.{1})?}}/";
|
$regex = "/{{([A-Z_]{1,})(?::)?([a-zA-Z0-9_]{1,4}|.{1})?}}/";
|
||||||
|
|
||||||
preg_match_all($regex, $format, $placeholders);
|
preg_match_all($regex, $format, $placeholders);
|
||||||
array_shift($placeholders);
|
array_shift($placeholders);
|
||||||
|
|||||||
@ -1,34 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Crater\Models\Payment;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
|
|
||||||
class CalculateBaseAmountOfPaymentsTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$payments = Payment::all();
|
|
||||||
|
|
||||||
if ($payments) {
|
|
||||||
foreach ($payments as $payment) {
|
|
||||||
$payment->base_amount = $payment->exchange_rate * $payment->amount;
|
|
||||||
$payment->save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -55,6 +55,8 @@ Join the Crater discord server to discuss:
|
|||||||
- [x] Multiple Companies
|
- [x] Multiple Companies
|
||||||
- [x] Recurring Invoices
|
- [x] Recurring Invoices
|
||||||
- [ ] Modules
|
- [ ] Modules
|
||||||
|
- [ ] Blockchain Integration
|
||||||
|
- [ ] Web 3.0 Accounting
|
||||||
- [ ] White Labeling (Easy Invoice, Email & Consumer Portal Theme customisation)
|
- [ ] White Labeling (Easy Invoice, Email & Consumer Portal Theme customisation)
|
||||||
- [ ] Vendors, Inventory & Bills
|
- [ ] Vendors, Inventory & Bills
|
||||||
- [ ] Payment Reminders
|
- [ ] Payment Reminders
|
||||||
|
|||||||
1
resources/scripts/components/dropdowns/InvoiceIndexDropdown.vue
Normal file → Executable file
1
resources/scripts/components/dropdowns/InvoiceIndexDropdown.vue
Normal file → Executable file
@ -153,7 +153,6 @@ const utils = inject('utils')
|
|||||||
function canReSendInvoice(row) {
|
function canReSendInvoice(row) {
|
||||||
return (
|
return (
|
||||||
(row.status == 'SENT' || row.status == 'VIEWED') &&
|
(row.status == 'SENT' || row.status == 'VIEWED') &&
|
||||||
route.name !== 'invoices.view' &&
|
|
||||||
userStore.hasAbilities(abilities.SEND_INVOICE)
|
userStore.hasAbilities(abilities.SEND_INVOICE)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -861,7 +861,7 @@
|
|||||||
"component": "Component",
|
"component": "Component",
|
||||||
"Parameter": "Parameter",
|
"Parameter": "Parameter",
|
||||||
"series": "Series",
|
"series": "Series",
|
||||||
"series_description": "To set a static prefix/postfix like 'INV' across your company. It supports character length of up to 6 chars.",
|
"series_description": "To set a static prefix/postfix like 'INV' across your company. It supports character length of up to 4 chars.",
|
||||||
"series_param_label": "Series Value",
|
"series_param_label": "Series Value",
|
||||||
"delimiter": "Delimiter",
|
"delimiter": "Delimiter",
|
||||||
"delimiter_description": "Single character for specifying the boundary between 2 separate components. By default its set to -",
|
"delimiter_description": "Single character for specifying the boundary between 2 separate components. By default its set to -",
|
||||||
@ -870,7 +870,7 @@
|
|||||||
"date_format_description": "A local date and time field which accepts a format parameter. The default format: 'Y' renders the current year.",
|
"date_format_description": "A local date and time field which accepts a format parameter. The default format: 'Y' renders the current year.",
|
||||||
"date_format_param_label": "Format",
|
"date_format_param_label": "Format",
|
||||||
"sequence": "Sequence",
|
"sequence": "Sequence",
|
||||||
"sequence_description": "Consecutive sequence of numbers across your company. You can specify the length on the given parameter.",
|
"sequence_description": "Consecutive sequence of numbers across your company. You can specify the length on the given paramter.",
|
||||||
"sequence_param_label": "Sequence Length",
|
"sequence_param_label": "Sequence Length",
|
||||||
"customer_series": "Customer Series",
|
"customer_series": "Customer Series",
|
||||||
"customer_series_description": "To set a different prefix/postfix for each customer.",
|
"customer_series_description": "To set a different prefix/postfix for each customer.",
|
||||||
@ -878,7 +878,7 @@
|
|||||||
"customer_sequence_description": "Consecutive sequence of numbers for each of your customer.",
|
"customer_sequence_description": "Consecutive sequence of numbers for each of your customer.",
|
||||||
"customer_sequence_param_label": "Sequence Length",
|
"customer_sequence_param_label": "Sequence Length",
|
||||||
"random_sequence": "Random Sequence",
|
"random_sequence": "Random Sequence",
|
||||||
"random_sequence_description": "Random alphanumeric string. You can specify the length on the given parameter.",
|
"random_sequence_description": "Random alphanumeric string. You can specify the length on the given paramter.",
|
||||||
"random_sequence_param_label": "Sequence Length",
|
"random_sequence_param_label": "Sequence Length",
|
||||||
"invoices": {
|
"invoices": {
|
||||||
"title": "Invoices",
|
"title": "Invoices",
|
||||||
|
|||||||
@ -185,10 +185,6 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #cell-expense_date="{ row }">
|
|
||||||
{{ row.data.formatted_expense_date }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #cell-user_name="{ row }">
|
<template #cell-user_name="{ row }">
|
||||||
<BaseText
|
<BaseText
|
||||||
:text="row.data.customer ? row.data.customer.name : '-'"
|
:text="row.data.customer ? row.data.customer.name : '-'"
|
||||||
|
|||||||
@ -151,10 +151,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #cell-payment_date="{ row }">
|
|
||||||
{{ row.data.formatted_payment_date }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #cell-payment_number="{ row }">
|
<template #cell-payment_number="{ row }">
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ path: `payments/${row.data.id}/view` }"
|
:to="{ path: `payments/${row.data.id}/view` }"
|
||||||
@ -165,7 +161,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #cell-name="{ row }">
|
<template #cell-name="{ row }">
|
||||||
<BaseText :text="row.data.customer.name" :length="30" tag="span" />
|
<BaseText
|
||||||
|
:text="row.data.customer.name"
|
||||||
|
:length="30"
|
||||||
|
tag="span"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #cell-payment_mode="{ row }">
|
<template #cell-payment_mode="{ row }">
|
||||||
|
|||||||
@ -163,7 +163,7 @@
|
|||||||
>
|
>
|
||||||
<div class="flex-2">
|
<div class="flex-2">
|
||||||
<BaseText
|
<BaseText
|
||||||
:text="payment?.customer?.name"
|
:text="payment?.customer?.name "
|
||||||
:length="30"
|
:length="30"
|
||||||
class="
|
class="
|
||||||
pr-2
|
pr-2
|
||||||
@ -219,11 +219,11 @@
|
|||||||
text-right text-gray-900
|
text-right text-gray-900
|
||||||
"
|
"
|
||||||
:amount="payment?.amount"
|
:amount="payment?.amount"
|
||||||
:currency="payment.customer.currency"
|
:currency="payment?.currency"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="text-sm text-right text-gray-500 non-italic">
|
<div class="text-sm text-right text-gray-500 non-italic">
|
||||||
{{ payment.formatted_payment_date }}
|
{{ paymentDate }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|||||||
@ -386,8 +386,8 @@ function removeComponent(component) {
|
|||||||
function onUpdate(val, element) {
|
function onUpdate(val, element) {
|
||||||
switch (element.name) {
|
switch (element.name) {
|
||||||
case 'SERIES':
|
case 'SERIES':
|
||||||
if (val.length >= 6) {
|
if (val.length >= 4) {
|
||||||
val = val.substring(0, 6)
|
val = val.substring(0, 4)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'DELIMITER':
|
case 'DELIMITER':
|
||||||
|
|||||||
Reference in New Issue
Block a user