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