Guest Posted June 20, 2005 Share Posted June 20, 2005 This is the discussion forum for the Company PO Credit Account contribution found here http://www.oscommerce.com/community/contributions,3278 Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted June 21, 2005 Share Posted June 21, 2005 Hi, this module is what i have been looking for, one small problem in the readme it talks about finding ENTRY_PURCHASE_ORDER_NUMBER and $order->info['purchase_order_number']; in in catalog/admin/orders.ph, but these lines dont exist in a fresh install. which of the two contributions did you base this module on as i will install that first and then this. hopefully it will work correctlty. cheers Quote Link to comment Share on other sites More sharing options...
Guest Posted June 21, 2005 Share Posted June 21, 2005 Hi, this module is what i have been looking for, one small problem in the readme it talks about finding ENTRY_PURCHASE_ORDER_NUMBER and $order->info['purchase_order_number']; in in catalog/admin/orders.ph, but these lines dont exist in a fresh install. which of the two contributions did you base this module on as i will install that first and then this. hopefully it will work correctlty. cheers <{POST_SNAPBACK}> Sorry that section should have read:- in catalog/admin/orders.php find <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td> <td class="main"><?php echo $order->info['cc_expires']; ?></td> </tr> <?php After it add // Company PO Account start } else if($order->info['purchase_order_number']) { ?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_PURCHASE_ORDER_NUMBER; ?></td> <td class="main"><?php echo $order->info['purchase_order_number']; ?></td> </tr> <?php // Company PO Account end Please remember to only use the beta verison in a test enviroment and not in a live shop. As this version is not ready to go live, it has only been released to speed up the development so we can get to a stable release i.e V1.0 for a live store. Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted June 23, 2005 Share Posted June 23, 2005 Hi, I installed to module and have got it to run, the problem is you have a load of other mods installed and this been carried into these files, like referral system and cool menus on the account create page, i have just used a the default form with company name viewable. i suggest we collabarate to implement a menu before creating an account, is the account for home, business or education and then have different credit levels allowed. on of the big problems at the moment is is said i done have enough credit when i do, i think the problem is the when the customer is created the credit levels are not set correctly, and in the payment confirmation there is a lot of net30/net60 stuff when it shoul be po, i will post the correction later. the biggest problem i have is when i select the po payment opetion and enter a po number and click next its tells me no payment type selected, if you could fix this i will be about to clean up the code. an option need to be put in is when payment is recieved will need to show the order paid and the amount added to the customers credit levels. cheers penfold_99 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 23, 2005 Share Posted June 23, 2005 (edited) Hi Penfold, Cheers for the heads up on the files, I forgot to run them through a comparison with std osfiles and output the clean files. Will do that tomorrow when I get the chance. Will also look at the selection of the purchase order payment option. Hi, I installed to module and have got it to run, the problem is you have a load of other mods installed and this been carried into these files, like referral system and cool menus on the account create page, i have just used a the default form with company name viewable. i suggest we collabarate to implement a menu before creating an account, is the account for home, business or education and then have different credit levels allowed. on of the big problems at the moment is is said i done have enough credit when i do, i think the problem is the when the customer is created the credit levels are not set correctly, and in the payment confirmation there is a lot of net30/net60 stuff when it shoul be po, i will post the correction later. the biggest problem i have is when i select the po payment opetion and enter a po number and click next its tells me no payment type selected, if you could fix this i will be about to clean up the code. an option need to be put in is when payment is recieved will need to show the order paid and the amount added to the customers credit levels. cheers penfold_99 <{POST_SNAPBACK}> Edited June 23, 2005 by Rochdalemark Quote Link to comment Share on other sites More sharing options...
Guest Posted June 26, 2005 Share Posted June 26, 2005 I forgot to run them through a comparison with std osfiles and output the clean files. Will do that tomorrow when I get the chance.Are you likely to do this today? Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted June 27, 2005 Share Posted June 27, 2005 Hi Penfold, Cheers for the heads up on the files, I forgot to run them through a comparison with std osfiles and output the clean files. Will do that tomorrow when I get the chance. Will also look at the selection of the purchase order payment option. <{POST_SNAPBACK}> Which comparison tool to do you use?? then i will be able to help you check Penfold_99 Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted June 30, 2005 Share Posted June 30, 2005 Hi, i have started to rewrite the actual payment module part to incorporate the code from checkout_confirmation.php as it does not need to be there. as all checking shoule be do in the payment module. will issue soon. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 30, 2005 Share Posted June 30, 2005 Hi, i have started to rewrite the actual payment module part to incorporate the code from checkout_confirmation.php as it does not need to be there. as all checking shoule be do in the payment module. will issue soon. <{POST_SNAPBACK}> Sorry I've not got back sooner as it's been such a hectic week at work, if something could have gone wrong it did. I've redone the two files so that they use origional ms2.2 code. will place it in the contributions. Quote Link to comment Share on other sites More sharing options...
wintecs Posted July 1, 2005 Share Posted July 1, 2005 Installed the contribution. When I goto the Payment module I get the following error Parse error: parse error, unexpected '-', expecting '{' in /home/.../includes/modules/payment/company-po.php on line 13 Also if I disable purchase order for a customer they cannot check out using any payment method with the popup box coming up. Any ideas? Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted July 1, 2005 Share Posted July 1, 2005 Sorry I've not got back sooner as it's been such a hectic week at work, if something could have gone wrong it did. I've redone the two files so that they use origional ms2.2 code. will place it in the contributions. <{POST_SNAPBACK}> I have completed about half of the payment function. This is a must no offence but there is alot of bodged code, as half refers to net contrib and half to company po. I am re-writing it and calling it purchase order as oscommerce has problem with '-' in file names. If you do not agree please left we know, this will be a great contrib once finished. there is a mistake in the sql file as when the account is created the credit is set to ?250 but the avaliable credit is set to zero instead of ?250. all the code in payment confirmation that is added will move to the payment module, so it will check the credit level before tring to place the order, this is how credit card modules work, best to check before than after, less to go wrong. can we agree to stop any changes to this until i post a re-writen version which will be done by monday, As we will have a better platform to continue work? Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted July 6, 2005 Share Posted July 6, 2005 I have now rewritten the module, payment modle works, how do i post the updated files? or do you want me to email them to you Rochdalemark so you can see the updated files? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 7, 2005 Share Posted July 7, 2005 I have now rewritten the module, payment modle works, how do i post the updated files? or do you want me to email them to you Rochdalemark so you can see the updated files? <{POST_SNAPBACK}> Just go to the contributions page http://www.oscommerce.com/community/contributions,3278 and click on ADD A FILE to this package to the right of the opening description text. Make sure you have zipped up the files into one zip file. Fill in the title and description fields, and browse for the zipped file. Click Submit, all done. I'll download it and check it out. What parts have you changed? have you altered the documentation to match? what is still left to do? is it at a working stage? these are the types of things you need to put in the description field for the submission. Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted July 8, 2005 Share Posted July 8, 2005 Just go to the contributions page http://www.oscommerce.com/community/contributions,3278and click on ADD A FILE to this package to the right of the opening description text. Make sure you have zipped up the files into one zip file. Fill in the title and description fields, and browse for the zipped file. Click Submit, all done. I'll download it and check it out. What parts have you changed? have you altered the documentation to match? what is still left to do? is it at a working stage? these are the types of things you need to put in the description field for the submission. <{POST_SNAPBACK}> HI, I have corrected the sql file and removed unused fields. I have changed all the defined variables from XXXX_NET_XXX to XXX_PURCHASE_ORDER_XXX i have removed the create_b_account pages as they are not required if the company name enabled. It is working, the bit we need to add is in the admin section is add a way to say the invoice is paid and add the value of the order to credit avaliable. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 8, 2005 Share Posted July 8, 2005 (edited) HI, I have corrected the sql file and removed unused fields. I have changed all the defined variables from XXXX_NET_XXX to XXX_PURCHASE_ORDER_XXX i have removed the create_b_account pages as they are not required if the company name enabled. It is working, the bit we need to add is in the admin section is add a way to say the invoice is paid and add the value of the order to credit avaliable. <{POST_SNAPBACK}> I suppose theres two ways of doing this: 1) the simple way - just have an input box either under the customer where you enter the amount and click submit or in its own credit payment section where you input the amount paid and select a customer from a drop down list and click submit. 2) The harder way where you can select an invoice and click paid so that it recognises the amount, the customer id and adds the apropriate amount back to the credit amount for that customer. Edited July 8, 2005 by Rochdalemark Quote Link to comment Share on other sites More sharing options...
quag2000 Posted July 28, 2005 Share Posted July 28, 2005 Hey guys, How are things progressing with the Company PO Account contribution! I am dead keen to see this one working and installin it into my store as it is exactly what I need for School orders. Cheers Bill Quote Link to comment Share on other sites More sharing options...
protogabe Posted August 8, 2005 Share Posted August 8, 2005 In it is current form, will this contribution allow for company accounts to be editable in the admin? In other word, how do you control the credit limit for the accounts? Thanks Quote Link to comment Share on other sites More sharing options...
jared_nz Posted August 11, 2005 Share Posted August 11, 2005 I cant seem to add this line to my database: alter table orders add index (purchase_order_number); we are running MySQL 3.23.51-Max and latest version of OS commerce please help Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted August 27, 2005 Share Posted August 27, 2005 Hi, Sorry for the delay, i have posted the undated version, this version will replace the current version as they are completely different. all credit checking is done in the payment module and not out side it, also have standardised the naming converstion. this is still beta, but working. things to do, add a paid button on customers orders when they have paid so it will increase credit limted and time limited the payment ie if no payment within 45 day it auto freezes the credit account for non payment. what does eveyone think of it? Quote Link to comment Share on other sites More sharing options...
DefelRadar Posted August 30, 2005 Share Posted August 30, 2005 Hi Penfold, I am currently attempting to install this contrib and was having some difficulty with the install. (right now I can't "install" the payment module in the admin section) but I'm double checking every thing and reinstalling to see if that clears up my problems. I'll keep you posted it but as of right now I really like this install...good work! Hi, Sorry for the delay, i have posted the undated version, this version will replace the current version as they are completely different. all credit checking is done in the payment module and not out side it, also have standardised the naming converstion. this is still beta, but working. things to do, add a paid button on customers orders when they have paid so it will increase credit limted and time limited the payment ie if no payment within 45 day it auto freezes the credit account for non payment. what does eveyone think of it? <{POST_SNAPBACK}> Quote Link to comment Share on other sites More sharing options...
DefelRadar Posted August 31, 2005 Share Posted August 31, 2005 Well I triple checked every piece of changed code and every file permission and I still cannot get the 2.0 version of this contrib to "install" in the admin. I also noticed after following the readme file that a section of additional code seems to left hanging with no instructions on how to install it. Here is the section of code I am refering to: ###################################################### around line 101 in catalog/checkout_process.php is this a mistake and needs to be added some where? -amh if ($order->info['payment_method'] == 'Company Credit Account') { $check_credit = tep_db_query("select customers_credit_left from " . TABLE_CUSTOMERS . " where customers_id ='" . $customer_id . "'"); $credit = tep_db_fetch_array($check_credit); $subamt = $credit['customers_credit_left'] - $order->info['total']; tep_db_query("update " . TABLE_CUSTOMERS . " set customers_credit_left ='" . $subamt . "' where customers_id = '" . $customer_id . "'"); } Find 'date_purchased' => 'now()', 'orders_status' => $order->info['order_status'], After it add // Company PO Account start 'purchase_order_number' => $order->info['po_number'], // Company PO Account end Find $email_order .= $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; After it add // Company PO Account start if($order->info['purchase_order_number']) { $email_order .= EMAIL_TEXT_PURCHASE_ORDER_NUMBER . $order->info['purchase_order_number'] . "\n"; } // Company PO Account end ############################################# The bolded section is the code in question that looks like it should be added but no instruction as to where? I am installing this contrib fresh without installing any of the previous version since this contrib was a total rewrite. I am willing to send my modded files to Penfold or anyone else who has installed version 2.0 successfully and maybe they could point me in the right direction? Thanks in advance! Aaron Hi Penfold, I am currently attempting to install this contrib and was having some difficulty with the install. (right now I can't "install" the payment module in the admin section) but I'm double checking every thing and reinstalling to see if that clears up my problems. I'll keep you posted it but as of right now I really like this install...good work! <{POST_SNAPBACK}> Quote Link to comment Share on other sites More sharing options...
penfold_99 Posted August 31, 2005 Share Posted August 31, 2005 Hi Penfold, I am currently attempting to install this contrib and was having some difficulty with the install. (right now I can't "install" the payment module in the admin section) but I'm double checking every thing and reinstalling to see if that clears up my problems. I'll keep you posted it but as of right now I really like this install...good work! <{POST_SNAPBACK}> i will check the code, i thought i had cleared this up! sorry will post update asap. i built it on the cash on delivery module, enable that first, and see if it installs so you can test. Quote Link to comment Share on other sites More sharing options...
DefelRadar Posted August 31, 2005 Share Posted August 31, 2005 No prob pen. I see your update (2.2) and will reinstall and test out and keep you posted. Thanks again for a nice contrib! i will check the code, i thought i had cleared this up! sorry will post update asap. i built it on the cash on delivery module, enable that first, and see if it installs so you can test. <{POST_SNAPBACK}> Quote Link to comment Share on other sites More sharing options...
DefelRadar Posted August 31, 2005 Share Posted August 31, 2005 I redid the install and now the contrib "installed" in the admin section and everthing looked good but now I receive this message Fatal error: Call to undefined function: update_status() in /hsphere/local/home/patpayne/patpaynedistributors.com/includes/modules/payment/po.php on line 31 when I try to test it out on the site. I even installed the Cash on Delivery payment module and received the same error. I'm going to go over the install instructions again to make sure I didn't miss any changes or updates. Thanks for your help! Aaron Quote Link to comment Share on other sites More sharing options...
DefelRadar Posted August 31, 2005 Share Posted August 31, 2005 I double checked the most recent installed version 2.2 and everything looks fine to me but I am still getting the error message "Call to undefined function: update_status() in /hsphere/local/home/patpayne/patpaynedistributors.com/includes/modules/payment/po.php on line 31" when I try to test it out during a check out. I also tested it on an account that was not enabled for the PO account and the same error occured. Anyone have an idea what might be the problem? Thanks!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.