Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sales Order required date not reflected in Work Order
03-14-2018, 01:44 AM,
#1
Sales Order required date not reflected in Work Order
If I have a sales order with a required date of, say, May 13, 2018 and Auto Create Work Orders set to "Yes" the Work Order still shows today's date as the required date, not May 13. I tested this on my installation. Was unable to test it on the demo site. Shouldn't these dates match?

Thanks,
Jeff
Reply
03-14-2018, 04:57 AM,
#2
RE: Sales Order required date not reflected in Work Order
Jeff, which script would this be from?
Reply
03-14-2018, 05:21 AM,
#3
RE: Sales Order required date not reflected in Work Order
I think it is generated from DeliveryDetails.php, but data may be passed to it from SelectOrderItems.php
SelectOrderItems.php has the individual line item Due date field(s) where DeliveryDetails.php just has the Estimated Delivery Date field.
Reply
03-14-2018, 09:12 AM, (This post was last modified: 03-14-2018, 10:05 AM by TurboPT.)
#4
RE: Sales Order required date not reflected in Work Order
Tim (or anyone else that might be familiar)

I'm somewhat confused on the flow, but in DeliveryDetails.php, there are two big condition blocks at lines 329 and 649.
(The SelectOrderItems script, line 1191, does pass an identifier to DeliveryDetails via a link, which happens after a 'DeliveryDetails' submit at line 1478)

Both of these conditions have an insert into workorders at lines 499 and 697.

The insert at line 499 uses the current date for requiredby, but the line 697 insert uses the requiredby date from the contract.

So possibly it is that the $_SESSION['ExistingOrder'.$identifier] is not set correctly somewhere between the two scripts that Jeff mentions, or there may be some other contributing situation?

=====

Looking a bit more, I wonder if the submit at 1478 that gets redirected by line 1190 may losing the original identifier? (or that the session's ExistingOrder mentioned above should be set before the rediect?) It seems that the redirect might be getting a new identifier value, but perhaps not, as the form at line 833 has the identifier with the URL but I have not been able to test that far, just yet.
Reply
03-17-2018, 01:03 AM,
#5
RE: Sales Order required date not reflected in Work Order
I don't know if this is a good solution, but with my (minimal) testing this gave the desired result.

replaced line 507: '" . Date('Y-m-d') . "',
with: '" . FormatDateForSQL($StockItem->ItemDue) . "',

Maybe someone with more webERP and PHP knowledge can review?

Thanks!

Jeff
Reply
03-17-2018, 11:38 AM, (This post was last modified: 03-17-2018, 11:38 AM by TurboPT.)
#6
RE: Sales Order required date not reflected in Work Order
That minor change definitely seems plausible for that area, though I cannot give a test run.

Change committed. (credited to Jeff)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)