Tips and Tricks

Making warehouse column mandatory

You have defined warehouses and want to make warehouse column on invoices mandatory so that users don't forget to specify a warehouse. Just add the following line in the update procedure (sub update) in bin/mozilla/is.pl and bin/mozilla/ir.pl

 $form->isblank('warehouse', $locale->text('Warehouse cannot be blank'));

You can use this function to make any column mandatory on any form. Just lookup for “sub update” or “sub save” in the required perl file and put an appropriate isblank line.

Renumbering customer numbers

You can renumber customers with the following code snippet. This code snippet calls sql-ledger API to do the renumbering. Set the required initial number in system defaults.

1;

sub renumber {
   $form->header;
   my $dbh = $form->dbconnect(\%myconfig);
   my $query = qq|SELECT id, name FROM customer ORDER BY name|;
   my $sth = $dbh->prepare($query);
   $sth->execute or $form->dberror($query);
   my $updatequery = qq|UPDATE customer SET customernumber = ? WHERE id = ?|;
   my $updatesth = $dbh->prepare($updatequery);
   while ($ref = $sth->fetchrow_hashref(NAME_lc)){
        $form->{customernumber} = $form->update_defaults($myconfig, "customernumber", $dbh);
        $updatesth->execute($form->{customernumber}, $ref->{id});
        print qq|$form->{customernumber} assigned to $ref->{name}<br>|;

   }
   $dbh->disconnect;

}

Installation:

  1. Put the above code in bin/mozilla/custom_ct.pl
  2. Add following lines to custom_menu.ini. This option will appear in menu. Click to renumber the customers.
[Renumber Customers]]
module=ct.pl
action=renumber

With minor change you can use it to renumber parts, invoices, gl transactions etc.

Make Salesperson readonly for non-admins on POS Interface

Following small patch will restrict the user to the default salesperson on POS interface if his/her role is not 'administrator'.

[sqlledger@home ~/public_html]$ svn diff
Index: bin/mozilla/pos.pl
===================================================================
--- bin/mozilla/pos.pl  (revision 49)
+++ bin/mozilla/pos.pl  (working copy)
@@ -181,6 +181,14 @@
              </tr>
 | if $form->{selectemployee};

+   ($employeename) = split(/--/, $form->{employee});
+   $employee = qq|
+             <tr>
+               <th align=right nowrap>|.$locale->text('Salesperson').qq|</th>
+               <td colspan=3>$employeename</td>
+               <input type=hidden name=employee value="$form->{employee}">
+             </tr>
+| if $myconfig{role} ne 'admin';

   if (($rows = $form->numtextrows($form->{description}, 60, 5)) > 1) {
     $description = qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;

Advance payments

Usually you apply your cash payments (or receipts) to specific invoices.

Sometimes the customer pays an advance and there is no outstanding invoice. Using Cash–Receipt menu option, you can simply post the payment to the customer without applying it to an invoice.

When the invoice comes in from customer, you record the invoice in the normal way.

To adjust the advance, goto Cash–Receipt menu option and select the customer. You will be shown with the outstanding advance and the unpaid invoice from the customer. Check both transactions and click 'Post' button. The advance payment will be adjusted against the new invoice.

Stock adjustment

  1. Use vendor invoice to with +ve qauntity (to increase) or -ve quantity (to decrease) to adjust your stock level. Use 0 for sell price.
  2. Or you can use a sales or purchase order and fill in a quantity in the “Ship” column.

Sales return adjustment

You record returns from customer using AR–Credit Invoice and AR-Credit Note. There are two possibilities now:

  1. You adjust the credit amount to other invoices of the customer. The process is same as adjusting the advance against the customer invoices.
  2. You give the cash back to the customer.

User preferences

Use user_io.pl and put variables there. You can then utilize these variables anywhere you like.

 
tips_n_tricks.txt · Last modified: 2010/05/06 12:05 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki