Laravel Product List Update - counting

How can we decrease the Quantity of Products in laravel list table?
For example, I have a list of itens and its respectively quantities,
Then when I want to use some products, the Quantity must decrease.
For example, I have an Iten named Note Books with initiali have
10 itens, then I want to take 5 of them, its probably will decrease
the Original quantity.
So I want to know can we implement this in Laravel!
My project is about Inventory Management System.
This is my form, all I want is when I put a number >=8 at Kuantidade in the Transasaun no Atualizasaun season the Kuantidade Stock in Lista Sasan must to decrase

Related

How to display the regular price in the order items table in the admin

This is the sale price that is displayed (excluding the VAT) in addition to the quantity and the total price and the VAT, for each item in the order items table.
I would like to display the regular price and the discount of the product item.
I checked in the WC_Order_Item_Product, but I could not find the information and I do not want to retrieve it from the related product attributes because that information can change.
I want the information that was active when the order was created.
I searched on this site and and googled a lot but could find any information. Is it even possible ?

WooCommerce stock per attribute

I have a technical problem with the WooCommerce plugin that I can't seem to find an answer for.
I got a variable product that has two different times for workshops.
So an example to simplify:
Product: Event day ticket
Workshop 1: Red | Blue | Green
Workshop 2: Red | Blue | green
On workshop 1, every attribute needs to have 5 stock but on workshop 2 every attribute needs to have 10 stock.
I can make combination variables but if I do that, every combination has it's own stock. Not the attribute itself.
Any idea on how to work with issue?
I hope I explained it well enough.
I ran into something similar and the answer is a Variable Product with addons (one option is WooCommerce's own plugin # https://woocommerce.com/products/product-add-ons/). You'd create Workshop as a variable attribute, then create product variations and set each Workshop's total number of tickets in the variations. Then create product addons for Red, Blue, and Green (you can set the cost of addons to any value including 0). That should give you the result you're seeking.
Attributes define available "options" (like colors as you have it) but you need to set the product to be a variable product (the default is simple product) using the dropdown at the top of that configuration section. Then, on the attributes section, check the box to use the attributes as variations. Finally, on the variations tab, create the variations from attributes.
Now, you can set stock levels, prices, and more for each variation of the product where a variation is a single or combination of attributes.
Note: You may need to go into the Woocommerce settings and check the box to manage inventory at the variation level. This is from memory so I don't recall if it's in the Woocommerce settings or an option when you switch the product to variable.

Query on use of aggregate functions over recursive groups in microsoft report designer

I have to point out that I'm fairly new to reporting outside of Microsoft Access, and new to the site, so please bear with me!
Stripped down to essential items, my data object has:
CategoryID, ParentCategoryID, TransactionID, TransactionDate, SplitID, CurrencyID and Value.
I don't think this is relevant, but just in case -
A Split has a Category and a Value, with one to many belonging to a Transaction.
Multiple Splits may exist for the same Category & Transaction with
different, or the same, Value (to support different combinations of the other data
items I haven't listed).
A Transaction has a TransactionDate and a CurrencyID, so all Splits
belonging to a Transaction are for the same Currency.
A Category belongs to a Category recursively.
A Split may be assigned a Category at any level in the recursive hierarchy and the crux of my problem is to report Transaction / Split detail under the appropriate Category heading, with a sub-total to include all those details AND the totals of all child Categories.
So, I have a Detail row group holding all the ancilliary data items that aren't relevant and a TransactionIDGroup row group on the same row. I then have a CategoryGroup row group based on CategoryID with a Parent of ParentCategoryID to handle the recursive nature of the data and a CurrencyIDGroup column group to handle the possible multiple currencies involved.
Also in the CategoryIDGroup row group is a total row with the Value cell holding an expression.
If I leave that expression as =Sum(Fields!AccountValue.Value), the report quite nicely totals the Value for each Currency column for all the details specifically in each Category (the default scope), so I thought I needed to make the Sum 'Recursive'. However, you don't seem able to specify the optional Recursive parameter without specifying the scope as well.
If I specify scope as CategoryIDGroup, I get all zero sub-totals. If I use CurrencyIDGroup I get each one being the same report total for the Currency. Anything else either gets me a build error or a combined-currency report total.
The other issue I have is that the recursive child Category groups are reported sequentially underneath the parent Category group (so, outside the header row, detail rows and total row, and not within the group. However, if I can get the total to reflect the children as well as the details at that level, I'd be happy enough, even though it wouldn't seem to add up until you realised what was going on.
What I have in mind is something like:
Category A
Transaction 1 10/02/2011 ...................... £100.00
---------------------- £14.50
Transaction 2 18/03/2011 ...................... $159.34
Category Ai
Transaction 3 18/06/2011 ---------------------- £295.60
Total Category Ai £295.60
Total Category A £410.10 $159.34*
But what I get is this:
Category A
Transaction 1 10/02/2011 ...................... £100.00
---------------------- £14.50
Transaction 2 18/03/2011 ...................... $159.34
Total Category A £114.50 $159.34*
Category Ai
Transaction 3 18/06/2011 ---------------------- £295.60
Total Category Ai £295.60
I guess the fundamental question is - am I asking the impossible? Do I need to take a different approach, perhaps with sub-reports for the details? I've wondered about including a Sum of the values of the child Categories within the data object at each Category level, but is there something simple I'm missing?
Any pointers in the right direction would be greatly appreciated after several days tearing my hair out :)
I have no idea whether there was something simple I missed, but resolved the issue to my satisfaction by including another property in the data object, being the sum of all child categories for each currency, and including a new row to print the sum of that field. Just in case someone else hits just the same question!

Access Report - Can't add a sum for a calculated currency column

I've generated a simple access report that is used for purchasing.
Basically, there are two tables, one for purchase orders, and one for the items on the purchase orders.
For the items on an order, I store the item details, quantity ordered, quantity delivered, and price per unit. (plus a few other fields which aren't relevant in the context of this question).
I'm generating a report to list all outstanding items still on order, and the report has a calculated field showing the outstanding quantity * cost per item. This works perfectly fine.
What I'm struggling with, is showing a sum of this calculated field (i.e. a total cost of all outstanding items), but when I try to add a total to the column, it only gives me the option of adding an item count for the column. The column is a 'Currency' field.
What might I be doing wrong, or am I expecting too much from access?
Resolved. I created the only option that the GUI would allow (item count), then modified the query from:
=Count(*)
to
=Sum([Quantity]*[Cost])
Works perfectly.

In Drupal 6 how do i automatically create CCK fields on a node when a new node of a referenced node type is created?

I'm using Drupal 6 and Views 2, along with CCK, Panels and Node Relationships. (so far)
I have two basic content types defined:
User Profile (using Content Profile module)
Product
Each of these content types has a node reference to two other content types, Tier and Commission:
User Profile content references "Tier" content
Product content references "Commission Category" content
There may be 5-10 of each of these, and up to 100 of each of users/products.
When a Commission Category is added, dollar values need to be added for each currently existing Tier node.
When a Tier node is added, dollar values for this Tier need to be added to each currently existing Commission Category node.
The desired effect is that users with a "staff" role can administrate both Tiers of users and Categories of Product.
Users will see a value when they view a product that is displayed as a combination of both their Tier and the Commission Category.
For Example:
Category A => Tier 1 ($100), Tier 2 ($200), Tier 3 ($300)
Category B => Tier 1 ($120), Tier 2 ($250), Tier 3 ($300)
Is there a way to do what I'm suggesting? or do I need to try a different approach altogether to achieve the desired effect?
I assume that you also want to be able to later edit those amounts from either the Tier node page or the Commission Category node page.
To make those values easier to manage, you will probably need to create another content type (called Commission for example) which references a Tier and a Commission Category, and holds a dollar value.
What I would do then is to use hook_form_alter() so that in the Tier form, an input field is added for each Commission Category. That way, whenever you add a new Tier (or edit an existing one), you can update all those values at once. Use hook_nodeapi() to insert/update all of the corresponding Commission nodes.
Then you can do the same thing for the Commission Category form, but in the other direction.
If you expect to have a large number of tiers or categories, this may be a heavy operation, but otherwise it should be fine since I'm assuming you wouldn't be changing these values that frequently.

Resources