How to Create a Recurring Transaction in SQL-Ledger

Original Question:

Posted by Dan on Friday, October 23, 2009

OK I’ve been trying to figure out how to create a recurring transaction from a new invoice, not an already created invoice.

I click on Sales Invoice, enter product and amount and date on the invoice. I also enter a new description and change the invoice date to 11-01-2009. Next, I clicked on Schedule and entered another description here, set start date to 11-01-2009, checked off Email Invoice, and then clicked Save. The recurring transaction brings me back to the invoice and does not save anything in the recurring transaction list.

What am I missing?

Thanks,

Dan


Response from Marcus (localguru), Germany, on Saturday, October 24, 2009

Hi Dan,

If I understand the recurring concept of SQL-Ledger correctly, the first invoice is never a recurring invoice or transaction. In your example, you need to save the invoice itself first to create a recurring transaction.

However, if you set the date of the invoice and the first recurring transaction to the same date (e.g., 11-01-2009), you will create an invoice with a future date (11-01-2009) and not a recurring transaction starting on that date.

Important Notes

  • Initial Invoice Date: The date of the initial invoice should reflect when the first transaction occurred, not necessarily the start date of the recurring series.
  • Future Dated Invoices: Creating an invoice with a future date may not generate the recurring transaction as expected and can cause accounting inconsistencies.
  • Recurring Transaction Creation: Recurring transactions are typically based on existing, saved transactions. Saving the initial invoice provides a template for the recurring entries.

Summary

To successfully create a recurring transaction in SQL-Ledger:

  • First, create and save the initial invoice with the correct date and details.
  • Then, set up the recurring schedule from the saved invoice, specifying the start date and frequency.
  • Finally, verify that the recurring transaction has been saved and is listed correctly.

By following these steps, you should be able to generate recurring invoices that will automatically be created and, if configured, emailed to your customers at the specified intervals.


Invoice Set Up on pre-printed forms

Original Question:

Could someone point me in the right direction to create an invoice template for a pre-printed form. In other words, how do you place the invoice data so it drops into the correct box on the form.

Thanks

Lawrence


Customizing an invoice template to fit a pre-printed form in SQL-Ledger involves adjusting the positions of the invoice data so they align with the designated areas on your form. Below is a comprehensive guide to help you set up your invoice template accordingly.

1. Understanding SQL-Ledger’s Template System

  • Template Language: SQL-Ledger uses LaTeX for its invoice templates.
  • Template Files: Invoice templates are located in the templates directory of your SQL-Ledger installation, typically named invoice.tex or similar.

2. Preparing Your Environment

  • Install LaTeX: Ensure you have a LaTeX distribution installed (e.g., TeX Live, MiKTeX).
  • Text Editor: Use a text editor that supports LaTeX syntax highlighting for easier editing.
  • Required Package: You’ll need the LaTeX package textpos for precise positioning.

3. Including the textpos Package

Add the textpos package to your LaTeX template:

\usepackage[absolute,overlay]{textpos}

Place this line in the preamble of your document, before \begin{document}.

4. Setting Up the Coordinate Grid

Configure the page dimensions to match your pre-printed form:

\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
\textblockorigin{0mm}{0mm} % Adjust if your printer has non-printable margins

This sets up a coordinate grid using millimeters, which is helpful for precise placement.

5. Positioning Text with textblock

Use the textblock environment to place text at specific coordinates:

\begin{textblock}{width}(x_coord,y_coord)
Your content here
\end{textblock}
  • width: Width of the text block in units (matches \TPHorizModule).
  • x_coord, y_coord: Coordinates where the text block starts.

6. Customizing Template Fields

Replace standard fields with positioned text blocks. For example:

% Position the invoice number
\begin{textblock}{30}(150, 20)
\textbf{Invoice Number:} \VAR{invoice.invnumber}
\end{textblock}

% Position the invoice date
\begin{textblock}{30}(150, 30)
\textbf{Date:} \VAR{invoice.transdate}
\end{textblock}

% Position the customer name
\begin{textblock}{80}(20, 50)
\VAR{customer.name}
\end{textblock}

Adjust the coordinates (x_coord, y_coord) to match the locations on your pre-printed form.

7. Adjusting Itemized Lists

For line items, use a loop with dynamic positioning:

% Set initial Y-coordinate for items
\newcommand{\itemstarty}{100} % Starting Y position
\newcommand{\itemstep}{10}    % Vertical space between items

% Begin loop over invoice items
\BLOCK{ for item in invoice.items }
\begin{textblock}{180}(20, \the\numexpr \itemstarty - \itemstep * \VAR{ forloop.counter0 } \relax)
\VAR{ item.description } \hfill \VAR{ item.qty } \hfill \VAR{ item.sellprice } \hfill \VAR{ item.linetotal }
\end{textblock}
\BLOCK{ endfor }
  • \itemstarty: Starting Y-coordinate for the first item.
  • \itemstep: Vertical spacing between items.
  • \VAR{ forloop.counter0 }: Zero-based index of the loop iteration.

8. Testing and Refinement

As suggested by Brian Roper in the forum:

  1. Print a Test Invoice: Print the modified invoice on plain paper.
  2. Overlay on Pre-Printed Form: Place the printed invoice over the pre-printed form.
  3. Check Alignment: Hold them up to a light source to verify alignment.
  4. Adjust Coordinates: Fine-tune the (x_coord, y_coord) values based on discrepancies.
  5. Repeat: Iterate until the data aligns perfectly with the form fields.

9. Applying the Customized Template

  • Save the Template: Save your customized LaTeX file, e.g., custom_invoice.tex.
  • Update SQL-Ledger Settings:
  • Log in to SQL-Ledger.
  • Navigate to “System” > “Defaults” > “Templates”.
  • Select your new template for invoices.

10. Additional Tips

  • Backup: Before making changes, backup the original template files.
  • Documentation: Comment your LaTeX code for future reference.
  • Margins and Printer Settings: Account for any non-printable areas your printer may have.
  • Consult LaTeX Resources: If you’re new to LaTeX, refer to online tutorials for additional help.

11. Alternative Solutions

If customizing LaTeX templates is challenging:

  • Upgrade SQL-Ledger: Consider updating to a newer version with improved template handling.
  • Use PDF Editing Tools: Generate invoices as PDFs and adjust them using a PDF editor (not ideal for batch processing).
  • Seek Professional Help: Hire someone with LaTeX expertise to assist in template customization.

Conclusion

By carefully adjusting your invoice template using the textpos package in LaTeX, you can align your invoice data to fit perfectly within the designated areas of your pre-printed forms. This method ensures professional-looking invoices and efficient use of your existing stationery.


How to Raise a VAT-Only Invoice in SQL-Ledger

In August 2009, a user named Dominic Raywood (username “RubiconCSL“) posted on the SQL-Ledger User Forum seeking assistance on how to raise a VAT-only invoice using SQL-Ledger version 2.0.8.

Issue

Dominic was working with a client who used self-invoicing, meaning the client raised invoices on his behalf. The initial invoice issued did not include VAT because they hadn’t received his VAT registration details. As a result, Dominic needed to raise an invoice solely for the VAT amount corresponding to that initial invoice.

Question

How can I raise my own invoice just for the VAT for that initial invoice in SQL-Ledger?

Solution Provided

A forum member, “dws,” offered the following solution:

  1. Add an Accounts Receivable (AR) Transaction:
  • Navigate to the AR Transaction module in SQL-Ledger.
  1. Uncheck the Tax Calculation Option:
  • When entering the transaction, uncheck the tax option so that tax is not automatically calculated on the amount.
  1. Enter the VAT Amount Manually:
  • Input the VAT amount as the transaction amount.
  1. Ensure Proper Tax Reporting:
  • Using an AR transaction without a base amount but with a tax component creates a tax-only transaction or invoice.
  • This method ensures that the VAT amount is included in tax reports. If a General Ledger (GL) transaction were used instead, the tax would not be included in the tax reports.

Dominic’s Feedback

After implementing the suggested steps, Dominic confirmed that the solution worked:

“Brilliant, thanks. Just what I needed—I had overlooked your ‘uncheck the tax’ bit. All working now.”

Summary

To raise a VAT-only invoice in SQL-Ledger:

  • Create an AR Transaction without a base amount.
  • Uncheck the Tax Calculation to prevent automatic tax computation.
  • Manually enter the VAT amount as the transaction amount.
  • This approach generates a tax-only invoice, ensuring the VAT is correctly recorded and appears in tax reports.

Notes

  • This method is useful for situations where VAT needs to be invoiced separately due to initial omissions.
  • Always verify that this process complies with your local tax regulations and accounting standards.

By following these steps, you can effectively issue a VAT-only invoice in SQL-Ledger, ensuring accurate accounting and compliance with tax reporting requirements.