1 (edited by kolegut 04/23/2016 12:13:40 pm)

Topic: Disable input or change some objects in customer invoice

How can i disable input or change some objects in customer invoice? such as:

sales_types_list_row
price
payment_terms_list_cells
Amount
Shipping Cost

And dont allow user to input or change these?

Re: Disable input or change some objects in customer invoice

try this way, i am just explaining you the way to  do it for first one. `sales_types_list_row`. you can do it others manually.

 

function sales_types_list($name, $selected_id=null, $submit_on_change=false, $special_option=false, $disabled=false)
{
    $sql = "SELECT id, sales_type, inactive FROM ".TB_PREF."sales_types";

    return combo_input($name, $selected_id, $sql, 'id', 'sales_type',
    array(
        'spec_option' => $special_option===true ? _("All Sales Types") : $special_option,
        'spec_id' => 0,
        'select_submit'=> $submit_on_change,
                'disabled'  => $disabled, 
    //      'async' => false,
    ) );
}

function sales_types_list_cells($label, $name, $selected_id=null, $submit_on_change=false, $special_option=false, $disabled=false)
{
    if ($label != null)
        echo "<td>$label</td>\n";
    echo "<td>";
    echo sales_types_list($name, $selected_id, $submit_on_change, $special_option, $disabled);
    echo "</td>\n";
}

function sales_types_list_row($label, $name, $selected_id=null, $submit_on_change=false, $special_option=false, $disabled=false)
{
    echo "<tr><td class='label'>$label</td>";
    sales_types_list_cells(null, $name, $selected_id, $submit_on_change, $special_option, $disabled);
    echo "</tr>\n";
}

Here I just added additional parameter `$disabled`. and forwarded to combo_input call.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Disable input or change some objects in customer invoice

you can call this function by adding last parameter `true`, than it will be disabled.  Try it.

Subscription service based on FA
HRM CRM POS batch Themes