Results 1 to 10 of 46

Threaded View

  1. #20
    Join Date
    Mar 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Purchase order module

    Quote Originally Posted by otaraia View Post
    I just installed the latest Purchase Order Module and it works well....

    .... however if you use a PO longer than 12 Characters the SQL has a fit and errors out. The easy fix was to increase the size of the po_number field in the orders table (via MySqlAdmin) but you may want to edit the SQL patch to match whatever the code says is acceptable in terms of field length :-)
    I just made the following change to the po.php located in includes.modules.payment to limit the max PO Size to 14 Characters and not to check for an Account Number :-

    // class methods
    function javascript_validation() {
    $validation_string = 'if (payment_value == "' . $this->code . '") {' . "\n" .
    ' var account_name = document.checkout_payment.account_name.value;' . "\n" .
    ' var account_number = document.checkout_payment.account_number.value;' . "\n" .
    ' var po_number = document.checkout_payment.po_number.value;' . "\n" .
    ' if (account_name.length == 0) {' . "\n" .
    ' error_message = error_message + "' . MODULE_PAYMENT_PO_TEXT_JS_ACC_NAME . ' ";' . "\n" .
    ' error = 1;' . "\n" .
    ' }' . "\n" .
    ' if (po_number.length == 0) {' . "\n" .
    ' error_message = error_message + "' . MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER . '";' . "\n" .
    ' error = 1;' . "\n" .
    ' }' . "\n" .
    ' if (po_number.length >= 15) {' . "\n" .
    ' error_message = error_message + "' . MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER_MAX . '";' . "\n" .
    ' error = 1;' . "\n" .
    ' }' . "\n" .
    '}' . "\n";
    return $validation_string;
    }

    And then in includes.languages.english.modules.payment po.php I added a new line to describe the "Exceeds 14 Characters"

    /*
    $Id: po.php,v 1.2 2002/11/27 12:00:00 olby Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2002 osCommerce

    Released under the GNU General Public License
    */

    define('MODULE_PAYMENT_PO_TEXT_TITLE', 'Purchase Order');
    define('MODULE_PAYMENT_PO_TEXT_DESCRIPTION', 'Will you accept Purchase Order?');
    define('MODULE_PAYMENT_PO_TEXT_ACCOUNT_NAME', 'Account name:');
    define('MODULE_PAYMENT_PO_TEXT_ACCOUNT_NUMBER', 'Account number:');
    define('MODULE_PAYMENT_PO_TEXT_PO_NUMBER', 'Purchase Order Nr:');
    define('MODULE_PAYMENT_PO_TEXT_EMAIL_FOOTER', 'with the following information:');
    define('MODULE_PAYMENT_PO_TEXT_JS_ACC_NAME', 'You forgot to enter the account name (Company).');
    define('MODULE_PAYMENT_PO_TEXT_JS_ACC_NUMBER', 'You forgot to enter the your Account Number.');
    define('MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER', 'You forgot to enter your Purchase Order number.');
    define('MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER_MAX', 'Your PO Number Exceeds 14 Characters.');
    ?>
    Last edited by otaraia; 17 Aug 2011 at 06:15 AM. Reason: more detail

 

 

Similar Threads

  1. Purchase Module - Purchase Order Payment Module Problem
    By keewong in forum Addon Payment Modules
    Replies: 15
    Last Post: 14 Dec 2010, 12:19 AM
  2. Replies: 0
    Last Post: 23 Jan 2009, 09:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg