Achieving Advanced Data Insights: One-to-Many Table Relationships and Field Calculations

  Рет қаралды 1,654

PHP Runner Tips And Tricks

PHP Runner Tips And Tricks

Күн бұрын

Пікірлер: 42
@imranminhas1947
@imranminhas1947 Жыл бұрын
Thanks! you made my day; I was looking for such approach. what a gr8 video and very useful information for a beginner someone like me. Thanks!
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
Thank you very much. You are most welcome.
@TheAlgonmusic
@TheAlgonmusic Жыл бұрын
I hope you and your family are ok as no new videos lately Thanks for giving us this “amazing “ tutorials thanks very much
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
Yes, I know. Tutorials are not the only thing I do. I wish it were. Nevertheless, I am working on more content.
@TheAlgonmusic
@TheAlgonmusic Жыл бұрын
Good to know you are ok 👍
@rizwanmtc
@rizwanmtc Жыл бұрын
dear thank for this video, now you are moving from basic to advance level topics in PHPRUNNER.
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
You are welcome
@robgee7149
@robgee7149 Жыл бұрын
Thank you, I really appreciate your video. I implemented it into a new project. A problem I've found though is that, sometimes the sums are wrong. I have a record with a unit price of 25.83. I set a qty of 4. The sums on screen are perfect there in the unsubmitted record (103.32). When I open up the record again, the total is 103.30. Any idea as to why it works round down the total in the saved record? Thanks Rob
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
It could be that the database field is created for one decimal only. Or something similar. Perhaps a setting in PHPRunner. The number of decimals.
@robgee7149
@robgee7149 Жыл бұрын
Solved it. My fields were only 5 character varchar . Upped them to 8 character and voila, worked perfectly.
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
@@robgee7149 I would go for double or decimal 11,2. But if it's working then it's probably fine.
@mitro922
@mitro922 Жыл бұрын
Very good 👍
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
Thank you very much
@swansidepaul
@swansidepaul Жыл бұрын
Thank you so much. I can get it working by copying the tables and code as in the video, but can you put some light on why when I add another field I cant get it to update? For example, I have added an extra field called VATAmount. Now when I update the order_details, the original Order Total does nothing, but my new field VATAmount updates. So I am guessing what do I need to find to ensure the correct values go into the correct field? // Update order_totals var orderDetailsTable = 'order_details'; function setOrderTotal ( value, pageObj ) { console.log(value); //update totals. Field in Master Table. if(value > 0){ document.getElementById("value_order_total_1").value = parseFloat(value).toFixed(2); }else{ document.getElementById("value_order_total_1").value = 0.00; } } function updateOrderTotal( pageObj ) { var detailsPage = pageObj.getDetailsPage(orderDetailsTable); if( !detailsPage ) return; var records = detailsPage.getAllRecords(); // actual calculation. Multiply Quantity by UnitPrice and sum the results. // total = sum( Quantity * UnitPrice ) var total = 0; records.forEach( function( r ) { total += ( parseFloat( r.getFieldValue('quantity') ) || 0 ) * ( parseFloat( r.getFieldValue('unit_price') ) || 0 ); }); setOrderTotal( total, pageObj ); } // Update VAT var orderDetailsTable = 'order_details'; function setOrderTotal ( value, pageObj ) { console.log(value); //update totals. Field in Master Table. if(value > 0){ document.getElementById("value_VAT_1").value = parseFloat(value).toFixed(2); }else{ document.getElementById("value_VAT_1").value = 0.00; } } function updateOrderTotal( pageObj ) { var detailsPage = pageObj.getDetailsPage(orderDetailsTable); if( !detailsPage ) return; var records = detailsPage.getAllRecords(); // actual calculation. Multiply Quantity by UnitPrice and sum the results. // total = sum( Quantity * UnitPrice ) var total = 0; records.forEach( function( r ) { total += ( parseFloat( r.getFieldValue('quantity') ) || 0 ) * ( parseFloat( r.getFieldValue('unit_price') ) || 0 ) * ( parseFloat( r.getFieldValue('VATAmount') ) || 0 ); }); setOrderTotal( total, pageObj ); } Thanks
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
I can see you changed the updateOrderTotal function to include VAT amount. I don't see anything wrong here. The function setOrderTotal should have worked without any changes. Perhaps you are trying something else. I will add the same field to my project. I will let you know.
@paulgrimes8556
@paulgrimes8556 Жыл бұрын
@@PHPRunnerTipsAndTricks Thank you very much.
@paulgrimes8556
@paulgrimes8556 Жыл бұрын
@@PHPRunnerTipsAndTricks Hi. Did you get it to work with the extra field? I have tried a few different things but no such luck at the present
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
@@paulgrimes8556 I have not tried it as of yet. I have a bit of a family crisis. My mom has been in a coma for three weeks already. I will get back to this ASAP
@paulgrimes8556
@paulgrimes8556 Жыл бұрын
@@PHPRunnerTipsAndTricks oh I so very sorry. I hope and pray she pull through for you. Sending hugs and prayers from us
@MiezoT
@MiezoT Жыл бұрын
It's great but I personally still don't like to store the total like this, to paranoid of it going out of sync when something breaks, lol. I'd probably work with more complicated queries (subqueries etc) on the master and calculate the total there on the fly and not storing this derived value, but that's just me;-)
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
Perhaps. This example is straight from the manual. It surely cannot be that bad. xlinesoft.com/phprunner/docs/show_order_total_on_the_edit_page_as_the_details_table_is_updated.htm
@MiezoT
@MiezoT Жыл бұрын
@@PHPRunnerTipsAndTricks yes of course. I'm just old school, and would - in such cases - paranoically implement some batch job for periodical consistency checks;-)
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
@@MiezoTYes, I hear you. In a way, I am old school too. The batch job solution is a promising idea. You know it will work every time.
@MiezoT
@MiezoT Жыл бұрын
@@PHPRunnerTipsAndTricks I'm not working on a phpr project at the moment, but was just wondering (you don't need to answer): can you just requery/refresh a field in the master table upon change in a child's record? Then one could do something like that with a db-trigger. Problem is always UI ;-)
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
@@MiezoTHonestly, I don't know. I don't think you can. You will have to refresh the entire record. And that is a bad idea as you may lose input already given by the user. I will have to investigate more.
@rizwanmtc
@rizwanmtc Жыл бұрын
i have a issue on add page a lookup fields show but hide at once please guide,
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
Apologies. I don't understand the question.
@rizwanmtc
@rizwanmtc Жыл бұрын
@@PHPRunnerTipsAndTricks thank do reply I just remove the table build and again add the table its now ok
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
@@rizwanmtc Perfect.
@mitro922
@mitro922 Жыл бұрын
Hi Corrie How to generate Microsoft word file using phprunner..You can make a video explaining this
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
You can do this with jQuery. see link to plugin: www.jqueryscript.net/other/Export-Html-To-Word-Document-With-Images-Using-jQuery-Word-Export-Plugin.html
@PHPRunnerTipsAndTricks
@PHPRunnerTipsAndTricks Жыл бұрын
Do you need more help?
@mitro922
@mitro922 Жыл бұрын
@@PHPRunnerTipsAndTricks thank you very much
@mitro922
@mitro922 Жыл бұрын
@@PHPRunnerTipsAndTricks It is possible to make a video showing how to work in an environment phprunner
@leviatanMX
@leviatanMX Жыл бұрын
EXCELENT.... BUT, i have a question.!🧐🧐🥸 How does PHPRunner control the update of related tables and wrap them in a transaction, so that everything is updated or if there are failures nothing is updated.
Dev 31 SOQL
35:16
GarfTech
Рет қаралды 11
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Nested One To Many Relationships On Dashboard: Part 2
13:45
PHP Runner Tips And Tricks
Рет қаралды 1,5 М.
Conditional Regular Expression | PHPRunner and ASPRunner.NET
13:36
PHP Runner Tips And Tricks
Рет қаралды 1,2 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 222 М.
PHP Runner Version 10.4 Group By Improvements in charts
6:29
PHP Runner Tips And Tricks
Рет қаралды 6 М.
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 94 М.
Three sophisticated website dashboard filtering methods. No coding required!
6:40
PHP Runner Tips And Tricks
Рет қаралды 2,6 М.
Hibernate & JPA Tutorial - Crash Course
24:27
Marco Codes
Рет қаралды 119 М.
PHP Runner V10.3 - Calculated Fields
10:56
PHP Runner Tips And Tricks
Рет қаралды 20 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН