Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-j 51
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-j 51
22_23-j 51
Commits
fd3d491d
Commit
fd3d491d
authored
Feb 07, 2023
by
Udaya Aththanayaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new audit
parent
683e5c63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
fuel-sliit-bakend-main/app/Http/Controllers/AuditController.php
...liit-bakend-main/app/Http/Controllers/AuditController.php
+27
-0
No files found.
fuel-sliit-bakend-main/app/Http/Controllers/AuditController.php
View file @
fd3d491d
...
...
@@ -39,6 +39,33 @@ class AuditController extends Controller
return
response
()
->
json
([
'response'
=>
$response
]);
}
// This function for create a new Audit
public
function
create_audit
(
Request
$req
){
$fueltype
=
Fueltype
::
find
(
$req
->
fueltype_id
);
$audit
=
new
Audit
;
$audit
->
qty
=
$req
->
qty
;
$audit
->
amount
=
$fueltype
->
price
*
$req
->
qty
;
$audit
->
user_id
=
$req
->
user_id
;
$audit
->
vehicle_id
=
$req
->
vehicle_id
;
$audit
->
station_id
=
$req
->
station_id
;
$audit
->
fueltype_id
=
$req
->
fueltype_id
;
$audit
->
save
();
$fuelcapacity
=
Fuelcapacity
::
where
(
'fueltype_id'
,
$req
->
fueltype_id
)
->
where
(
'station_id'
,
$req
->
station_id
)
->
first
();
$fuelcapacity
->
update
([
'current_qty'
=>
$fuelcapacity
->
current_qty
-
$req
->
qty
,
]);
$queue
=
Queue
::
find
(
$req
->
qid
);
$queue
->
update
([
'status'
=>
1
,
]);
$message
=
'success'
;
return
response
()
->
json
([
'message'
=>
$message
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment