Is there a way by which I can programmatically update a select options list of LineItems?
I am trying to create Line Items from data provided by site administrators.
If you refer to http://178.79.128.76/coronet/node/78, you will see 4 types of data: The Viewing date, The Viewing options, Add to cart button and Show Times.
The Show Times data is unique for each product. Each entry consists of a date and one or more time(s).
The Viewing Options is a line item and I am trying to populate it with data extracted from the Show Times field in the following format:
Viewing Date 1 + ShowTime 1
Viewing Date 1 + ShowTime 2
Viewing Date 2 + ShowTime 1
Just for demonstrating my objective, I populated the example data above in my Viewing Options Line Item using hook_form_alter - they don't actually work when you select and attempt to add the product to.
You can have your tables set up with LineItem table, a ViewDate table and a ShowTimes table. That will allow you to have a ViewDate collection with a foreign key to the LineItem, and a ShowTimes collection with a foreign key to the ViewDate.
Related
I have created a user form for adding inventory.
I have 2 combobox in the form
Category = combobox1 (housekeeping, Electricals, Cafetria etc) for these categories I am populating combox1 with rowsource property
Itemsname - combobox2 - I want to populate this combobox based on the category selected in combobox 1
The problem I am facing is the items name repeat if there are more than 1 itemsname then all items name show up in the combobox2 which i dont want. I want to see unique values. I will give you example of entries
ColumnA(Category) ColumnB(itemsname) ColumnC (Vendorname)
Cafeteria Beans Cafe Coffee Day
Housekeeping liquid soap Sevak Industries
IT Monitors Infotech solutions
IT Keyboard Infotech solutions
IT Monitors Raj computers
see screenshot the above columns gets messed up : https://prnt.sc/10cbh30
Now in the above example I populate categories combobox 1 with unique values because number of categories are fixed so I have saved them separately and I pick them with rowsource
The main problem arises when I populate combobox 2 with items name. Same Item can be bought from different vendors so Monitors we are buying from different vendors so there are two entries. In combox 2 I see 2 entries of monitors but I want to see only one since the name is same.
Note I am using for loop and adding items in the loop in combobox 2 so it scans each entries of monitor twice so it adds up monitor twice
Can anyone help on this I am frustrated I cant figure out how to get unique values
I have a form response sheet with different columns. I have a region column for every country. But when you respond to the form you have to select only one country. So in my sheet every row has only one country column filled. I would like to filter every row (and populate to automatically have new responses filtered) to have a new column with the region selected.
Sheet expected
In this case I only have 3 countries but in the real case I have about 40 countries.
Thanks for your help
try on row 1:
=ARRAYFORMULA(TRIM(TRANSPOSE(QUERY(TRANSPOSE(A:C);;999^99))))
I am creating a SSRS report. I am using 2 datasets. I use 1 dataset to show a dropdown list of paramets and the 2nd dataset to show a relevant table. This is working great.However, I am trying for my report to show first column from Dataset1 (that i use as a parameter for dropdown) and the remaining columns from dataset 2 that are related. I have added column and inserted the expression for lookupset but that does not seem to help (it returns a blank column). I would appreciate any feedback to include 2 datasets in 1 report.
What I have right now:
Dataset1 - pulls a list of unique providers - shows that as a dropdown list.
Dataset 2- pulls 2 random clients related to that unique provider in dropdown list and gets displayed in a table form.
I am trying to create a report where the user will have the ability to pick "all" from the provider parameter dropdown and then the report will show entire list of distinct providers and 2 random clients that are related to the provider.
cloumn 1(dataset1) Column 2 (Dataset2)
Provider1
random client 1
random client 2
Provider2
random client 1
random client 2
provider3........
I have shop struct like
1: Shop has many Categories
2: Categories have 1 to many Sizes and Products
3: Each product belongs to exactly one Category
4: As Sizes belongs to Categories so each product belonging to a category will have same sizes.
Now my problem is in Product add form.
I have form the contains product's input fields and a selectbox to select the Category.
As soon as I select a category, an Ajax request will be created, which return sizes as inputbox assigned to the selected category. The input boxes will be used to enter the price
for each size of the product. (As the input fields will be generated in Ajax, how may i use the form helper?)
Now I want that on clicking the save button, the product information should be stored in product table, and the prices should be saved in
Product_Prices table which contains product_id, size_id, price columns.
How should i name my inputboxs? and how should i call the save method so that the informations are properly saved?
To save one-size
//$this->Form->create('Product');
$this->Form->input('category_id');
To save many-size
//$this->Form->create('Shop');
$this->Form->input('category_id');
or use checkbox instead list
$this->Form->input('category_id', array('multiple' => 'checkbox'));
If you want to save property of another model together with you main model you add model name (alias) as prefix and use saveAssociated() or saveAll().
echo $this->Form->input('ProductPrice.price');
see: http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-saveall-array-data-null-array-options-array
In my MVC 3 project, I am looking to select a row in a table displaying values from a database, choose a radio button representing a value and press "Confirm". I then want a row to be added to a ClientPayments table with the payment amount as the radio button value (and the other values in the other columns of ClientPayments). I also want the status in an Invoices table to change to "Confirmed".
Here's a link to a screenshot to illustrate what I want to do.
I have all the models and the views created, but I am not sure how to select the row and use the radio buttons to update the DB.
This is one of the radio buttons I have coded:
Private Lesson (1 Hour) #Html.RadioButton("InvoiceAmount", "640", true)
Any assistance would be greatly appreciated.
If you have something like #Html.RadioButton("InvoiceAmount", LineId, true) (where LineId is the key value from model) then you will get the selected row in your Post action. From there you can either add it to your client payment object, and do whatever else you need to do!