Compare commits
5 Commits
e1f579c7fd
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2605899348 | |||
| de3c815532 | |||
| 922016020a | |||
| 0ab8debd2e | |||
| 0a4089fe14 |
@@ -71,7 +71,6 @@ jobs:
|
|||||||
severity-cutoff: critical
|
severity-cutoff: critical
|
||||||
registry-username: ${{ vars.LOCAL_REGISTRY_USER }}
|
registry-username: ${{ vars.LOCAL_REGISTRY_USER }}
|
||||||
registry-password: ${{ vars.LOCAL_REGISTRY_PASS }}
|
registry-password: ${{ vars.LOCAL_REGISTRY_PASS }}
|
||||||
grype-version: 'v0.90.0'
|
|
||||||
|
|
||||||
- name: Inspect file
|
- name: Inspect file
|
||||||
run: cat ${{ steps.scan.outputs.table }}
|
run: cat ${{ steps.scan.outputs.table }}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class InvoiceitemController extends Controller
|
|||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'description' => 'nullable|string',
|
'description' => 'nullable|string',
|
||||||
'article_number' => 'nullable|string',
|
'article_number' => 'nullable|string',
|
||||||
|
'sort' => 'required|numeric|min:0',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$item = $invoice->items()->create($itemData);
|
$item = $invoice->items()->create($itemData);
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class Invoice extends Model
|
|||||||
*/
|
*/
|
||||||
public function items(): HasMany
|
public function items(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Invoiceitem::class);
|
return $this->hasMany(Invoiceitem::class)->orderBy('sort');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class Invoiceitem extends Model
|
|||||||
'total',
|
'total',
|
||||||
'name',
|
'name',
|
||||||
'description',
|
'description',
|
||||||
|
'sort'
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.4",
|
"php": "^8.4",
|
||||||
"barryvdh/laravel-dompdf": "^3.0",
|
"barryvdh/laravel-dompdf": "^3.0",
|
||||||
"laravel/framework": "^11.31",
|
"laravel/framework": "^12.0",
|
||||||
"laravel/sanctum": "^4.0",
|
"laravel/sanctum": "^4.0",
|
||||||
"laravel/tinker": "^2.9",
|
"laravel/tinker": "^2.9",
|
||||||
"phpoffice/phpspreadsheet": "^3.8",
|
"phpoffice/phpspreadsheet": "^3.8",
|
||||||
|
|||||||
1345
composer.lock
generated
1345
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -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('invoiceitems', function (Blueprint $table) {
|
||||||
|
$table->integer('sort')->default(0)->after('invoice_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('invoiceitems', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('sort');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -1091,9 +1091,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001696",
|
"version": "1.0.30001741",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001741.tgz",
|
||||||
"integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==",
|
"integrity": "sha512-QGUGitqsc8ARjLdgAfxETDhRbJ0REsP6O3I96TAth/mVjh2cYzN2u+3AzPP3aVSm2FehEItaJw1xd+IGBXWeSw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -655,6 +655,7 @@
|
|||||||
for (let i = 0; i < self.items.length; i++) {
|
for (let i = 0; i < self.items.length; i++) {
|
||||||
let pos = sort_flipped[i];
|
let pos = sort_flipped[i];
|
||||||
let item = self.items[pos];
|
let item = self.items[pos];
|
||||||
|
item.sort = i;
|
||||||
const result = axios.post('invoice/' + self.invoice_id + '/item', item)
|
const result = axios.post('invoice/' + self.invoice_id + '/item', item)
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
self.error = true;
|
self.error = true;
|
||||||
|
|||||||
@@ -662,6 +662,7 @@
|
|||||||
for (let i = 0; i < self.items.length; i++) {
|
for (let i = 0; i < self.items.length; i++) {
|
||||||
let pos = sort_flipped[i];
|
let pos = sort_flipped[i];
|
||||||
let item = self.items[pos];
|
let item = self.items[pos];
|
||||||
|
item.sort = i;
|
||||||
const result = axios.post('invoice/' + self.invoice.id + '/item', item)
|
const result = axios.post('invoice/' + self.invoice.id + '/item', item)
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
self.error = true;
|
self.error = true;
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
<cbc:PayableAmount currencyID="{{ $invoice->currency_code }}">{{ $invoice->sum }}</cbc:PayableAmount>
|
<cbc:PayableAmount currencyID="{{ $invoice->currency_code }}">{{ $invoice->sum }}</cbc:PayableAmount>
|
||||||
</cac:LegalMonetaryTotal>
|
</cac:LegalMonetaryTotal>
|
||||||
@foreach($invoice->items as $item)
|
@foreach($invoice->items as $item)
|
||||||
<cac:InvoiceLine>+
|
<cac:InvoiceLine>
|
||||||
<cbc:ID>1</cbc:ID>
|
<cbc:ID>1</cbc:ID>
|
||||||
<cbc:InvoicedQuantity unitCode="C62">{{ $item->amount }}</cbc:InvoicedQuantity>
|
<cbc:InvoicedQuantity unitCode="C62">{{ $item->amount }}</cbc:InvoicedQuantity>
|
||||||
<cbc:LineExtensionAmount currencyID="{{ $invoice->currency_code }}">{{ $item->amount * $item->price * (100 - $item->discount) / 100 }}</cbc:LineExtensionAmount>
|
<cbc:LineExtensionAmount currencyID="{{ $invoice->currency_code }}">{{ $item->amount * $item->price * (100 - $item->discount) / 100 }}</cbc:LineExtensionAmount>
|
||||||
|
|||||||
Reference in New Issue
Block a user