Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PO delete item problem
01-26-2012, 02:49 AM
Post: #1
PO delete item problem
When I create and submit a PO and then go back to it and try to delete some items, they disappear from the screen but not from the database. When I print the PO, the deleted items are still there.
Does anybody know how to fix this?
Thanks
Find all posts by this user
Quote this message in a reply
01-26-2012, 07:51 AM
Post: #2
RE: PO delete item problem
When you delete an item this code marks it deleted
$_SESSION['PO'.$identifier]->LineItems[$_GET['Delete']]->Deleted=True;
When you commit the order there is no items marked as deleted and sql statement does not execute
foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) {

if ($POLine->Deleted==true) {
if ($POLine->PODetailRec!='') {
$sql="DELETE FROM purchorderdetails WHERE podetailitem='" . $POLine->PODetailRec . "'";
Find all posts by this user
Quote this message in a reply
01-28-2012, 08:48 AM
Post: #3
RE: PO delete item problem
Did you fix this Vitaliy or do I need to go in to battle on this?

Is your name Vitaly or Vitaliy? I have seen it both ways and don't wish to offend you by getting it wrong!

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
01-28-2012, 10:04 AM
Post: #4
RE: PO delete item problem
Phil,
I did not get to the source of the problem. Could you look at that, please.

I prefer shorter Vitaly, but both are valid, anyway
Find all posts by this user
Quote this message in a reply
01-31-2012, 05:44 AM
Post: #5
RE: PO delete item problem
Phil,
Do you have any guess why the $_SESSION does not pass the Deleted flag properly?
Find all posts by this user
Quote this message in a reply
01-31-2012, 06:48 AM
Post: #6
RE: PO delete item problem
Sorry I've not been in to look at this yet ... there is also the pricing one too.
I guess all we really need now is the fix!

Thanks for the reminder I will dig in next weekend ... weather has been too good to be inside Smile

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
01-31-2012, 12:43 PM
Post: #7
RE: PO delete item problem
(01-31-2012 07:44 AM)tim_schofield Wrote:  Hi Phil,

The fix is to check whether there are lines in purchorderdetails not in the purchase order session object and delete them if not. It was in the original, but got removed when you improved it.

Tim

Don't know if will help, but running the v 4.05.1 set of scripts it works OK. After upgrading to 4.06.6 the bug appears.

Regards,
Pak Ricard
Find all posts by this user
Quote this message in a reply
01-31-2012, 12:58 PM
Post: #8
RE: PO delete item problem
So it must have been a further "improvement" on the intial improvements Smile

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
02-03-2012, 12:30 PM (This post was last modified: 02-03-2012 12:38 PM by vitaliy_s.)
Post: #9
RE: PO delete item problem
I think I found it
function Order_Value() {
$TotalValue=0;
foreach ($this->LineItems as $OrderedItems) {
if ($OrderedItems->Deleted = False){
$TotalValue += ($OrderedItems->Price)*($OrderedItems->Quantity);
}
}
return $TotalValue;
}

Should it be $OrderedItems->Deleted != False instead of = False?
or $OrderedItems->Deleted == False?
Find all posts by this user
Quote this message in a reply
02-03-2012, 07:58 PM
Post: #10
RE: PO delete item problem
Definitely the bug - as all lines are set to not deleted
The line should actually be:
if ($OrderedItems->Deleted == False) {

as $OrderedItems->Deleted == True when the line is deleted.

I've applied this fix to svn for you - nice one Big Grin

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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