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.
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:
[Renumber Customers]] module=ct.pl action=renumber
With minor change you can use it to renumber parts, invoices, gl transactions etc.
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>|;
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.
You record returns from customer using AR–Credit Invoice and AR-Credit Note. There are two possibilities now:
Use user_io.pl and put variables there. You can then utilize these variables anywhere you like.