Code Monkey home page Code Monkey logo

sql-ledger's Introduction

What is SQL-Ledger?

SQL-Ledger is an open source ERP and accounting system. It gives you all the functionality you need for quotations, order management, invoices, payrolls and much more. The program is written in Perl, runs on an Apache webserver, uses a PostgreSQL database and is highly configurable.

About this repo

SQL-Ledger is developed by DWS Systems Inc.. The master branch contains the original version from DWS. It has version tags, so you can download a specific version back to 2.6.0 from October 1, 2005.

The full branch, which is checked out by default, provides some additions:

  • real Unicode support
  • extended keyboard shortcuts (docs)
  • spreadsheet downloads
  • recently used objects
  • improved document management with drag and drop and deduplication
  • data export for editing and reimport
  • dark mode
  • markdown for bold, italic and links in templates
  • database snapshots
  • encrypted backups
  • JSON API (introduction)
  • support for ISO 20022 camt.054 files
  • Docker files for containerized test environment
  • WLprinter
  • minimalistic documentation
  • Swiss charts of accounts in German, French and Italian
  • several security patches

Installation

To install the program on Debian, you can use the Ansible Role for SQL-Ledger. If you are on a different distribution, either follow the instructions from DWS, or open an issue on GitHub.

Encrypted Backups

If GnuPG is installed on your server, you can use it to encrypt backups. Uncomment the $gpg variable in sql-ledger.conf, create a directory /var/www/gnupg and change its owner to www-data:www-data on Debian or apache:apache on Fedora based distributions.

Unicode Support

In difference to the original SQL-Ledger, the version in the full branch internally works with Unicode characters. This requires that your database, your templates and translations are all encoded in UTF-8.

Docker

With

cd docker
docker-compose -p sql-ledger up -d

you can start a simple test environment (without LaTeX support) on Debian Bookworm. SQL-Ledger will run at localhost/sql-ledger. At localhost:8080 and localhost:8085 you find the database management tools Adminer and pgAdmin. You'll have to connect them to the PostgreSQL database that runs on service db with username and password sql-ledger.

If you want to try the program on AlmaLinux 9, use the second compose file

cd docker
docker-compose -f docker-compose-alma.yml -p sql-ledger up -d

WLprinter

WLprinter, included in the full branch, is a Java program that is executed on the client PC and allows to print directly from SQL-Ledger to your local printers. It is available for printing if you add a printer with command wlprinter at System--Workstations. The client program is started from Batch--WLprinter. You will have to add a Java security exception for your SQL-Ledger server.

Documentation

The documentation is very minimalistic and doesn't contain much more than the function names of the different modules. If you have Mojolicious and Mojolicious::Plugin::PODViewer installed, you can start a perldoc server from your SQL-Ledger base directory with

perl -I. -Mojo -E'plugin "PODViewer"; a->start' daemon

and browse to localhost:3000/perldoc/sql-ledger.

Contributing

As mentioned above, what you find here is more or less a copy of the code from DWS. 'copy' means that the code flows from DWS to here and rarely in the other direction. 'more or less' means that the differences between the full and the master branch should always be as small that it is possible to include updates without problems. 2 merge conflics are not a problem, but 100 conflics are.

It follows that if you want the DWS code to change, you have to speak with them. If on the other hand you want this repo to change, don't care about the moon calendar and create an issue.

It was mentioned too that the full branch contains some additions, like Unicode support and documentation. So it's probably more correct to call it a superset of the DWS code.

sql-ledger's People

Contributors

ledger123 avatar tekki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sql-ledger's Issues

Add Assembly - Creates an empty & corrupted assembly entry when Description is not entered

Steps to reproduce:

  1. Go to Add Assembly
  2. Leave Description empty.
  3. Define valid Individual Items (Parts)
  4. Click on Save (Refer screenshot-1)
  5. Error is shown as in screenshot-2.
  6. But Assembly with blank Description is added to list as shown in screenshot-3
  7. Further it is not possible to either update this Assembly or delete the assembly.

Screenshot-1:
Screenshot from 2020-06-12 01-54-02

Screenshot-2:
Assembly_Add_1

Screenshot-3:
Assembly_Add_2

Payroll Deduction Amount Confusion

Hey there - been searching through the code to figure out how things work.

I have a payroll deduction table with rates per pay. First X dollars are taxed at %1, next Y dollars are taxes at %2 etc.

I've noted that the deduction calculator sorts and stops when pay is between above and below.

To add the previous amounts I have put their values in the amount column - the problem is that it does not take pay frequency into account like the rest of the table.

Here is my change

gopokyo-colinn@2059714

New branch: extended

We have a new branch that contains (for the moment) the following addition the the main branch:

  • quick calculation in sales quotations, orders and invoices

UTF-8: LaTeX templates

The editor has to support UTF-8, templates have to be read and written in UTF-8 when they are processed.

Documents not attaching to payroll transaction

I have not yet been able to determine the cause, but documents are not attaching to payroll transactions properly.

When I "list documents" I can see the descriptions of the files and that they are attached to the payroll transaction, but folder and filename are empty. When I click on the document description I am sent to a page where I can modify the folder an filename but not attempt to upload the pdf again

things I will check into:
Files upload have spaces them - issue?

documents are attaching to AP transactions

UTF-8: Input from browser

Requests from browser have to be decoded. At first sight, just a few changes in Form->new are required, but we will see.

txt printing problem (specific to Tekki version)

I have a problem with a POS printer (see sql-ledger forum)
In fact, printing an invoice txt file pos_invoice.txt or invoice.txt on the POS printer or Laser Printer gives an Error!
| lpr -PPrinter : Permission denied (it is not a permission problem : both printers print correctly Postscript in sql-ledger and txt files with command)

The new fact : I have 2 test versions of sql-ledger (Tekki and DWS) on another new computer SuSE 15.2 : txt printing is OK on the DWS version and not on the Tekki (but Tekki works with Unicode utf8 !)

Show only totals in VAT reports

In the next version it will be possible to reduce the VAT reports so they only show the totals and subtotals without the individual transactions.

This feature is sponsored by one of our customers.

Recently used

It would be nice to have lists of recently used objects.

Templates for customers and vendors

It would be nice to have templates for customers and vendors:

  • customer/vendor number starts with 'TPL'
  • they are only editable for the admin
  • they only have a button Save as New for all the other users

Add_payment api not working with invnumber or waybill

I successfully manage to call the api when I send the invoice id. But when I try with only the waybill or the invnumber, it does not work.

With invnumber, I get:

Login data for SQL-Ledger
Can't use an undefined value as a HASH reference at add_payment.pl line 42.

I get an error with waybill. What did I do wrong. I thought all 4 would have worked. DCN is empty so I never tried it.

#! /usr/bin/env perl
use Mojo::Base -strict;
use open ':std', ':encoding(utf8)';

use Mojo::UserAgent;
use Print::Colored ':all';

my $sl_url = 'http://localhost/sql-ledger';

say 'Login data for SQL-Ledger';

my $sl_username = 'admin@datasetname';

my $sl_password = 'sql-ledger';

my $ua        = Mojo::UserAgent->new;
my %sl_params = (login => $sl_username, path => 'bin/mozilla',);
my %search_params;

my $res = $ua->post(
    "$sl_url/login.pl",
    form => {action => 'login', password => $sl_password, %sl_params}
  )->result;



my %payment_params = (
  amount         => 100,
  #id             => 10080,
  #dcn            => 2,
  invnumber       => 5,
  #waybill         => 11,
  datepaid       => "02-02-2022",
  paymentaccount => "1060--Checking Account",
);

$res = $ua->post(
    "$sl_url/api.pl",
    form => {action => 'add_payment', %payment_params, %sl_params}
  )->result;

if ($res->json->{result} eq 'success') {
  say_ok 'Payment added.';
} else {
  say_error 'Error, payment not added!';
}

UTF-8: Translations

Non-UTF-8 translations have to be filtered out, files need a use uf8 header.

Stock Assembly - Check Inventory option is not working

I have created 1 part and 2 assemblies with following correlation:

Assembly1 uses Part1
Assembly2 uses Assembly1

Part is purchased by AP - Vendor Invoice and quantity is stocked to inventory.

After this, when I try to Stock Assembly by selecting the Check Inventory checkbox, no parts/assemblies are displayed, even when parts/assemblies are in sufficient quantity.

cc @Tekki

Assemby is duplicated when a previously posted invoice is edited

The image below is a representation of multiple assemblies whose inventories are tracked. Notice the duplicates that are automatically created when the previously posted invoices are edited. For example, M3 - Coir, M4 - Coir Bales 4.5 kg.

image

The following steps would demonstrate how these assemblies are being duplicated. Notice that in the above screenshot, M5 - Coir Bales 5 kg is listed only once and had been linked with M3 - Coir while creating the assembly.

Screenshot 2020-07-14 at 11 30 57 PM

Now, let's edit the invoice and update any field.
Consider invoice number S20210017 , update the internal note or any other field. Notice that the item invoiced is M5 - Coir Bales 5 kg (assembly that had no duplicate). Post the updated invoice.

image
Invoice S20210017

Once the invoice is re-posted, a duplicate assembly is generated automatically. The image below is the list of assemblies that are present after updating a posted invoice. A new ID is generated for the assembly M5 and has 2 entries.

image

Notice 2 entries for M5 that did not exist previously


This is causing issues for further invoicing where the users are prompted with multiple products with the same code and names. Would be great if you could explain the behavior and propose any solutions to this.

@Tekki

More information in account statements

Starting with the next version, all account statements will show for each transaction its description, if available, and the contra accounts.

This feature is sponsored by one of our customers.

customer problem after upgrade to 3.2.9.16

DBD::Pg::st execute failed: ERREUR: la colonne bk.qriban n'existe pas
LINE 8: bk.name AS bankname, bk.iban, bk.qriban, bk....
^
HINT: Peut-être que vous souhaitiez référencer la colonne « bk.iban ». at SL/CT.pm line 63.
Error!
SELECT ct.,
ad.id AS addressid, ad.address1, ad.address2, ad.city,
ad.state, ad.zipcode, ad.country,
b.description AS business, b.id AS business_id, s.
,
e.name AS employee, e.id AS employee_id,
g.pricegroup, g.id AS pricegroup_id,
m.description AS paymentmethod, m.id AS paymentmethod_id,
bk.name AS bankname, bk.iban, bk.qriban, bk.bic,
bk.membernumber, bk.clearingnumber,
ad1.address1 AS bankaddress1,
ad1.address2 AS bankaddress2,
ad1.city AS bankcity,
ad1.state AS bankstate,
ad1.zipcode AS bankzipcode,
ad1.country AS bankcountry,
ct.curr
FROM customer ct
JOIN address ad ON (ct.id = ad.trans_id)
LEFT JOIN business b ON (ct.business_id = b.id)
LEFT JOIN shipto s ON (ct.id = s.trans_id)
LEFT JOIN employee e ON (ct.employee_id = e.id)
LEFT JOIN pricegroup g ON (g.id = ct.pricegroup_id)
LEFT JOIN paymentmethod m ON (m.id = ct.paymentmethod_id)
LEFT JOIN bank bk ON (bk.id = ct.id)
LEFT JOIN address ad1 ON (bk.address_id = ad1.id)
WHERE ct.id = 23094
ERREUR: la colonne bk.qriban n'existe pas
LINE 8: bk.name AS bankname, bk.iban, bk.qriban, bk....
^
HINT: Peut-être que vous souhaitiez référencer la colonne « bk.iban ».

Time Card Screen

The screen to add and edit time cards could be improved:

  • dropdown shows project description (postponed)
  • focus on the part number if missing, otherwise on the description

After saving a card:

  • the same employee selected as before
  • the same project selected
  • date is the same as before

Select2 integration

Hi. Everybody probably agrees that getting rid of 10km long HTML <select> elements is good for the user experience.

@Tekki have you perhaps researched integrating any of the user friendly select controls into SL, such as https://select2.org

Wondering if there are any significant roadblocks, or perhaps it could be relatively plug n play.

Package names

No cuckoo packages!
Package names should match path names, for example the package of SL/AA.pm should be SL::AA, not AA. Locale inside 'Form.pm' should be called SL::Locale and reside in a separate file.

UTF-8: Database Connection

First step: Let DBD::Pg handle the connection details. We remove all the parameters (besides AutoCommit) and look what happens.

SQL queries for extending use case

If I want to create a new table for Folio. By my current understanding, recording data into this additional table should not have any impact on all the other operations. Would it be a bad idea to use the monitor panel to programmatically create entries into the Folio?

Extending the API

Hi. I want to understand how much effort it takes to write the the different methods in /bin/mozilla/api.pl?
We wanted to cover all the functionality through APIs. Many thanks.

Display all account statements at once

The next version will add a button to the trial balance that allows to display all account statements on one page.

This feature is sponsored by one of our customers.

UTF-8: Output to browser

Output to browser has to be encoded to UTF-8. Because of the thousands of print statements we have to use something like use open ':std' => ':utf8';. The scope of this directive may not be what we expect, there will be unwanted side effects.

Simple Markdown

The next version will add 3 simple Markdown styles that are processed in LaTeX templates.

*this is italic*
**this is bold**
[Github](https://github.com)

perldoc

We need pod entries at least for the names of the subroutines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.