Laravel: Pivot Table, ManytoMany - laravel

I have been stuck on this since May 2020. I don't know how to move forward with the project. Any link or guidance would be very much appreciated. I'm trying to create a very simple rental system.
I have a Customer table: id, Name, Barcode
Another one is Item table: id, Name, Barcode, OnLoan
I'm trying to create a Form where there is a search box for Customer and search box for the Items. When the customer barcode is found and item barcode is found, you can fill in the Date Loaned and Date Due and click submit.
In the Item table, the OnLoan needs to be set to 1.
How do we do this please? Any link or keywords to help me on my way would be really great.
I have been googling and found out about onetomany, manytomany, pivot, scope, repositories. It's very overwhelming, i'm trying to go over them one at a time.

Related

Libreoffice-base subform_sales_desc inside form_order . first form cannot enter items as number and show as names and not gst,unit etc automatically

I am creating free accounting package in libreoffice-base to compete already available ones your contribution is appreciated. the package include tables:
items
item_groups
order_details
sales_bill_desc
cash
units
companyinfo
bill sales
Customer_ledger
etc.
and created two forms
first to enter items in items table with following fields:
id
List item
particulars
units from units table linked with id gst chooses from
tax table related as id basic price basic stock, barcode, group,
subgroup,
second form is sales bill entry form
it contains a form which relates to order_details table selects customers name from ledger where its state code is also defined e.g. for punjab its 03 basically it is picked from customer's GSTIN number
a subform which is connected to sales_bill_desc table related to order_details table with bill number in both tables.
now in subform when we enter one item, its name is displayed which is same entered in sales_desc table additionally it also need automatically display item units, gst, price(editable field but basic price must be displayed there).but it does not. how to do that i have studied books but am lacking i created same in access 2016 somewhere which worked fine (full working package accounts with inventory).At this time,I am trying to use same database but advanced with features such as barcode. Of course the issue is to be resolved if someone can help. I am loading code of the package.Please rectify and update.

Make names not selected, anonymous

Please help, I am building a power bi report, where I have to reference a table I created for a different name for a Supplier.
E.g. if on Supplier slicer I select supplier A, then all other suppliers shown on that table should change automatically
The View I want
In reality the data would look like
But there would be a slicer where I select the supplier name who I am presenting to, but dont want them to view competitor names , only competitor results, without having to make these changes manually in excel.
THANK YOU GUYS

Any way to intercept an error message and make more user friendly?

I have looked for an answer here among other places but havent quite been able to find what I need to know.
I have 3 tables, Order_Details, Products_Ordered and Product_Details. The first two are being used in a master detail form to show the order and the items ordered together. The Products_Ordered table has a composite primary key made from two foreign keys, the first being the primary key from the Order_Details table, and the second being the primary key from the Product_Details table. Together they ensure that a type of product can only be added to an order once. If someone wants to order more than one product then the quantity field in the record can be altered to reflect this. All that seems fine so far.
My issue is that when adding products to the order in the master detail form i have used a drop down list of values to select the product to add to the order. the display value for this is the product name and the return value for it is the primary key for the product from the Product_Details table.
I like this because its easier for the user to simply select the product and add a quantity of it to the table. And it works fine for both insert and update operations apart from one situation.
If the user selects the same product in to rows then submits the table the database then tries to add the product to the order twice, throwing a "ORA-00001: unique constraint violated." error. Obviously this is because of the product ID being used in the primary key of the table.
I don't want to allow the user to add two records to the table like that, rather id like to force them to alter the quantity field accordingly. The error message that comes up isn't very user friendly so my question is how can I detect this error and display a more user friendly one instead telling them to alter the quantity field instead?
*If this isn't possible then is there a way that I can hide any already selected products from the dropdown list of values in the following table rows? I haven't looked into this too much because surely it would get complicated when the user tries to add more rows than products available in the dropdown and there are no more products values to show?
I am quite new to this so please be nice. Any help is greatly appreciated :D
Here is a link where all is nicely described:
https://docs.oracle.com/cd/A97630_01/appdev.920/a96624/07_errs.htm
Section
Predefined PL/SQL Exceptions
in combination with:
Defining Your Own PL/SQL Exceptions
and
Defining Your Own Error Messages: Procedure RAISE_APPLICATION_ERROR
Hope it helps...

Creating a Search Box/Data - Joomla v1.5.25

I need help on Joomla v1.5.25, I already have it running and everything seems fine.
I wish to add a list of data for example a list of KFC Outlets, and enable a search box so that visitors can just key in the City Name of the KFC outlet that they are looking for and the result will be a list of KFC Outlets matching the City Name keyed in.
Apologize if this question have been asked previously, and I am new to this. Hope someone can shed some light or point me to the proper site for this question.
Thanks
Either you can use some1else's work - I suggest
Check out http://www.kfc.com/storelocator/Default.aspx?address=new%20york
And take the results on that page
This is only good for USA - if you need all countries then you will need to go through all their sites and collect results for all the pages.
or you should:
create a new table in mysql each row should have info about a kfc outlet (address, phone, open hours, etc...)
create a new joomla component or module in which you should have your sql select query to search and then return the list of results.
You can then create a form on any page for searching

Creating a Relationship Between Order Product (salesorderdetail) and Service Activity (serviceappointment)

We are using Microsoft CRM 4.0 to run a consulting business. Its working pretty well but we want to simplify the way we are doing some things. What we want to do is create an Order (salesorder) with multiple Order Products (salesorderdetal). So good so far.
Next I want to be able associate each Order Product (salesorderdetail) with a Service Activity (serviceappointment), this representing that this billable line item in the order is actually going to be fulfilled as a consuting engagement.
The problem is, I can't seem to be able to create an association between the Order Product (salesorderdetail) and Service Activiy (serviceappointment). It simply doesn't appear in the drop downlist.
Can anyone think of a reason for this? I've seen some posts about relating field mapping between Quote Product, Order Product, Opportunity Product and Invoice Product, but that isn't quite what I am after.
Any suggestions gratefully received - even if it is an explaination of why its not possible.
I created a simple 1:N mapping from Case to Invoice. The Case records its ID and Title in custom fields in the Invoice. Unfortunately this does not allow for product creation as children of the Invoice, so that should be created as a custom code workflow.

Resources