Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-14-2013 14:15:25

geraldz
Member
Registered: 09-27-2011
Posts: 251

Need a little PHP help

I'm trying to work out one last bug with my Peachtree export.  In order for Peachtree to import a sale and NOT record it as being paid, I need to set the payment LineAmount to zero.

I only need to do this where the customer pays with a Purchase Order (so it's not really paid and will show as accounts receivable).  Here's the code I added to my peachtree.php file:

// Set the payment amount to zero if payment method is purchase order
if ($order['paymethod'] = 'purchord')    {$order['ordertotal'] = '0';} // End else statement

I tested $order['paymethod'] by printing the output on the end of the line and it does correctly show the payment method used by the customer.  However this line is setting the payment LineAmount to zero for ALL orders, regardless of payment method.

I also tried this:
if ($order['paymethod'] = 'purchord')    {$order['ordertotal'] = 0;} // End else statement


What am I missing?

Thanks.

Last edited by geraldz (03-14-2013 14:16:57)

Offline

 

#2 03-14-2013 15:08:34

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Need a little PHP help

Your IF tests need to use == not a single =

Using a single = is setting a value not testing a value.

Code:

if ($order['paymethod'] == 'purchord') {
      $order['ordertotal'] = 0;
} // End else statement

Offline

 

#3 03-15-2013 08:56:47

geraldz
Member
Registered: 09-27-2011
Posts: 251

Re: Need a little PHP help

That worked.  A big thank you Dave!

Offline

 

Board footer