Simple Invoices logo
    • CommentAuthorapmuthu
    • CommentTimeNov 22nd 2007 edited
     permalink
    In [b]/modules/system_defaults/edit.php[/b]
    Replace Line [b]89[/b][code] $display_block = "<p><em>{$LANG['no_billers']}</em></p>";[/code]With[code] $display_block_biller = "<p><em>{$LANG['no_billers']}</em></p>";[/code]

    There are [b]2 tables[/b] having [b]defaults[/b]:-
    [b]si_defaults[/b] (1 record for all defaults)
    and
    [b]si_system_defaults[/b] (1 record for each default value)

    When we try to set the [b]Default Biller[/b], the [b]si_system_defaults[/b] table [b]gets updated[/b] but the [b]si_defaults table[/b] does [b]not[/b] get [b]updated[/b] and [b]all is well[/b] (New Invoice creation shows the new default biller correctly).

    When we try to set the [b]Default Customer[/b] and then go to create a new invoice, the Default Customer in the new invoice is not what we set. The [b]si_system_defaults[/b] table [b]gets updated[/b] and the [b]si_defaults table[/b] does [b]not[/b] get [b]updated[/b] but all is [b]not well[/b]!
    • CommentAuthorapmuthu
    • CommentTimeNov 22nd 2007 edited
     permalink
    In /modules/system_defaults/edit.php

    Move Line 121 $default = "customer";To Line 114 as below:- $default = "customer";
    $customers = getActiveCustomers();
    • CommentAuthorapmuthu
    • CommentTimeNov 22nd 2007 edited
     permalink
    TB_PREFIX."defaults" was last referred to in /include/sql_patches.php as Patch 115.
    TB_PREFIX."system_defaults" is referred to in /include/sql_queries.php for all the functions retrieving the defaults.
    • CommentAuthorapmuthu
    • CommentTimeNov 22nd 2007 edited
     permalink
    $defaults[def_customer] belonging to the TB_PREFIX."defaults" table was last referenced at Patch 117.
    • CommentAuthorapmuthu
    • CommentTimeNov 23rd 2007 edited
     permalink
    The [b]Default Customer[/b] not apearing in any [b]new invoice[/b] has been now traced to [b]an error[/b] in the [b]/templates/default/invoices/header.tpl[/b] file where [b]2 replacements[/b] are needed [b][color=blue]to correct[/color][/b] the issue.

    In [b]/templates/default/invoices/header.tpl[/b]
    Replace Line [b]44[/b][code] <td>[/code]With[code] <td input type="text" name="customer_block" size=25>[/code]
    Replace Line [b]51[/b][code] <option {if $smarty.get.customer == $customer.id} selected {/if} value="{$customer.id}">{$customer.name}</option>[/code]With[code] <option {if $customer.id == $defaults.customer} selected {/if} value="{$customer.id}">{$customer.name}</option>[/code]
    • CommentAuthorjustin
    • CommentTimeNov 23rd 2007 edited
     permalink
    dude,

    seriously get a svn account and check this stuff in :)

    cheers

    justin