Commit c1521394 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Major updates, changes & fixes

parent 745cc6d8
- ModuleID really needed in GL transactions?
* Purchasing
- Due date on supplier invoice, if not specified default to issuedate?
- no-item invoices .... use subtotal, taxtotal & invtotal
- Discount must still be added
* Invoicing
- Pull in due date from clients terms maybe?
- Discount must still be added
BEGIN;
# Loose linking to insert accounts
SELECT ID FROM gl_fincats WHERE Identifier = 'A01' INTO @fincat_asset;
SELECT ID FROM gl_fincats WHERE Identifier = 'B01' INTO @fincat_liability;
SELECT ID FROM gl_fincats WHERE Identifier = 'C01' INTO @fincat_equity;
SELECT ID FROM gl_fincats WHERE Identifier = 'D01' INTO @fincat_income;
SELECT ID FROM gl_fincats WHERE Identifier = 'E01' INTO @fincat_expense;
SELECT ID FROM gl_rwcats WHERE Identifier = '00' INTO @rwcat_asset;
SELECT ID FROM gl_rwcats WHERE Identifier = '20' INTO @rwcat_liability;
SELECT ID FROM gl_rwcats WHERE Identifier = '40' INTO @rwcat_equity;
SELECT ID FROM gl_rwcats WHERE Identifier = '60' INTO @rwcat_income;
SELECT ID FROM gl_rwcats WHERE Identifier = '80' INTO @rwcat_expense;
# 10
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,10,'Income & revenue',@fincat_income,@rwcat_income);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Sales',@fincat_income,@rwcat_income);
SELECT last_insert_id() INTO @tmp2;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp2,10,'Hardware',@fincat_income,@rwcat_income),
(@tmp2,20,'Software',@fincat_income,@rwcat_income);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,20,'Services',@fincat_income,@rwcat_income);
# 20
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,20,'Cost of sales',@fincat_expense,@rwcat_expense);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Hardware',@fincat_expense,@rwcat_expense),
(@tmp,20,'Software',@fincat_expense,@rwcat_expense);
# 30
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,30,'General expenses',@fincat_expense,@rwcat_expense);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Advertising',@fincat_expense,@rwcat_expense),
(@tmp,15,'Bank charges & interest',@fincat_expense,@rwcat_expense),
(@tmp,20,'Insurance',@fincat_expense,@rwcat_expense),
(@tmp,25,'Office supplies',@fincat_expense,@rwcat_expense),
(@tmp,30,'Rent',@fincat_expense,@rwcat_expense),
(@tmp,35,'Repairs & maintenance',@fincat_expense,@rwcat_expense),
(@tmp,40,'Telephone',@fincat_expense,@rwcat_expense),
(@tmp,45,'Travel & entertainment',@fincat_expense,@rwcat_expense),
(@tmp,50,'Utilities',@fincat_expense,@rwcat_expense);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,32,'Payroll expenses',@fincat_expense,@rwcat_expense);
# 40
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,40,'Retained Income / Accumulated Loss',@fincat_equity,@rwcat_equity);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Share Capital',@fincat_equity,@rwcat_equity);
# 50
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,50,'Long-term liabilities',@fincat_liability,@rwcat_liability);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Bank loans',@fincat_liability,@rwcat_liability);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,20,'Shareholder / director loans',@fincat_liability,@rwcat_liability);
# 60
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,60,'Capital / fixed assets',@fincat_asset,@rwcat_asset);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Land & buildings',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,20,'Motor vehicles',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,30,'Computer equipment',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,40,'Office equipment',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,50,'Furniture & fittings',@fincat_asset,@rwcat_asset);
# 70
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,72,'Investments',@fincat_asset,@rwcat_asset);
# 80
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,80,'Current assets',@fincat_asset,@rwcat_asset);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Bank accounts',@fincat_asset,@rwcat_asset);
SELECT last_insert_id() INTO @tmp2;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp2,10,'Cheque account',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,20,'Petty cash',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,70,'Inventory control account',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,90,'Customer control account',@fincat_asset,@rwcat_asset);
# 90
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,90,'Current liabilities',@fincat_liability,@rwcat_liability);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Loan accounts',@fincat_liability,@rwcat_liability);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,20,'Bank accounts',@fincat_liability,@rwcat_liability);
SELECT last_insert_id() INTO @tmp2;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp2,10,'Credit Card Control Account',@fincat_liability,@rwcat_liability),
(@tmp2,20,'Credit Card: Joe Soap',@fincat_liability,@rwcat_liability),
(@tmp2,30,'Petrol Card: Joe Soap',@fincat_liability,@rwcat_liability);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,70,'TAX control account',@fincat_liability,@rwcat_liability);
SELECT last_insert_id() INTO @tmp2;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp2,10,'VAT',@fincat_liability,@rwcat_liability),
(@tmp2,20,'Income tax',@fincat_liability,@rwcat_liability),
(@tmp2,30,'Payroll taxes',@fincat_liability,@rwcat_liability);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,90,'Supplier control account',@fincat_liability,@rwcat_liability);
INSERT INTO tax_types (Description,TaxGLAccID,TaxRate) VALUES ('South Africa: Zero Rated','',0);
INSERT INTO tax_types (Description,TaxGLAccID,TaxRate) VALUES ('South Africa: VAT @14%','',14);
COMMIT;
......@@ -337,9 +337,6 @@ CREATE TABLE tax_types (
PRIMARY KEY (ID)
) ENGINE=InnoDB;
INSERT INTO tax_types (Description,TaxGLAccID,TaxRate) VALUES ('South Africa: Zero Rated','',0);
INSERT INTO tax_types (Description,TaxGLAccID,TaxRate) VALUES ('South Africa: VAT @14%','',14);
#
......@@ -517,115 +514,8 @@ CREATE TABLE gl_accounts (
FOREIGN KEY (RwCatID) REFERENCES gl_rwcats(ID)
) ENGINE=InnoDB;
# Loose linking to insert accounts
SELECT ID FROM gl_fincats WHERE Identifier = 'A01' INTO @fincat_asset;
SELECT ID FROM gl_fincats WHERE Identifier = 'B01' INTO @fincat_liability;
SELECT ID FROM gl_fincats WHERE Identifier = 'C01' INTO @fincat_equity;
SELECT ID FROM gl_fincats WHERE Identifier = 'D01' INTO @fincat_income;
SELECT ID FROM gl_fincats WHERE Identifier = 'E01' INTO @fincat_expense;
SELECT ID FROM gl_rwcats WHERE Identifier = '00' INTO @rwcat_asset;
SELECT ID FROM gl_rwcats WHERE Identifier = '20' INTO @rwcat_liability;
SELECT ID FROM gl_rwcats WHERE Identifier = '40' INTO @rwcat_equity;
SELECT ID FROM gl_rwcats WHERE Identifier = '60' INTO @rwcat_income;
SELECT ID FROM gl_rwcats WHERE Identifier = '80' INTO @rwcat_expense;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,1000,'Current assets',@fincat_asset,@rwcat_asset);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Bank accounts',@fincat_asset,@rwcat_asset);
SELECT last_insert_id() INTO @tmp2;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp2,10,'Cheque Account',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,20,'Petty cash',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,98,'Stock control',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,99,'Accounts receivable',@fincat_asset,@rwcat_asset);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,4000,'Current liabilities',@fincat_liability,@rwcat_liability);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Tax payable',@fincat_liability,@rwcat_liability);
SELECT last_insert_id() INTO @tmp2;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp2,10,'VAT control account',@fincat_liability,@rwcat_liability);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,99,'Accounts payable',@fincat_liability,@rwcat_liability);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,30,'Banking',@fincat_liability,@rwcat_liability);
SELECT last_insert_id() INTO @tmp2;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp2,10,'Credit Card Control Account',@fincat_liability,@rwcat_liability),
(@tmp2,20,'Credit Card: Joe Soap',@fincat_liability,@rwcat_liability),
(@tmp2,30,'Petrol Card: Joe Soap',@fincat_liability,@rwcat_liability);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,5000,'Long-term liabilities',@fincat_liability,@rwcat_liability);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Bank loan',@fincat_liability,@rwcat_liability);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,7000,'Share capital',@fincat_equity,@rwcat_equity);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,8000,'Revenue',@fincat_income,@rwcat_income);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Sales',@fincat_income,@rwcat_income);
SELECT last_insert_id() INTO @tmp2;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp2,10,'Hardware',@fincat_income,@rwcat_income),
(@tmp2,20,'Software',@fincat_income,@rwcat_income);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,20,'Services',@fincat_income,@rwcat_income);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(NULL,9000,'Expenses',@fincat_expense,@rwcat_expense);
SELECT last_insert_id() INTO @tmp;
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,10,'Advertising',@fincat_expense,@rwcat_expense),
(@tmp,15,'Bank charges & interest',@fincat_expense,@rwcat_expense),
(@tmp,20,'Insurance',@fincat_expense,@rwcat_expense),
(@tmp,25,'Office supplies',@fincat_expense,@rwcat_expense),
(@tmp,30,'Rent',@fincat_expense,@rwcat_expense),
(@tmp,35,'Repairs & maintenance',@fincat_expense,@rwcat_expense),
(@tmp,40,'Telephone',@fincat_expense,@rwcat_expense),
(@tmp,45,'Travel & entertainment',@fincat_expense,@rwcat_expense),
(@tmp,50,'Utilities',@fincat_expense,@rwcat_expense);
INSERT INTO gl_accounts (ParentGLAccID,Ref,Name,FinCatID,RwCatID) VALUES
(@tmp,1000,'Cost of goods sold',@fincat_expense,@rwcat_expense);
......
......@@ -94,16 +94,16 @@ my $GL_cmds = {
'commands' => [
{
'command' => 'chart',
'regex' => 'chart$',
'regex' => 'chart',
'desc' => 'Dispaly chart of accounts',
'help' => 'chart',
'help' => 'chart [format="<text or html>"]',
'function' => \&ias::client::cmdline::GL::chart,
},
{
'command' => 'show',
'regex' => 'show',
'desc' => 'Dispaly list of entries in an account',
'help' => 'show accid="<account id>"',
'help' => 'show acc="<account ref>"',
'function' => \&ias::client::cmdline::GL::show,
},
{
......@@ -123,7 +123,7 @@ my $Inventory_cmds = {
'command' => 'create',
'regex' => 'create',
'desc' => 'Create inventory item',
'help' => 'create ref="<ref>" type="<product or service>" [mode="<bulk or track>"] desc="<description>" '.
'help' => 'create ref="<ref>" type="<product or service>" [mode="<bulk or track for products>"] desc="<description>" '.
'incomeacc="<income account>" [inventoryacc="<inventory account>"] [expenseacc="<expense account>"] '.
'sellprice="<sell price>" taxtype="<tax type>" taxmode="<price is incl or excl>" [discountable="<yes or no>"]',
'function' => \&ias::client::cmdline::Inventory::create,
......@@ -132,7 +132,7 @@ my $Inventory_cmds = {
'command' => 'remove',
'regex' => 'remove',
'desc' => 'Remove inventory item',
'help' => 'remove itemid="<item id>"',
'help' => 'remove item="<item ref>"',
'function' => \&ias::client::cmdline::Inventory::remove,
},
{
......@@ -153,35 +153,35 @@ my $Supplier_invoice_cmds = {
'command' => 'create',
'regex' => 'create',
'desc' => 'Create a supplier invoice',
'help' => 'create supplierid="<supplier id>" invoicenum="<reference>" supplierinvnum="<suppliers invoice number>" issuedate="<issue date" duedate="<due date>" [ordernum="<order number>"] [subtotal="<sub total>"] [taxtotal="<tax total>"] [invtotal="<inv total>"] [note="<notes>]"',
'help' => 'create supplier="<supplier ref>" invoicenum="<reference>" supplierinvnum="<suppliers invoice number>" issuedate="<issue date" duedate="<due date>" [ordernum="<order number>"] [subtotal="<sub total>"] [taxtotal="<tax total>"] [invtotal="<inv total>"] [note="<notes>]"',
'function' => \&ias::client::cmdline::Purchasing::createInvoice,
},
{
'command' => 'linkinventory',
'regex' => 'linkinvent(?:ory)?',
'desc' => 'Link inventory item',
'help' => 'linkinvent invoiceid="<invoice id>" inventoryid="<inventory item id>" desc="<description of item>" [ref="<item ref, ie. serial number>"] quantity="<quantity>" [unit="<unit>"] unitprice="<unit price>" discount="<discount>" taxtypeid="<tax type id>" taxmode="<incl or excl>"',
'help' => 'linkinvent invoice="<invoice ref>" inventory="<inventory item>" desc="<description of item>" [ref="<item ref, ie. serial number>"] quantity="<quantity>" [unit="<unit>"] unitprice="<unit price>" discount="<discount>" taxtypeid="<tax type id>" taxmode="<incl or excl>"',
'function' => \&ias::client::cmdline::Purchasing::linkInventoryItem,
},
{
'command' => 'linkexpense',
'regex' => 'linkexp(?:ense)?',
'desc' => 'Link expense',
'help' => 'linkexp invoiceid="<invoice id>" accid="<expense account>" desc="<description of item>" [ref="<item ref, ie. serial number>"] quantity="<quantitiy>" [unit="<unit>"] unitprice="<unitprice>" discount="<discount in %>" taxtypeid="<tax type id>" taxmode="<incl or excl>"',
'help' => 'linkexp invoice="<invoice ref>" acc="<expense account>" desc="<description of item>" [ref="<item ref, ie. serial number>"] quantity="<quantitiy>" [unit="<unit>"] unitprice="<unitprice>" discount="<discount in %>" taxtypeid="<tax type id>" taxmode="<incl or excl>"',
'function' => \&ias::client::cmdline::Purchasing::linkExpenseItem,
},
{
'command' => 'removeitem',
'regex' => 'removeitem',
'desc' => 'Remove item from invoice',
'help' => 'removeitem invoiceid="<invoice id>" itemid="<item id>"',
'help' => 'removeitem invoice="<invoice ref>" itemid="<item id>"',
'function' => \&ias::client::cmdline::Purchasing::removeItem,
},
{
'command' => 'remove',
'regex' => 'remove',
'desc' => 'Remove invoice',
'help' => 'remove invoiceid="<invoice id>"',
'help' => 'remove invoice="<invoice ref>"',
'function' => \&ias::client::cmdline::Purchasing::removeInvoice,
},
{
......@@ -195,14 +195,14 @@ my $Supplier_invoice_cmds = {
'command' => 'show',
'regex' => 'show',
'desc' => 'Show supplier invoices',
'help' => 'show invoiceid="<invoice id>"',
'help' => 'show invoice="<invoice ref>"',
'function' => \&ias::client::cmdline::Purchasing::show,
},
{
'command' => 'post',
'regex' => 'post',
'desc' => 'Post supplier invoice',
'help' => 'post invoiceid="<invoice id>"',
'help' => 'post invoice="<invoice ref>"',
'function' => \&ias::client::cmdline::Purchasing::post,
},
],
......@@ -216,30 +216,30 @@ my $Client_invoice_cmds = {
'command' => 'create',
'regex' => 'create',
'desc' => 'Create a client invoice',
'help' => 'create clientid="<client id>" invoicenum="<reference>" issuedate="<issue date" duedate="<due date>" [ordernum="<order number>"] [note="<notes>]"',
'help' => 'create client="<client ref>" invoicenum="<reference>" issuedate="<issue date" duedate="<due date>" [ordernum="<order number>"] [note="<notes>]"',
'function' => \&ias::client::cmdline::Invoicing::createInvoice,
},
{
'command' => 'linkinventory',
'regex' => 'linkinvent(?:ory)?',
'desc' => 'Link inventory item',
'help' => 'linkinvent invoiceid="<invoice id>" inventoryid="<inventory item id>" [desc="<description of item>"] quantity="<quantity>" [unitprice="<unit price>"] [discount="<discount>"]',
'help' => 'linkinvent invoice="<invoice number>" inventory="<inventory item ref>" [desc="<description of item>"] quantity="<quantity>" [unitprice="<unit price>"] [discount="<discount>"]',
'function' => \&ias::client::cmdline::Invoicing::linkInventoryItem,
},
{
'command' => 'removeitem',
'regex' => 'removeitem',
'desc' => 'Remove item from invoice',
'help' => 'removeitem invoiceid="<invoice id>" itemid="<item id>"',
'help' => 'removeitem invoice="<invoice number>" itemid="<item id>"',
'function' => \&ias::client::cmdline::Invoicing::removeItem,
},
{
'command' => 'remove',
'regex' => 'remove',
'desc' => 'Remove invoice',
'help' => 'remove invoiceid="<invoice id>"',
'function' => \&ias::client::cmdline::Invoicing::removeInvoice,
},
# {
# 'command' => 'remove',
# 'regex' => 'remove',
# 'desc' => 'Remove invoice',
# 'help' => 'remove invoice="<invoice number>"',
# 'function' => \&ias::client::cmdline::Invoicing::removeInvoice,
# },
{
'command' => 'list',
'regex' => 'list',
......@@ -251,14 +251,14 @@ my $Client_invoice_cmds = {
'command' => 'show',
'regex' => 'show',
'desc' => 'Show client invoices',
'help' => 'show invoiceid="<invoice id>"',
'help' => 'show invoice="<invoice number>"',
'function' => \&ias::client::cmdline::Invoicing::show,
},
{
'command' => 'post',
'regex' => 'post',
'desc' => 'Post client invoice',
'help' => 'post invoiceid="<invoice id>"',
'help' => 'post invoiceid="<invoice number>"',
'function' => \&ias::client::cmdline::Invoicing::post,
},
],
......@@ -272,28 +272,28 @@ my $Suppliers_cmds = {
'command' => 'create',
'regex' => 'create',
'desc' => 'Create a supplier',
'help' => 'create ref="<reference>" name="<supplier name>" [reg="<registration num>"] [taxref="<tax reference number>"] accid="<GL account>" [contactperson="<contact person name>"]',
'help' => 'create ref="<reference>" name="<supplier name>" [reg="<registration num>"] [taxref="<tax reference number>"] acc="<GL account>" [contactperson="<contact person name>"]',
'function' => \&ias::client::cmdline::Suppliers::create,
},
{
'command' => 'linkaddr',
'regex' => 'linkaddr',
'desc' => 'Link address',
'help' => 'linkaddr supplierid="<item id>" type="<physical or postal>" address="<address>"',
'help' => 'linkaddr supplier="<supplier ref>" type="<physical or postal>" address="<address>"',
'function' => \&ias::client::cmdline::Suppliers::linkAddress,
},
{
'command' => 'linkphnum',
'regex' => 'linkphnum',
'desc' => 'Link phone number',
'help' => 'linkphnum supplierid="<item id>" type="<phone or fax>" phnumber="<phone number>" [name="<name>"]',
'help' => 'linkphnum supplier="<supplier ref>" type="<phone or fax>" phnumber="<phone number>" [name="<name>"]',
'function' => \&ias::client::cmdline::Suppliers::linkPhoneNumber,
},
{
'command' => 'remove',
'regex' => 'remove',
'desc' => 'Remove supplier',
'help' => 'remove supplierid="<item id>"',
'help' => 'remove supplier="<supplier ref>"',
'function' => \&ias::client::cmdline::Suppliers::remove,
},
{
......@@ -307,7 +307,7 @@ my $Suppliers_cmds = {
'command' => 'show',
'regex' => 'show',
'desc' => 'Show supplier',
'help' => 'show supplierid="<supplier id>"',
'help' => 'show supplier="<supplier ref>"',
'function' => \&ias::client::cmdline::Suppliers::show,
},
......@@ -330,28 +330,28 @@ my $Clients_cmds = {
'command' => 'create',
'regex' => 'create',
'desc' => 'Create a client',
'help' => 'create ref="<reference>" name="<client name>" [reg="<registration num>"] [taxref="<tax reference number>"] accid="<GL account>" [contactperson="<contact person name>"]',
'help' => 'create ref="<reference>" name="<client name>" [reg="<registration num>"] [taxref="<tax reference number>"] glacc="<GL account>" [contactperson="<contact person name>"]',
'function' => \&ias::client::cmdline::Clients::create,
},
{
'command' => 'linkaddr',
'regex' => 'linkaddr',
'desc' => 'Link address',
'help' => 'linkaddr clientid="<item id>" type="<physical or postal>" address="<address>"',
'help' => 'linkaddr client="<item id>" type="<physical or postal>" address="<address>"',
'function' => \&ias::client::cmdline::Clients::linkAddress,
},
{
'command' => 'linkphnum',
'regex' => 'linkphnum',
'desc' => 'Link phone number',
'help' => 'linkphnum clientid="<item id>" type="<phone or fax>" phnumber="<phone number>" [name="<name>"]',
'help' => 'linkphnum client="<item id>" type="<phone or fax>" phnumber="<phone number>" [name="<name>"]',
'function' => \&ias::client::cmdline::Clients::linkPhoneNumber,
},
{
'command' => 'remove',
'regex' => 'remove',
'desc' => 'Remove client',
'help' => 'remove clientid="<item id>"',
'help' => 'remove client="<item id>"',
'function' => \&ias::client::cmdline::Clients::remove,
},
{
......@@ -365,7 +365,7 @@ my $Clients_cmds = {
'command' => 'show',
'regex' => 'show',
'desc' => 'Show client',
'help' => 'show clientid="<client id>"',
'help' => 'show client="<client ref>"',
'function' => \&ias::client::cmdline::Clients::show,
},
......
......@@ -40,7 +40,7 @@ sub list
+========+===========+===============================================+=====================+================+=================+
END
foreach my $item (@{$res}) {
print swrite(<<'END', $item->{'ID'}, $item->{'Ref'}, $item->{'Name'}, defined($item->{'RegNumber'}) ? $item->{'RegNumber'} : '-', defined($item->{'TaxReference'}) ? $item->{'TaxReference'} : '-', $item->{'GLAcc'});
print swrite(<<'END', $item->{'ID'}, $item->{'Ref'}, $item->{'Name'}, defined($item->{'RegNumber'}) ? $item->{'RegNumber'} : '-', defined($item->{'TaxReference'}) ? $item->{'TaxReference'} : '-', $item->{'GLAccRef'});
| @<<<<< | @<<<<<<<< | @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | @<<<<<<<<<<<<<<<<<< | @<<<<<<<<<<<<< | @<<<<<<<<<<<<<< |
END
}
......@@ -72,7 +72,7 @@ sub create
return -202;
}
if (!defined($parms->{'accid'})) {
if (!defined($parms->{'glacc'})) {
return -202;
}
......@@ -80,7 +80,7 @@ sub create
my $detail;
$detail->{'Ref'} = $parms->{'ref'};
$detail->{'Name'} = $parms->{'name'};
$detail->{'GLAccID'} = $parms->{'accid'};
$detail->{'GLAccRef'} = $parms->{'glacc'};
$detail->{'RegNumber'} = $parms->{'reg'};
$detail->{'TaxReference'} = $parms->{'taxref'};
my $res = soapCall($OUT,"Clients","createClient",$detail);
......@@ -111,7 +111,7 @@ sub linkAddress
my $parms = parseArgs(@args);
if (!defined($parms->{'clientid'})) {
if (!defined($parms->{'client'})) {
return -202;
}
......@@ -125,7 +125,7 @@ sub linkAddress
my $detail;
$detail->{'ClientID'} = $parms->{'clientid'};
$detail->{'ClientRef'} = $parms->{'client'};
$detail->{'Type'} = $parms->{'type'};
$detail->{'Address'} = $parms->{'address'};
my $res = soapCall($OUT,"Clients","linkAddress",$detail);
......@@ -153,7 +153,7 @@ sub linkPhoneNumber
my $parms = parseArgs(@args);