Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MRP > Create Purchase Order(s) - SOLVED
01-26-2018, 11:12 PM (This post was last modified: 02-16-2018 10:37 PM by VortecCPI.)
Post: #1
MRP > Create Purchase Order(s) - SOLVED
MRPPlannedPurchaseOrders.php

It sure would be nice if we had an interface similar to MRPPlannedWorkOrders.php in which we could preview suggested Purchase Orders and then have an option to create them as we can with Work Orders.
Also... There are some small inconsistencies between MRPPlannedPurchaseOrders.php and MRPPlannedWorkOrders.php that should likely be reconciled.

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
01-28-2018, 07:31 AM (This post was last modified: 01-28-2018 07:32 AM by VortecCPI.)
Post: #2
RE: MRP > Create Purchase Order(s)
Here is my shot at it for now.

We still need to reconcile minor differences between MRPPlannedPurchaseOrders and MRPPlannedWorkOrders and this file does not.

Just a sort of proof-of-concept...


Attached File(s)
.php  MRPPlannedPurchaseOrders.php (Size: 19.41 KB / Downloads: 2)

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
01-28-2018, 11:23 AM (This post was last modified: 01-28-2018 11:35 AM by VortecCPI.)
Post: #3
RE: MRP > Create Purchase Order(s)
Another try while trying to reconcile code and adding link to convert to PO...

   


Attached File(s)
.php  MRPPlannedPurchaseOrders.php (Size: 19.41 KB / Downloads: 1)

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
02-05-2018, 07:28 AM (This post was last modified: 02-05-2018 07:34 AM by TurboPT.)
Post: #4
RE: MRP > Create Purchase Order(s)
Paul, between the two files in posts 2 and 3, the changes have been committed to SVN.

I applied a few minor changes above yours:
  1. Wrapped the URL link parameters with urlencode()
  2. Removed unused $db references from GetPartInfo() and DB_query()
  3. Reduced a few echo calls. (combined output with other existing echo statements)
  4. Added handling that adds an empty cell if the Consolidation is None.

Other than that, if/when you have a chance, can you please give the file a test to ensure that the expected changes appear and handles as expected, as I'm not sure if you may have other changes since post 3?
Find all posts by this user
Quote this message in a reply
02-05-2018, 10:36 PM
Post: #5
RE: MRP > Create Purchase Order(s)
Wow! Thank you so much! I have to cut a PO later today so I will test it very shortly...

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
02-06-2018, 04:19 AM
Post: #6
RE: MRP > Create Purchase Order(s)
I hate to even mention it given all your help but the only comment I have is that there are still a few very small consistencies between MRPPlannedWorkOrders.php and MRPPlannedPurchaseOrders.php.

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
02-06-2018, 04:29 AM
Post: #7
RE: MRP > Create Purchase Order(s)
No problem here, as its best to be consistent as possible.

The main idea was to get the "primary" or "core" feature that you applied committed.

I'm not exactly sure of the inconsistencies, as I do not have any data in the MRP area to test. Sad

However, I'll compare the files to see if there are any obvious inconsistencies to discover.
Find all posts by this user
Quote this message in a reply
02-06-2018, 08:08 AM
Post: #8
RE: MRP > Create Purchase Order(s)
Are you talking code/handling inconsistencies, layout/output inconsistencies, or both?

Comparing files, code-wise, are nearly identical. There are white space differences, some variable case name differences, expected Work vs. Purchase word difference in title/message strings etc.

Other than that, it appears that the output would be nearly identical otherwise.

I guess I'm not clear on what's triggering your OCD in this particular area. Big Grin
Find all posts by this user
Quote this message in a reply
02-06-2018, 11:48 AM (This post was last modified: 02-06-2018 11:55 AM by VortecCPI.)
Post: #9
RE: MRP > Create Purchase Order(s)
I am sorry for not being more specific.

This stuff is super-nit-picky and makes no difference as to function.

   

   

   

   

   

I hate to even mention it after all the hard work you have done.

In my opinion this MRP-related feature is very useful so I hope others will agree and appreciate all your work.

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
02-06-2018, 12:41 PM (This post was last modified: 02-07-2018 05:24 AM by TurboPT.)
Post: #10
RE: MRP > Create Purchase Order(s)
Ok, code inconsistencies...

Know that the primary focus was on the provided "MRP planned purchase orders" provided in posts 2 and 3, I did not refer back to the planned work orders.

The 1st image:
Has a leading space and the Format_Date (which might be redundant) function, which does not match the other.
The $ReportDate is initialized with a space, is there a need to start with two spaces before "Through"?

The 2nd and 3rd images:
1. The right-hand side is because of my item 3 in post #4, about echo reduction.
2. I added the non-breaking space between the empty <th></th> tags, likely out of habit, and probably not necessarily required.
(there have been reasons why I've done this in the past, but I cannot cite any specific example at the moment)

Update:
I have recalled why now on the non-breaking space in empty table cells: ...from past dealings with empty table cells that did not render their borders if the content was empty and/or any CSS/styling would not get applied to empty table cells. From what I recall, the behavior seem to occur with both <th> and <td> cells, as these would appear as a 'blank squares' within the rows of a table.
It seems that I am not alone with that habit based on this older stackoverflow topic, and here's an explanation of the behavior from 2013. Newer browsers may no longer have this behavior/trouble, and there is apparently CSS alternatives to the situation now, as mentioned in both links. Going forward, it seems that I need to break this habit! Tongue


The 4th image:
Yes, that should likely be applied to the other file. I happened to note while applying your code, the potential for an empty (missing) cell, as there are 9 columns. The 9th column cell (Consolidation info) is only added when the condition is true, but no cell when false, which would leave 8 cells instead of 9.

The 5th image:
Same thing concerning "echo reduction"

No worries! Most of these should get matched since the "other" file will also need the cell addition, I can apply the same at that time.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)