Esempio n. 1
0
function read_customer_data()
{
    global $Refs;
    $myrow = get_customer_habit($_POST['customer_id']);
    $_POST['HoldAccount'] = $myrow["dissallow_invoices"];
    $_POST['pymt_discount'] = $myrow["pymt_discount"];
    //Chaitanya : 13-OCT-2011 - To support Edit feature
    //If page is called first time and New entry fetch the nex reference number
    if (!$_SESSION['alloc']->trans_no && !isset($_POST['charge'])) {
        $_POST['ref'] = $Refs->get_next(ST_CUSTPAYMENT);
    }
}
     //	break;
 //case PT_WORKORDER :
 //	workorders_list_row(_("Work Order:"), 'person_id', null);
 //	break;
 case PT_SUPPLIER:
     supplier_list_row(_("Supplier:"), 'person_id', null, false, true, false, true);
     break;
 case PT_CUSTOMER:
     customer_list_row(_("Customer:"), 'person_id', null, false, true, false, true);
     if (db_customer_has_branches($_POST['person_id'])) {
         customer_branches_list_row(_("Branch:"), $_POST['person_id'], 'PersonDetailID', null, false, true, true, true);
     } else {
         $_POST['PersonDetailID'] = ANY_NUMERIC;
         hidden('PersonDetailID');
     }
     $trans = get_customer_habit($_POST['person_id']);
     // take care of customers on hold
     if ($trans['dissallow_invoices'] != 0) {
         if ($payment) {
             $customer_error = true;
             display_error(_("This customer account is on hold."));
         } else {
             display_warning(_("This customer account is on hold."));
         }
     }
     break;
 case PT_QUICKENTRY:
     quick_entries_list_row(_("Type") . ":", 'person_id', null, $payment ? QE_PAYMENT : QE_DEPOSIT, true);
     $qid = get_quick_entry(get_post('person_id'));
     if (list_updated('person_id')) {
         unset($_POST['totamount']);